OSDN Git Service

ipv6: optimise dst refcounting on skb init
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 27 Jan 2022 00:36:22 +0000 (00:36 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 28 Jan 2022 03:46:10 +0000 (19:46 -0800)
commitcd3c748077365dde89f2a3da738ce556fd04b0a3
tree53cded77bfc603a21aa8008e2b0a0afade5dcb69
parentd344e55356c2ce883a764bb2324fd635c5af3f50
ipv6: optimise dst refcounting on skb init

__ip6_make_skb() gets a cork->dst ref, hands it over to skb and shortly
after puts cork->dst. Save two atomics by stealing it without extra
referencing, ip6_cork_release() handles NULL cork->dst.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/ip6_output.c