net: inline skb_add_rx_frag_netmem()
Subsystems (2)
PATCH 1/1 net: inline skb_add_rx_frag_netmem()
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
--- include/linux/skbuff.h | 13 +++++++++++-- net/core/skbuff.c | 11 ----------- 2 files changed, 11 insertions(+), 13 deletions(-)
include/linux/skbuff.h +11 -2
@@ -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,
net/core/skbuff.c +0 -11
@@ -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)
Signature · 1 line
2.53.0.414.gf7e9f6c205-goog
Quoted 4 lines · Eric Dumazet
This critical helper (via
skb_add_rx_frag()) is mostly used from drivers rx fast path.
Quoted 8 lines
It is time to inline it, this actually saves space in vmlinux:
size vmlinux.old vmlinux
text data bss dec hex filename37350766 23092977 4846992 65290735 3e441ef vmlinux.old 37350600 23092977 4846992 65290569 3e44149 vmlinuxSigned-off-by Eric Dumazet <[email protected]>
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 11 lines · 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 filename37350766 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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html