-
Notifications
You must be signed in to change notification settings - Fork 389
net: helpers for fd_xdp_ring_t #7658
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
base: main
Are you sure you want to change the base?
net: helpers for fd_xdp_ring_t #7658
Conversation
d4580e9 to
b7a3fde
Compare
|
|
||
| uint fill_prod = fill_ring->cached_prod; | ||
| uint fill_mask = (fill_ring->depth)-1U; | ||
| ulong frame_mask = FD_NET_MTU - 1UL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a static assertion checking that FD_NET_MTU is a power of 2?
ripatel-fd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the fd_xsk.h API is a bit much, I would have just done the comparisons in line. But looks extensively tested, so I'm happy with it
b7a3fde to
ccf08c2
Compare
Prompted by a bug reported by @colinlyguo
ccf08c2 to
57890af
Compare
This PR factors out the cached fseq logic into fd_xdp_ring_{empty,full} for use in the xdp tile. It adds extensive unit tests for those helpers, and for net_tx_ready (which was slightly refactored for cleaner testing).
This PR also fixes the logic inversion bug reported in https://github.com/firedancer-io/auditor-internal/issues/360.