diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2022-01-27 03:36:30 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-01-28 06:46:11 +0300 |
commit | 40ac240c2e06e4b5477705da1b37fb1d160572de (patch) | |
tree | 5afd911fc5b755701078c2b2dd7fcdde58b70fd4 /net/ipv6/udp.c | |
parent | 5298953e742dc9211d3b724fb5394da8a1f3ed04 (diff) | |
download | linux-40ac240c2e06e4b5477705da1b37fb1d160572de.tar.xz |
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>
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r-- | net/ipv6/udp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index cfcf08c3df4d..c6872596b408 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -1541,7 +1541,8 @@ back_from_confirm: err = PTR_ERR(skb); if (!IS_ERR_OR_NULL(skb)) err = udp_v6_send_skb(skb, fl6, &cork.base); - goto out; + /* ip6_make_skb steals dst reference */ + goto out_no_dst; } lock_sock(sk); |