Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

At high throughput receiving same packet twice at expense of another packet disappearing altogether. #24

@ansisatteka

Description

@ansisatteka

I have a simple two namespace setup where they are connected with two veth pairs.

When I run iperf in udp mode at around 10Mbps target bandwidth I don't see any issues.

However, when I increase target bandwidth over 100Mbps I start to see that few packets are never seen by my xdp program and exactly one nearby packet is duplicated, because addr field in unix.XDPDesc points to the same memory for those two packets. In other words Receive() of xdp.Socket returns:

inDescs= [{33024 1512 0} {37120 1512 0} {33024 1512 0}]<--- duplicate 33024 here

Snippet of code looks like this and is based on example that comes with this library:

`func forwardFrames(input *xdp.Socket, inLinkName string, output *xdp.Socket, outLinkName string) (numBytes uint64, numFrames uint64) {
inDescs := input.Receive(input.NumReceived())
freeTxSlots := output.NumFreeTxSlots()
outDescs := output.GetDescs(freeTxSlots, false)

if len(inDescs) > len(outDescs) {
	inDescs = inDescs[:len(outDescs)]
}
numFrames = uint64(len(inDescs))
fmt.Println("inDescs=", inDescs)`

I have tried different Ubuntu versions starting from 20.04.1 all the way to 22.10 and issue happens with all stock kernels.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions