Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tcp: move inet6_csk_update_pmtu() to tcp_ipv6.c

This function is only called from tcp_v6_mtu_reduced() and can be
(auto)inlined by the compiler.

Note that inet6_csk_route_socket() is no longer (auto)inlined,
which is a good thing as it is slow path.

$ scripts/bloat-o-meter -t vmlinux.0 vmlinux.1

add/remove: 0/2 grow/shrink: 2/0 up/down: 93/-129 (-36)
Function old new delta
tcp_v6_mtu_reduced 139 228 +89
inet6_csk_route_socket 486 490 +4
__pfx_inet6_csk_update_pmtu 16 - -16
inet6_csk_update_pmtu 113 - -113
Total: Before=25076512, After=25076476, chg -0.00%

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260223153047.886683-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Dumazet and committed by
Jakub Kicinski
539a6cf0 fca59a2d

+20 -18
+3 -1
include/net/inet6_connection_sock.h
··· 18 18 struct sock; 19 19 struct sockaddr; 20 20 21 + struct dst_entry *inet6_csk_route_socket(struct sock *sk, 22 + struct flowi6 *fl6); 23 + 21 24 struct dst_entry *inet6_csk_route_req(const struct sock *sk, 22 25 struct dst_entry *dst, 23 26 struct flowi6 *fl6, ··· 28 25 29 26 int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl); 30 27 31 - struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu); 32 28 #endif /* _INET6_CONNECTION_SOCK_H */
+2 -17
net/ipv6/inet6_connection_sock.c
··· 56 56 return dst; 57 57 } 58 58 59 - static struct dst_entry *inet6_csk_route_socket(struct sock *sk, 60 - struct flowi6 *fl6) 59 + struct dst_entry *inet6_csk_route_socket(struct sock *sk, 60 + struct flowi6 *fl6) 61 61 { 62 62 struct inet_sock *inet = inet_sk(sk); 63 63 struct ipv6_pinfo *np = inet6_sk(sk); ··· 118 118 return res; 119 119 } 120 120 EXPORT_SYMBOL_GPL(inet6_csk_xmit); 121 - 122 - struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu) 123 - { 124 - struct flowi6 *fl6 = &inet_sk(sk)->cork.fl.u.ip6; 125 - struct dst_entry *dst; 126 - 127 - dst = inet6_csk_route_socket(sk, fl6); 128 - 129 - if (IS_ERR(dst)) 130 - return NULL; 131 - dst->ops->update_pmtu(dst, sk, NULL, mtu, true); 132 - 133 - dst = inet6_csk_route_socket(sk, fl6); 134 - return IS_ERR(dst) ? NULL : dst; 135 - }
+15
net/ipv6/tcp_ipv6.c
··· 349 349 return err; 350 350 } 351 351 352 + static struct dst_entry *inet6_csk_update_pmtu(struct sock *sk, u32 mtu) 353 + { 354 + struct flowi6 *fl6 = &inet_sk(sk)->cork.fl.u.ip6; 355 + struct dst_entry *dst; 356 + 357 + dst = inet6_csk_route_socket(sk, fl6); 358 + 359 + if (IS_ERR(dst)) 360 + return NULL; 361 + dst->ops->update_pmtu(dst, sk, NULL, mtu, true); 362 + 363 + dst = inet6_csk_route_socket(sk, fl6); 364 + return IS_ERR(dst) ? NULL : dst; 365 + } 366 + 352 367 static void tcp_v6_mtu_reduced(struct sock *sk) 353 368 { 354 369 struct dst_entry *dst;