Skip to content

Conversation

@akhinvasara-jumptrading
Copy link
Contributor

@akhinvasara-jumptrading akhinvasara-jumptrading commented Jan 3, 2026

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.

@akhinvasara-jumptrading akhinvasara-jumptrading changed the title net: correct net_tx_ready fseq comparison net: helpers for fd_xdp_ring_t Jan 5, 2026

uint fill_prod = fill_ring->cached_prod;
uint fill_mask = (fill_ring->depth)-1U;
ulong frame_mask = FD_NET_MTU - 1UL;
Copy link
Contributor

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
ripatel-fd previously approved these changes Jan 6, 2026
Copy link
Contributor

@ripatel-fd ripatel-fd left a 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

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

Successfully merging this pull request may close these issues.

2 participants