aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-01-27 00:36:30 +0000
committerJakub Kicinski <kuba@kernel.org>2022-01-27 19:46:11 -0800
commit40ac240c2e06e4b5477705da1b37fb1d160572de (patch)
tree5afd911fc5b755701078c2b2dd7fcdde58b70fd4 /net/ipv6/udp.c
parentudp6: don't make extra copies of iflow (diff)
downloadlinux-dev-40ac240c2e06e4b5477705da1b37fb1d160572de.tar.xz
linux-dev-40ac240c2e06e4b5477705da1b37fb1d160572de.zip
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.c3
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);