Skip to contentSkip to conversation

net: mvneta: rely on napi_build_skb() in mvneta_swbm_build_skb()

PATCH Applied Lorenzo Bianconi 3 participants 3 messages Sep 17 – Sep 22

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mvneta: rely on napi_build_skb() in mvneta_swbm_build_skb()

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.

---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/mvneta.c +1 -1
index 543e566425c1..c2b1098d8d1d 100644
@@ -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,

Signature · 1 line
Lorenzo Bianconi <[email protected]>
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · 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.

#2 lore raw
In reply to Lorenzo Bianconi
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 8 lines · 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.

[...]

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!

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