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.