netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: xsk: dpaa2: avoid repeatedly updating the global consumer
@ 2025-06-23 12:01 Jason Xing
  2025-06-24 19:12 ` Maciej Fijalkowski
  2025-06-25  1:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jason Xing @ 2025-06-23 12:01 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, bjorn, magnus.karlsson,
	maciej.fijalkowski, jonathan.lemon, sdf, ast, daniel, hawk,
	john.fastabend, willemdebruijn.kernel, ioana.ciornei
  Cc: netdev, Jason Xing

From: Jason Xing <kernelxing@tencent.com>

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.

Signed-off-by: Jason Xing <kernelxing@tencent.com>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c
index a466c2379146..4b0ae7d9af92 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c
@@ -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;
 }
-- 
2.43.5


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

* Re: [PATCH net-next] net: xsk: dpaa2: avoid repeatedly updating the global consumer
  2025-06-23 12:01 [PATCH net-next] net: xsk: dpaa2: avoid repeatedly updating the global consumer Jason Xing
@ 2025-06-24 19:12 ` Maciej Fijalkowski
  2025-06-25  1:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Maciej Fijalkowski @ 2025-06-24 19:12 UTC (permalink / raw)
  To: Jason Xing
  Cc: davem, edumazet, kuba, pabeni, bjorn, magnus.karlsson,
	jonathan.lemon, sdf, ast, daniel, hawk, john.fastabend,
	willemdebruijn.kernel, ioana.ciornei, netdev, Jason Xing

On Mon, Jun 23, 2025 at 08:01:59PM +0800, Jason Xing wrote:
> From: Jason Xing <kernelxing@tencent.com>
> 
> 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.

Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

> 
> Signed-off-by: Jason Xing <kernelxing@tencent.com>
> ---
>  drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c
> index a466c2379146..4b0ae7d9af92 100644
> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c
> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c
> @@ -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;
>  }
> -- 
> 2.43.5
> 

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

* Re: [PATCH net-next] net: xsk: dpaa2: avoid repeatedly updating the global consumer
  2025-06-23 12:01 [PATCH net-next] net: xsk: dpaa2: avoid repeatedly updating the global consumer Jason Xing
  2025-06-24 19:12 ` Maciej Fijalkowski
@ 2025-06-25  1:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-25  1:10 UTC (permalink / raw)
  To: Jason Xing
  Cc: davem, edumazet, kuba, pabeni, bjorn, magnus.karlsson,
	maciej.fijalkowski, jonathan.lemon, sdf, ast, daniel, hawk,
	john.fastabend, willemdebruijn.kernel, ioana.ciornei, netdev,
	kernelxing

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 23 Jun 2025 20:01:59 +0800 you wrote:
> From: Jason Xing <kernelxing@tencent.com>
> 
> 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()
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-06-25  1:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-23 12:01 [PATCH net-next] net: xsk: dpaa2: avoid repeatedly updating the global consumer Jason Xing
2025-06-24 19:12 ` Maciej Fijalkowski
2025-06-25  1:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).