Skip to contentSkip to conversation

net: xsk: dpaa2: avoid repeatedly updating the global consumer

PATCH Applied Jason Xing 3 participants 3 messages Jun 23, 2025 – Jun 25, 2025

Subsystems (3)
lore
Share & tools
lore

Jason Xing

author
#0 lore raw

PATCH 1/1 net: xsk: dpaa2: avoid repeatedly updating the global consumer

From: Jason Xing <[email protected]>

This patch avoids another update of the consumer at the end of dpaa2_xsk_tx().

In the zero copy xmit path, two versions (batched and non-batched) regarding how the consumer of tx ring changes are implemented in xsk_tx_peek_release_desc_batch() that eventually updates the local consumer to the global consumer in either of the following call trace:
1) batched mode:
xsk_tx_peek_release_desc_batch()

       __xskq_cons_release()

2) non-batched mode:
xsk_tx_peek_release_desc_batch()
xsk_tx_peek_release_fallback()
xsk_tx_release()

As we can see, dpaa2_xsk_tx() doesn't need to call extra release function to handle the sync of consumer itself.

---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c +0 -2
index a466c2379146..4b0ae7d9af92 100644
@@ -448,7 +448,5 @@ bool dpaa2_xsk_tx(struct dpaa2_eth_priv *priv,
 		percpu_stats->tx_errors++;
 	}
 
-	xsk_tx_release(ch->xsk_pool);
-
 	return total_enqueued == budget;
 }
Signature · 1 line
2.43.5
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Jason Xing

From: Jason Xing <[email protected]>

This patch avoids another update of the consumer at the end of dpaa2_xsk_tx().

In the zero copy xmit path, two versions (batched and non-batched) regarding how the consumer of tx ring changes are implemented in xsk_tx_peek_release_desc_batch() that eventually updates the local consumer to the global consumer in either of the following call trace:
1) batched mode:

   xsk_tx_peek_release_desc_batch()
       __xskq_cons_release()
Quoted 7 lines

2) non-batched mode:
xsk_tx_peek_release_desc_batch()
xsk_tx_peek_release_fallback()
xsk_tx_release()

As we can see, dpaa2_xsk_tx() doesn't need to call extra release function to handle the sync of consumer itself.

Quoted 21 lines
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c +0 -2
index a466c2379146..4b0ae7d9af92 100644
@@ -448,7 +448,5 @@ bool dpaa2_xsk_tx(struct dpaa2_eth_priv *priv,
 		percpu_stats->tx_errors++;
 	}
 
-	xsk_tx_release(ch->xsk_pool);
-
 	return total_enqueued == budget;
 }
Signature · 1 line
2.43.5
#2 lore raw
In reply to Jason Xing
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Mon, 23 Jun 2025 20:01:59 +0800 you wrote:

From: Jason Xing <[email protected]>

This patch avoids another update of the consumer at the end of dpaa2_xsk_tx().

In the zero copy xmit path, two versions (batched and non-batched) regarding how the consumer of tx ring changes are implemented in xsk_tx_peek_release_desc_batch() that eventually updates the local consumer to the global consumer in either of the following call trace:
1) batched mode:

Quoted 8 lines
   xsk_tx_peek_release_desc_batch()
       __xskq_cons_release()

2) non-batched mode:
xsk_tx_peek_release_desc_batch()
xsk_tx_peek_release_fallback()
xsk_tx_release()

[...]

Here is the summary with links:
- [net-next] net: xsk: dpaa2: avoid repeatedly updating the global consumer

    https://git.kernel.org/netdev/net-next/c/da7aee716163

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html