Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ansisatteka opened this issue Nov 19, 2022 · 0 comments
Assignees

Comments

@ansisatteka
Copy link

ansisatteka commented Nov 19, 2022

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.

@slavc slavc self-assigned this Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants