Skip to content

netns: optimize tcp and udp hashtables wrt net namespaces

Pavel Emelyanov netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8UDP: introduce a udp_hashfn functioninclude/linux/udp.h net/ipv4/udp.c net/ipv6/udp.c+13 -80 replies
2/8UDP: provide a struct net pointer for __udp[46]_lib_mcast_delivernet/ipv4/udp.c net/ipv6/udp.c+14 -70 replies
3/8UDP: add struct net argument to udp_hashfninclude/linux/udp.h net/ipv4/udp.c net/ipv6/udp.c+9 -90 replies
4/8Inet: add struct net argument to inet_bhashfninclude/net/inet_hashtables.h net/ipv4/inet_connection_sock.c net/ipv4/inet_hashtables.c +1 more+17 -90 replies
5/8Inet: add struct net argument to inet_lhashfninclude/net/inet_hashtables.h net/ipv4/inet_hashtables.c net/ipv6/inet6_hashtables.c+5 -40 replies
6/8Inet: add struct net argument to inet_ehashfninclude/net/inet_sock.h net/ipv4/inet_hashtables.c+7 -50 replies
7/8Inet6: add struct net argument to inet6_ehashfninclude/net/inet6_hashtables.h net/ipv6/inet6_hashtables.c+8 -50 replies
8/8Netns: introduce the net_hash_mix "salt" for hashesinclude/linux/udp.h include/net/inet6_hashtables.h include/net/inet_hashtables.h +2 more+30 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/8] netns: optimize tcp and udp hashtables wrt net namespaces

Currently hash functions to store udp sockets, bind buckets, listening and established tcp sockets take only ports and/or addresses into account.

The result is nasty. Consider processes in different namespaces communicate to each other or the outer world with same ports or addresses (e.g. dns server run in each namespace, apache server listening a 80 port in each ns or communications via lo). All these sockets will all be linked in a single hash chain, thus producing too long chains.

To avoid this situation the proposal is to add some "salt" to hash functions taking the namespace into account.

I made this "salt" disappear for CONFIG_NET_NS=n case.