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

Q: what is the correct way to use this for RX and TX at the same time? #11

Open
hujun-open opened this issue Jun 15, 2021 · 4 comments
Open
Assignees

Comments

@hujun-open
Copy link
Contributor

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?

@hujun-open
Copy link
Contributor Author

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

@slavc slavc self-assigned this Jun 18, 2021
@slavc
Copy link
Collaborator

slavc commented Jul 5, 2021

Had the same problem myself recently, thanks for submitting a diff to address this!

@yvanu
Copy link

yvanu commented Oct 26, 2023

Could you show an example to use it?please.

@hujun-open
Copy link
Contributor Author

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()

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

3 participants