BPF List
 help / color / mirror / Atom feed
* [PATCH net-next] net: mvneta: rely on napi_build_skb() in mvneta_swbm_build_skb()
@ 2026-09-17 13:22 Lorenzo Bianconi
  2026-09-21 12:31 ` Simon Horman
  2026-09-22  0:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Lorenzo Bianconi @ 2026-09-17 13:22 UTC (permalink / raw)
  To: Marcin Wojtas, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Alexei Starovoitov, Daniel Borkmann,
	Jesper Dangaard Brouer, John Fastabend, Stanislav Fomichev
  Cc: netdev, bpf, Lorenzo Bianconi

mvneta_swbm_build_skb() is only invoked from mvneta_poll(), the NAPI
poll routine, so it always runs in NAPI context. Use napi_build_skb()
instead of build_skb() to source the skb head from the per-CPU NAPI
cache, avoiding a per-packet kmem_cache_alloc() of the skb head.

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 543e566425c1..c2b1098d8d1d 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2403,7 +2403,7 @@ mvneta_swbm_build_skb(struct mvneta_port *pp, struct page_pool *pool,
 	if (unlikely(xdp_buff_has_frags(xdp)))
 		num_frags = sinfo->nr_frags;
 
-	skb = build_skb(xdp->data_hard_start, PAGE_SIZE);
+	skb = napi_build_skb(xdp->data_hard_start, PAGE_SIZE);
 	if (!skb)
 		return ERR_PTR(-ENOMEM);
 

---
base-commit: 859e40055c19ceb8b8215f3269e57075023b72b4
change-id: 20260917-mvneta-napi-poll-987b8e9aef0e

Best regards,
-- 
Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>


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

* Re: [PATCH net-next] net: mvneta: rely on napi_build_skb() in mvneta_swbm_build_skb()
  2026-09-17 13:22 [PATCH net-next] net: mvneta: rely on napi_build_skb() in mvneta_swbm_build_skb() Lorenzo Bianconi
@ 2026-09-21 12:31 ` Simon Horman
  2026-09-22  0:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2026-09-21 12:31 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: Marcin Wojtas, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Alexei Starovoitov, Daniel Borkmann,
	Jesper Dangaard Brouer, John Fastabend, Stanislav Fomichev,
	netdev, bpf

On Thu, Sep 17, 2026 at 03:22:29PM +0200, Lorenzo Bianconi wrote:
> mvneta_swbm_build_skb() is only invoked from mvneta_poll(), the NAPI
> poll routine, so it always runs in NAPI context. Use napi_build_skb()
> instead of build_skb() to source the skb head from the per-CPU NAPI
> cache, avoiding a per-packet kmem_cache_alloc() of the skb head.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [PATCH net-next] net: mvneta: rely on napi_build_skb() in mvneta_swbm_build_skb()
  2026-09-17 13:22 [PATCH net-next] net: mvneta: rely on napi_build_skb() in mvneta_swbm_build_skb() Lorenzo Bianconi
  2026-09-21 12:31 ` Simon Horman
@ 2026-09-22  0:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-09-22  0:30 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: marcin.s.wojtas, andrew+netdev, davem, edumazet, kuba, pabeni,
	ast, daniel, hawk, john.fastabend, sdf, netdev, bpf

Hello:

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

On Thu, 17 Sep 2026 15:22:29 +0200 you wrote:
> mvneta_swbm_build_skb() is only invoked from mvneta_poll(), the NAPI
> poll routine, so it always runs in NAPI context. Use napi_build_skb()
> instead of build_skb() to source the skb head from the per-CPU NAPI
> cache, avoiding a per-packet kmem_cache_alloc() of the skb head.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
> 
> [...]

Here is the summary with links:
  - [net-next] net: mvneta: rely on napi_build_skb() in mvneta_swbm_build_skb()
    https://git.kernel.org/netdev/net-next/c/1643b81c38c9

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:[~2026-09-22  0:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17 13:22 [PATCH net-next] net: mvneta: rely on napi_build_skb() in mvneta_swbm_build_skb() Lorenzo Bianconi
2026-09-21 12:31 ` Simon Horman
2026-09-22  0:30 ` 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