Re: [PATCH net-next] net: skbuff: use net_zcopy_get() instead of refcount_inc()
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2026-07-06 13:55:28
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2026-07-06 13:55:28
Yun Lu wrote:
From: Yun Lu <redacted> The net_zcopy_get() increments the uarg->refcnt, which is called both in pskb_carve_inside_header() and pskb_carve_inside_nonlinear(). Also use net_zcopy_get() in pskb_expand_head for code consistency. No functional change intended. Signed-off-by: Yun Lu <redacted> --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 18dabb4e9cfa..bcf3b2c65fb9 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c@@ -2326,7 +2326,7 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, if (skb_orphan_frags(skb, gfp_mask)) goto nofrags; if (skb_zcopy(skb)) - refcount_inc(&skb_uarg(skb)->refcnt); + net_zcopy_get(skb_zcopy(skb));
This adds some unnecessary instructions in skb_zcopy. It's not terrible and I see the consistency argument. But would make more sense to update the recently added pskb_carve_.. variants instead.