Thread (5 messages) 5 messages, 4 authors, 8d ago

Re: [PATCH net-next v2] net: skbuff: optimization of net_zcopy_get() call in pskb_carve helpers

From: Paolo Abeni <pabeni@redhat.com>
Date: 2026-07-21 09:39:29

On 7/8/26 7:54 AM, Yun Lu wrote:
From: Yun Lu <redacted>

Commit 98d0912e9f84 ("net: skbuff: fix missing zerocopy reference in
pskb_carve helpers") introduced two calls of net_zcopy_get(skb_zcopy(skb)).
In fact, skb_zcopy() has already been executed once before. When calling
net_zcopy_get(), skb_zcopy() always returns skb_uarg(skb), which results
in adding some unnecessary instructions in skb_zcopy. 
I'm quite surprised the compiler can't generate the same binary with the
old code. blot-o-meter seams to agree with me.

I think that the consistency argument is enough here to justify the
patch, but it would have been better to double the above guess with some
actual measurement.

/P
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help