Commit 5af674bb authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski

ipv6: move inet6_ehash_secret and udp6_ehash_secret into net_hotdata

"struct inet6_protocol" has a 32bit hole in 32bit arches.

Use it to store the 32bit secret used by UDP and TCP,
to increase cache locality in rx path.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20240306160031.874438-16-edumazet@google.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6e073572
...@@ -38,6 +38,8 @@ struct net_hotdata { ...@@ -38,6 +38,8 @@ struct net_hotdata {
#define inet_ehash_secret net_hotdata.tcp_protocol.secret #define inet_ehash_secret net_hotdata.tcp_protocol.secret
#define udp_ehash_secret net_hotdata.udp_protocol.secret #define udp_ehash_secret net_hotdata.udp_protocol.secret
#define inet6_ehash_secret net_hotdata.tcpv6_protocol.secret
#define udp6_ehash_secret net_hotdata.udpv6_protocol.secret
extern struct net_hotdata net_hotdata; extern struct net_hotdata net_hotdata;
......
...@@ -60,6 +60,7 @@ struct inet6_protocol { ...@@ -60,6 +60,7 @@ struct inet6_protocol {
__be32 info); __be32 info);
unsigned int flags; /* INET6_PROTO_xxx */ unsigned int flags; /* INET6_PROTO_xxx */
u32 secret;
}; };
#define INET6_PROTO_NOPOLICY 0x1 #define INET6_PROTO_NOPOLICY 0x1
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/random.h> #include <linux/random.h>
#include <net/addrconf.h> #include <net/addrconf.h>
#include <net/hotdata.h>
#include <net/inet_connection_sock.h> #include <net/inet_connection_sock.h>
#include <net/inet_hashtables.h> #include <net/inet_hashtables.h>
#include <net/inet6_hashtables.h> #include <net/inet6_hashtables.h>
...@@ -25,7 +26,6 @@ u32 inet6_ehashfn(const struct net *net, ...@@ -25,7 +26,6 @@ u32 inet6_ehashfn(const struct net *net,
const struct in6_addr *laddr, const u16 lport, const struct in6_addr *laddr, const u16 lport,
const struct in6_addr *faddr, const __be16 fport) const struct in6_addr *faddr, const __be16 fport)
{ {
static u32 inet6_ehash_secret __read_mostly;
static u32 ipv6_hash_secret __read_mostly; static u32 ipv6_hash_secret __read_mostly;
u32 lhash, fhash; u32 lhash, fhash;
......
...@@ -79,7 +79,6 @@ u32 udp6_ehashfn(const struct net *net, ...@@ -79,7 +79,6 @@ u32 udp6_ehashfn(const struct net *net,
const struct in6_addr *faddr, const struct in6_addr *faddr,
const __be16 fport) const __be16 fport)
{ {
static u32 udp6_ehash_secret __read_mostly;
static u32 udp_ipv6_hash_secret __read_mostly; static u32 udp_ipv6_hash_secret __read_mostly;
u32 lhash, fhash; u32 lhash, fhash;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment