diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-11-08 05:17:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-08 23:53:05 -0500 |
commit | d4cada4ae1c012815f95fa507eb86a0ae9d607d7 (patch) | |
tree | 23cdfb3763c9140ae095bf8095c3e6b16f7b48f3 /include/linux/udp.h | |
parent | fdcc8aa953a1123a289791dd192090651036d593 (diff) |
udp: split sk_hash into two u16 hashes
Union sk_hash with two u16 hashes for udp (no extra memory taken)
One 16 bits hash on (local port) value (the previous udp 'hash')
One 16 bits hash on (local address, local port) values, initialized
but not yet used. This second hash is using jenkin hash for better
distribution.
Because the 'port' is xored later, a partial hash is performed
on local address + net_hash_mix(net)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/udp.h')
-rw-r--r-- | include/linux/udp.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/udp.h b/include/linux/udp.h index 832361e3e596..5b4b5274e683 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -55,6 +55,8 @@ static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask) | |||
55 | struct udp_sock { | 55 | struct udp_sock { |
56 | /* inet_sock has to be the first member */ | 56 | /* inet_sock has to be the first member */ |
57 | struct inet_sock inet; | 57 | struct inet_sock inet; |
58 | #define udp_port_hash inet.sk.__sk_common.skc_u16hashes[0] | ||
59 | #define udp_portaddr_hash inet.sk.__sk_common.skc_u16hashes[1] | ||
58 | int pending; /* Any pending frames ? */ | 60 | int pending; /* Any pending frames ? */ |
59 | unsigned int corkflag; /* Cork is required */ | 61 | unsigned int corkflag; /* Cork is required */ |
60 | __u16 encap_type; /* Is this an Encapsulation socket? */ | 62 | __u16 encap_type; /* Is this an Encapsulation socket? */ |