Skip to content

xsk: Fixes for AF_XDP fragment handling

Nikhil P. Rao netdev 5 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 0 repliesApplied 2/2
  2. v42 patches 3 repliesSuperseded
  3. v32 patches 1 replySuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches4 repliesSuperseded
v12 patches1 replySuperseded

Changes in v5 from the cover letter

- Patch 2:
* Use early return for non-fragment case for better readability (Jakub)

Patches in v5 All 2 applied

#Subject and filesSizeRepliesApplied
1/2xsk: Fix fragment node deletion to prevent buffer leakinclude/net/xdp_sock_drv.h net/xdp/xsk.c+4 -40 repliesApplied
2/2xsk: Fix zero-copy AF_XDP fragment dropnet/xdp/xsk.c+15 -90 repliesApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchMaciej Fijalkowski
1/2A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH net v5 0/2] xsk: Fixes for AF_XDP fragment handling

This series fixes two issues in AF_XDP zero-copy fragment handling:

Patch 1 fixes a buffer leak caused by incorrect list node handling after commit b692bf9a7543. The list_node field is now reused for both the xskb pool list and the buffer free list. Using list_del() instead of list_del_init() causes list_empty() checks in xp_free() to fail, preventing buffers from being added to the free list.

Patch 2 fixes partial packet delivery to userspace. In the zero-copy path, if the Rx queue fills up while enqueuing fragments, the remaining fragments are dropped, causing the application to receive incomplete packets. The fix ensures the Rx queue has sufficient space for all fragments before starting to enqueue them.

v5 changes:
- Patch 2:
* Use early return for non-fragment case for better readability (Jakub)

v4 changes:
- Patch 2:
* Fix uninitialized err when sufficient space for all fragments is not available [2]

v3 changes:
- Patch 1: Carried Acked-by tags from v2 on patch 1
- Patch 2:
* Check for free space only for the multi-buffer case, this preserves single buffer performance (Maciej)
* Fix return without freeing buffer when sufficient space for all fragments is not available

v2 changes:
- Fix indentation issue reported by kernel test robot [1]

[1] https://lore.kernel.org/oe-kbuild-all/[email protected]/
[2] https://lore.kernel.org/oe-kbuild-all/[email protected]/

Nikhil P. Rao (2):
xsk: Fix fragment node deletion to prevent buffer leak
xsk: Fix zero-copy AF_XDP fragment drop

 include/net/xdp_sock_drv.h |  6 +++---
 net/xdp/xsk.c              | 26 ++++++++++++++++----------
 2 files changed, 19 insertions(+), 13 deletions(-)
Signature · 1 line
2.43.0