ipv6: guard IPV6_MINHOPCOUNT with a static key
authorEric Dumazet <edumazet@google.com>
Mon, 25 Oct 2021 16:48:22 +0000 (09:48 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 26 Oct 2021 01:02:13 +0000 (18:02 -0700)
commit790eb67374d43f66102a80821d22188b6a0bc3bb
tree0f6306b5f3870c87d9075ca3738cbe636703affc
parentcc17c3c8e8b5beb4072c0e8e53aeb77bcf4517c2
ipv6: guard IPV6_MINHOPCOUNT with a static key

RFC 5082 IPV6_MINHOPCOUNT is rarely used on hosts.

Add a static key to remove from TCP fast path useless code,
and potential cache line miss to fetch tcp_inet6_sk(sk)->min_hopcount

Note that once ip6_min_hopcount static key has been enabled,
it stays enabled until next boot.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/ipv6.h
net/ipv6/ipv6_sockglue.c
net/ipv6/tcp_ipv6.c