xdp
xdp copied to clipboard
Q: what is the correct way to use this for RX and TX at the same time?
Hi, I am trying to figure out a correct way to use this pkg for sending & receiving packets over same AF_XDP socket simultaneously, all the AF_XDP socket example I could find is either TX only or RX only or like a server (e.g. receive a packet first, do sth, then send a packet out in one run); but I want to do sending and receiving at the same time; this package doesn't seem to be routine safe, so I can't put RX and TX into two different go routines, however by having both RX and TX in one routine doesn't seem to provide expected performance, sometime it is even slower than using AF_PACKET socket;
so I wonder what is correct way to do this? is there any example that does this sort of thing?
I created a PR #12 that allows TX and RX of same socket could be in separate go routine; it addressed the above use case with expected performance
Had the same problem myself recently, thanks for submitting a diff to address this!
Could you show an example to use it?please.
Could you show an example to use it?please.
you could take a look some use of it in etherconn, check the xdpSock.send() and xdpSock.recv()