summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/kvec/errors.rs
diff options
context:
space:
mode:
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>2026-11-02 13:49:47 +0100
committerJakub Kicinski <kuba@kernel.org>2026-11-09 15:34:30 -0800
commite4ea8671cb79b7300c9199d5d8017b7c035d5822 (patch)
tree7c49ce6c590210ae4a8d4ec8aff80cdc4c0cd493 /rust/kernel/alloc/kvec/errors.rs
parent90e5d84086d95ac45197028b98ad9059b245fc1c (diff)
xsk: do not clear frags flag when acquiring a buffer
xp_alloc() and xsk_buff_set_size() reset xdp_buff::flags of every buffer they hand out. In aligned mode, duplicate fill ring addresses map to the same xskb, so the head of a frame still being gathered can be handed out again and lose XDP_FLAGS_HAS_FRAGS. xsk_buff_add_frag() rejects the duplicate and the frame is dropped, but xsk_buff_free() leaves its frags on pool->xskb_list, where they are taken as frags of the next frame. Keep XDP_FLAGS_HAS_FRAGS on hand-out and clear it when the frags are released, in xsk_buff_free() and xsk_rcv_zc(). The driver XDP_TX paths, bpf_xdp_adjust_tail() and bpf_xdp_pull_data() already clear it, and pool->heads starts zeroed. Other flags are still reset on hand-out, as nothing clears them on release. Since xsk_rcv_zc() now clears the flag, i40e must count Rx bytes before running the XDP program, like ice and libeth. Fixes: f7f6aa8e2438 ("xsk: make xsk_buff_pool responsible for clearing xdp_buff::flags") Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Reviewed-by: Björn Töpel <bjorn@kernel.org> Link: https://patch.msgid.link/20261102124950.958345-7-maciej.fijalkowski@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions