diff options
author | Eric Dumazet <edumazet@google.com> | 2024-03-06 16:00:29 +0000 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-03-07 21:12:43 -0800 |
commit | df51b84564159cdd91a67ee0f9e30b42b3a73cef (patch) | |
tree | 14d8de05a58c1b997bc3815bfb7c3aac0f1cb8d0 /net/ipv6 | |
parent | 5af674bb90a030317a02419e04b66ec0dc892dcd (diff) | |
download | linux-df51b84564159cdd91a67ee0f9e30b42b3a73cef.tar.gz linux-df51b84564159cdd91a67ee0f9e30b42b3a73cef.tar.bz2 linux-df51b84564159cdd91a67ee0f9e30b42b3a73cef.zip |
ipv6: move tcp_ipv6_hash_secret and udp_ipv6_hash_secret to net_hotdata
Use a 32bit hole in "struct net_offload" to store
the remaining 32bit secrets used by TCPv6 and UDPv6.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20240306160031.874438-17-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/inet6_hashtables.c | 6 | ||||
-rw-r--r-- | net/ipv6/udp.c | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c index 0fee97f3166c..2e81383b663b 100644 --- a/net/ipv6/inet6_hashtables.c +++ b/net/ipv6/inet6_hashtables.c @@ -26,15 +26,13 @@ u32 inet6_ehashfn(const struct net *net, const struct in6_addr *laddr, const u16 lport, const struct in6_addr *faddr, const __be16 fport) { - static u32 ipv6_hash_secret __read_mostly; - u32 lhash, fhash; net_get_random_once(&inet6_ehash_secret, sizeof(inet6_ehash_secret)); - net_get_random_once(&ipv6_hash_secret, sizeof(ipv6_hash_secret)); + net_get_random_once(&tcp_ipv6_hash_secret, sizeof(tcp_ipv6_hash_secret)); lhash = (__force u32)laddr->s6_addr32[3]; - fhash = __ipv6_addr_jhash(faddr, ipv6_hash_secret); + fhash = __ipv6_addr_jhash(faddr, tcp_ipv6_hash_secret); return __inet6_ehashfn(lhash, lport, fhash, fport, inet6_ehash_secret + net_hash_mix(net)); diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 1e1c67a51675..80ad8f436b17 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -79,8 +79,6 @@ u32 udp6_ehashfn(const struct net *net, const struct in6_addr *faddr, const __be16 fport) { - static u32 udp_ipv6_hash_secret __read_mostly; - u32 lhash, fhash; net_get_random_once(&udp6_ehash_secret, |