Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iwl-net] ice: reset xdp_tx_active when cleaning a Tx ring
@ 2026-11-18 13:59 Magnus Karlsson
  2026-11-18 14:18 ` Maciej Fijalkowski
  0 siblings, 1 reply; 4+ messages in thread
From: Magnus Karlsson @ 2026-11-18 13:59 UTC (permalink / raw)
  To: magnus.karlsson, magnus.karlsson, intel-wired-lan,
	anthony.l.nguyen, maciej.fijalkowski, przemyslaw.kitszel

xdp_tx_active counts the XDP_TX buffers on an XDP ring, so that
ice_clean_xdp_irq_zc() can complete AF_XDP zero-copy frames in bulk when
there are none. It is incremented for every XDP_TX frame and decremented
when such a frame completes. ice_clean_tx_ring() frees the frames that
are still on the ring, both through ice_xsk_clean_xdp_ring() and through
ice_unmap_and_free_tx_buf(), but leaves the counter as it was.

After a ring is cleaned with XDP_TX frames in flight, for example when
an AF_XDP socket is bound or unbound, xdp_tx_active therefore stays
non-zero for the lifetime of the ring. ice_clean_xdp_irq_zc() then
always takes the per-descriptor slow path.

The ring is empty after ice_clean_tx_ring(), so reset the counter
there, together with next_to_use and next_to_clean.

Fixes: 59e92bfe4df7 ("ice: xsk: Borrow xdp_tx_active logic from i40e")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_txrx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index 35a480a1e172..f26646825a1e 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -228,6 +228,7 @@ void ice_clean_tx_ring(struct ice_tx_ring *tx_ring)
 
 	tx_ring->next_to_use = 0;
 	tx_ring->next_to_clean = 0;
+	tx_ring->xdp_tx_active = 0;
 
 	if (!tx_ring->netdev)
 		return;
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-18 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 13:59 [PATCH iwl-net] ice: reset xdp_tx_active when cleaning a Tx ring Magnus Karlsson
2026-11-18 14:18 ` Maciej Fijalkowski
2026-11-18 14:32   ` Magnus Karlsson
2026-11-18 15:48     ` Maciej Fijalkowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox