ipv6: optimise dst refcounting on cork init
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 27 Jan 2022 00:36:30 +0000 (00:36 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 28 Jan 2022 03:46:11 +0000 (19:46 -0800)
commit40ac240c2e06e4b5477705da1b37fb1d160572de
tree5afd911fc5b755701078c2b2dd7fcdde58b70fd4
parent5298953e742dc9211d3b724fb5394da8a1f3ed04
ipv6: optimise dst refcounting on cork init

udpv6_sendmsg() doesn't need dst after calling ip6_make_skb(), so
instead of taking an additional reference inside ip6_setup_cork()
and releasing the initial one afterwards, we can hand over a reference
into ip6_make_skb() saving two atomics. The only other user of
ip6_setup_cork() is ip6_append_data() and it requires an extra
dst_hold().

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
net/ipv6/udp.c