Conversation
Add multi-buffer (scatter-gather) support for AF_XDP zero-copy mode on kernels >= 6.6 that expose the xsk_buff_add_frag() API. Tx path: - Add a frame-atomic batch fast path (xsk_tx_peek_release_desc_batch) that guarantees complete frames are never truncated on the wire. - Fall back to per-descriptor peek for shared-pool configurations. - Track per-packet descriptor count (xsk_tx_nr_descs) for correct completion accounting. Rx path: - Assemble multi-descriptor packets into xdp_buff frag chains. - Size XDP_PASS skbs for the full reassembled packet to prevent skb_shared_info corruption on __skb_put(). - Properly free frag chains on FORWARD/DROP/RECYCLE/alloc-failure to prevent double-free and use-after-free. Advertise xdp_zc_max_segs clamped to min(tx_sgl, rx_sgl, MAX_SKB_FRAGS+1) so the stack never hands frames the datapath cannot fit. Guarded by ENA_XSK_MB_SUPPORT (ENA_AF_XDP_SUPPORT && ENA_HAVE_XSK_MULTI_BUFF).
Contributor
|
Hi @zz85 Thank you for submitting this pull request, apologies for not replying sooner. |
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.
Add multi-buffer (scatter-gather) support for AF_XDP zero-copy mode on kernels >= 6.6 that expose the xsk_buff_add_frag() API.
Tx path:
Rx path:
Advertise xdp_zc_max_segs clamped to min(tx_sgl, rx_sgl, MAX_SKB_FRAGS+1) so the stack never hands frames the datapath cannot fit.
Guarded by ENA_XSK_MB_SUPPORT (ENA_AF_XDP_SUPPORT && ENA_HAVE_XSK_MULTI_BUFF).
Issue #, if available:
Description of changes:
This challenge allows receiving and sending of Jumbo frames using AF_XDP + Zero copy with the ENA driver
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.