Fix FILL/COMPLETION ring element sizes in the AF_XDP page - #292
Merged
dylandreimerink merged 1 commit intoSep 5, 2026
Merged
Conversation
The XSK setup example sized all four ring mmaps with sizeof(struct xdp_desc), but the FILL and COMPLETION rings are arrays of plain __u64 UMEM addresses, not descriptors - see libxdp's xsk_umem__create_with_fd (off.fr.desc + fill_size * sizeof(__u64)) and the kernel's xdp_umem_ring (u64 desc[]). The same mistake appeared in the ring-access line and in the ring-buffer concept section further down the page. Size the FILL/COMPLETION mappings with sizeof(__u64), type their ring pointers as __u64 *, and add a short note explaining the difference. Fixes isovalent#239 Signed-off-by: Ashwani Yadav <22ashwaniyadav@gmail.com>
Contributor
Author
|
@dylandreimerink will appreciate a review !! |
dylandreimerink
approved these changes
Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #239
The XSK setup example sized all four ring mmaps with
sizeof(struct xdp_desc), but the FILL and COMPLETION rings are arrays of plain_u64UMEM addresses, not descriptors. The same mistake appeared in the ring-access line right below the mmap call, and in the ring-buffer concept section further down the page.Verified against libxdp and the kernel
xsk_umem_create_with_fdmaps the fill ring withoff.fr.desc + fill_size * sizeof(_u64)(and the completion ring likewise), while the RX ring usesoff.rx.desc + rx_size * sizeof(struct xdp_desc)- exactly the split the reporter pointed at (xsk.c#L258, xsk.c#L1167)xdp_rxtx_ring { …; struct xdp_desc desc[] }vsxdp_umem_ring { …; u64 desc[] }(net/xdp/xsk_queue.h)Changes
sizeof({struct xdp_desc,struct xdp_desc,__u64,__u64}), matching the page's existing{rx,tx,fill,completion}shorthand one-to-onestruct xdp_desc *and FILL/COMPLETION rings__u64 *(the old single line also used invalid array syntax)struct xdp_desc)" now names both entry types