raw: use net_hash_mix() in hash function
authorEric Dumazet <edumazet@google.com>
Thu, 2 Feb 2023 09:41:00 +0000 (09:41 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sat, 4 Feb 2023 03:56:23 +0000 (19:56 -0800)
commit6579f5bacc2c4cbc5ef6abb45352416939d1f844
treeacd0874966a904b5fc338dd0696ef8e050ab37e0
parent42186e6c00352ce9df9e3f12b1ff82e61978d40b
raw: use net_hash_mix() in hash function

Some applications seem to rely on RAW sockets.

If they use private netns, we can avoid piling all RAW
sockets bound to a given protocol into a single bucket.

Also place (struct raw_hashinfo).lock into its own
cache line to limit false sharing.

Alternative would be to have per-netns hashtables,
but this seems too expensive for most netns
where RAW sockets are not used.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/raw.h
net/ipv4/raw.c
net/ipv6/raw.c