From: Björn Töpel <bjo…@kernel.org>
Date: Mon, 30 Nov 2026 13:37:32 +0100
> libeth takes the number of buffers of an XSk XDP_TX frame from its
> shared info, and reports that many completed buffers to the driver. It
> reads the shared info when it flushes the bulk, not when it queues the
> frame. The shared info of a zero-copy buffer lives in the UMEM, which
> userspace may write at any time, so a rewritten count makes libeth
> report a wrong number. Once the last patch of this series moves the
> shared info into the buffer pool, the next multi-buffer frame of the
> same poll can overwrite it before the flush.
>
> A wrong number breaks the in-flight count of XDP_TX buffers that idpf
> keeps on its XSk queues, and idpf may then complete XDP_TX buffers as
> XSk xmit frames.
>
> Make libeth count each buffer on its own SQE. Head and fragments each
> count one completed buffer, and the head counts the packet. Stats stay
> the same for frames sent in full.
>
> Found by an AI agent while reviewing this code. Not triggered at
> runtime.
>
> Fixes: b3ad8450b4dc ("libeth: xsk: add XSk XDP_TX sending helpers")
> Signed-off-by: Björn Töpel <bjo…@kernel.org>
Acked-by: Alexander Lobakin <alek…@intel.com>
Thanks!
Olek