public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: inline skb_add_rx_frag_netmem()
@ 2026-02-26  4:12 Eric Dumazet
  2026-02-26 22:38 ` Kuniyuki Iwashima
  2026-02-28  3:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Dumazet @ 2026-02-26  4:12 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Kuniyuki Iwashima, netdev, eric.dumazet,
	Eric Dumazet

This critical helper (via skb_add_rx_frag()) is mostly used
from drivers rx fast path.

It is time to inline it, this actually saves space in vmlinux:

size vmlinux.old vmlinux
   text    data     bss     dec     hex filename
37350766        23092977        4846992 65290735        3e441ef vmlinux.old
37350600        23092977        4846992 65290569        3e44149 vmlinux

Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 include/linux/skbuff.h | 13 +++++++++++--
 net/core/skbuff.c      | 11 -----------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index daa4e4944ce3f2184b193f43dbab88147ae2a7e4..9cc98f850f1d7cd01eed3fe9d17b59116b49958e 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2682,8 +2682,17 @@ static inline void skb_fill_page_desc_noacc(struct sk_buff *skb, int i,
 	shinfo->nr_frags = i + 1;
 }
 
-void skb_add_rx_frag_netmem(struct sk_buff *skb, int i, netmem_ref netmem,
-			    int off, int size, unsigned int truesize);
+static inline void skb_add_rx_frag_netmem(struct sk_buff *skb, int i,
+					  netmem_ref netmem, int off,
+					  int size, unsigned int truesize)
+{
+	DEBUG_NET_WARN_ON_ONCE(size > truesize);
+
+	skb_fill_netmem_desc(skb, i, netmem, off, size);
+	skb->len += size;
+	skb->data_len += size;
+	skb->truesize += truesize;
+}
 
 static inline void skb_add_rx_frag(struct sk_buff *skb, int i,
 				   struct page *page, int off, int size,
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index dc47d3efc72ed86dce5e382d505eda7bc863669a..e3aa1612ef5dce5b96deb17731d0449d79adc34f 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -891,17 +891,6 @@ struct sk_buff *napi_alloc_skb(struct napi_struct *napi, unsigned int len)
 }
 EXPORT_SYMBOL(napi_alloc_skb);
 
-void skb_add_rx_frag_netmem(struct sk_buff *skb, int i, netmem_ref netmem,
-			    int off, int size, unsigned int truesize)
-{
-	DEBUG_NET_WARN_ON_ONCE(size > truesize);
-
-	skb_fill_netmem_desc(skb, i, netmem, off, size);
-	skb->len += size;
-	skb->data_len += size;
-	skb->truesize += truesize;
-}
-EXPORT_SYMBOL(skb_add_rx_frag_netmem);
 
 void skb_coalesce_rx_frag(struct sk_buff *skb, int i, int size,
 			  unsigned int truesize)
-- 
2.53.0.414.gf7e9f6c205-goog


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

* Re: [PATCH net-next] net: inline skb_add_rx_frag_netmem()
  2026-02-26  4:12 [PATCH net-next] net: inline skb_add_rx_frag_netmem() Eric Dumazet
@ 2026-02-26 22:38 ` Kuniyuki Iwashima
  2026-02-28  3:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Kuniyuki Iwashima @ 2026-02-26 22:38 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
	netdev, eric.dumazet

On Wed, Feb 25, 2026 at 8:12 PM Eric Dumazet <edumazet@google.com> wrote:
>
> This critical helper (via skb_add_rx_frag()) is mostly used
> from drivers rx fast path.
>
> It is time to inline it, this actually saves space in vmlinux:
>
> size vmlinux.old vmlinux
>    text    data     bss     dec     hex filename
> 37350766        23092977        4846992 65290735        3e441ef vmlinux.old
> 37350600        23092977        4846992 65290569        3e44149 vmlinux
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>

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

* Re: [PATCH net-next] net: inline skb_add_rx_frag_netmem()
  2026-02-26  4:12 [PATCH net-next] net: inline skb_add_rx_frag_netmem() Eric Dumazet
  2026-02-26 22:38 ` Kuniyuki Iwashima
@ 2026-02-28  3:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-02-28  3:40 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: davem, kuba, pabeni, horms, kuniyu, netdev, eric.dumazet

Hello:

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

On Thu, 26 Feb 2026 04:12:13 +0000 you wrote:
> This critical helper (via skb_add_rx_frag()) is mostly used
> from drivers rx fast path.
> 
> It is time to inline it, this actually saves space in vmlinux:
> 
> size vmlinux.old vmlinux
>    text    data     bss     dec     hex filename
> 37350766        23092977        4846992 65290735        3e441ef vmlinux.old
> 37350600        23092977        4846992 65290569        3e44149 vmlinux
> 
> [...]

Here is the summary with links:
  - [net-next] net: inline skb_add_rx_frag_netmem()
    https://git.kernel.org/netdev/net-next/c/6466441a5ecd

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-02-28  3:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-26  4:12 [PATCH net-next] net: inline skb_add_rx_frag_netmem() Eric Dumazet
2026-02-26 22:38 ` Kuniyuki Iwashima
2026-02-28  3:40 ` 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