]> git.baikalelectronics.ru Git - kernel.git/commit
skbuff: in skb_segment, call zerocopy functions once per nskb
authorWillem de Bruijn <willemb@google.com>
Sat, 23 Dec 2017 00:00:17 +0000 (19:00 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Dec 2017 21:44:13 +0000 (16:44 -0500)
commitcb0f11770088b18f78eb5e738e6f5a9d8075c0ab
tree9b40e440534564eadb56db2b764ab2dc1d269686
parentcce3125552803d717f7b3538e2364ce9aed328c3
skbuff: in skb_segment, call zerocopy functions once per nskb

This is a net-next follow-up to commit 1dee85f05180 ("skbuff: orphan
frags before zerocopy clone"), which fixed a bug in net, but added a
call to skb_zerocopy_clone at each frag to do so.

When segmenting skbs with user frags, either the user frags must be
replaced with private copies and uarg released, or the uarg must have
its refcount increased for each new skb.

skb_orphan_frags does the first, except for cases that can handle
reference counting. skb_zerocopy_clone then does the second.

Call these once per nskb, instead of once per frag.

That is, in the common case. With a frag list, also refresh when the
origin skb (frag_skb) changes.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c