Skip to content

net/mlx5e: Prevent stale XSK buffer release on refill retries

Jerome Tollet bpf linux-rdma lkml netdev stable 4 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. v4 Latest2 patches 3 repliesApplied 2/2
  2. v32 patches 3 repliesSuperseded
  3. v21 patch 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch1 replySuperseded

Changes in v4 from the cover letter

- Keep patch 1 unchanged.
- Move the MPWQE bitmap update from the release loop to the common XSK allocator error path, as suggested by Dragos.
- Validate both early and partial allocation failures and run an additional zero-copy pressure test.

Patches in v4 All 2 applied

#Subject and filesSizeRepliesApplied
1/2net/mlx5e: Prevent stale XSK buffer release on refill retrydrivers/net/ethernet/mellanox/mlx5/core/en_rx.c+5 -20 repliesApplied
2/2net/mlx5e: Prevent stale XSK buffer release on MPWQE refill retrydrivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c+2 -03 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchDragos Tatulea
1/2R-b
2/2R-b

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

Read the v4 thread

Cover letter [PATCH net v4 0/2] net/mlx5e: Prevent stale XSK buffer release on refill retries

Prevent duplicate XSK buffer release when a deferred RX refill fails and the same WQE is retried.

Patch 1 fixes legacy cyclic RQ. It is unchanged from v3 and retains Dragos' Reviewed-by tag.

Patch 2 fixes the analogous striding-RQ MPWQE path. Following Dragos' review, it now fills skip_release_bitmap in the common error path of mlx5e_xsk_alloc_rx_mpwqe(), consistently with mlx5e_alloc_rx_mpwqe().

Targeted fault injection covered both an early allocation failure and a partial 8-of-16-buffer unwind. With three consecutive failures for one MPWQE, the original 16 XSK buffers were released only once, retries saw a full bitmap, and a later successful allocation cleared it. A clean 20-second AF_XDP zero-copy pressure run exercised 1,575,262 buffer allocation failures without invalid descriptors, WQE errors, or kernel warnings.

Changes in v4:
- Keep patch 1 unchanged.
- Move the MPWQE bitmap update from the release loop to the common XSK allocator error path, as suggested by Dragos.
- Validate both early and partial allocation failures and run an additional zero-copy pressure test.

v3: https://lore.kernel.org/netdev/[email protected]/

Jerome Tollet (2):
net/mlx5e: Prevent stale XSK buffer release on refill retry net/mlx5e: Prevent stale XSK buffer release on MPWQE refill retry

 drivers/net/ethernet/mellanox/mlx5/core/en/xsk/rx.c | 2 ++
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c     | 7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

base-commit: 4e15e89faac9f308baeb01f46c13a051814d2449

Signature · 1 line
2.55.0