Closed sevagh closed 5 years ago
This code will send the packet back over the interface it's received upon, not back to the kernel. So TX means send it out of the interface, and RX is the receive path on the interface. The example below uses the same ingress and egress interface.
So TX does not mean the same as XDP_PASS, XDP_PASS continue the packet where TX does not. AF_XDP has no built-in feature to re-insert the packet back into the kernel.
Thank you.
Hello. I'm having a hard time adapting the advanced03 AF_XDP code to do a similar action to UDP packets - unless I'm really fundamentally misunderstanding the direction of the rx/tx flow.
I have a socat listener on the external ip of my
veth-adv03
:I send
hello world 1-10
with socat via the internal ip, after runningtestenv.sh enter
:Finally, I have XDP code redirecting half the packets to AF_XDP, where I simply want to do a random
sleep
, and send them, to scramble the packets and have them arrive out of order.My desired result is:
However, in my AF_XDP code, the packet doesn't go anywhere:
As a workaround, I can send those AF_XDP rx packets above, on a different, regular AF_INET6 UDP socket, to achieve my desired goal:
Is using a regular UDP socket the only way to achieve what I need, or should it be possible to do so with AF_XDP?