dpaa2_eth_xdp_flush() clears xdp_fds->num before returning. That makes the XDP_TX flush path lose the number of descriptors it tried to enqueue. When enqueue retries stop after only a subset of the batch has been accepted, dpaa2_eth_xdp_tx_flush() therefore skips its cleanup loop and leaves the remaining frame buffers unrecycled while still accounting only the successful descriptors. Keep the batch length valid until the caller has handled the result. The XDP_TX path already clears its queue after recycling the failed descriptors; clear the redirect batch in dpaa2_eth_xdp_xmit() after updating stats so its behaviour stays unchanged. Fixes: 74a1c059168b ("dpaa2-eth: add bulking to XDP_TX") Signed-off-by: Zhiqi Zhang --- AI assistance disclosure: I found the bug. Codex modified the code. I reviewed the change. Build-tested with ARCH=arm64 allmodconfig object builds. I did not test on hardware. drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c index bb3c55d84d..0e50e33cc6 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c @@ -355,7 +355,6 @@ static int dpaa2_eth_xdp_flush(struct dpaa2_eth_priv *priv, } total_enqueued += enqueued; } - xdp_fds->num = 0; return total_enqueued; } @@ -2895,6 +2894,7 @@ static int dpaa2_eth_xdp_xmit(struct net_device *net_dev, int n, percpu_stats->tx_packets += enqueued; for (i = 0; i < enqueued; i++) percpu_stats->tx_bytes += dpaa2_fd_get_len(&fds[i]); + xdp_redirect_fds->num = 0; return enqueued; } base-commit: 25faec9ce61c01fb45abf812a222c5b43c3cd5c5 -- 2.54.0 (Apple Git-157)