aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-11-08 05:17:30 -0500
committerDavid S. Miller <davem@davemloft.net>2009-11-08 23:53:05 -0500
commitd4cada4ae1c012815f95fa507eb86a0ae9d607d7 (patch)
tree23cdfb3763c9140ae095bf8095c3e6b16f7b48f3 /include/net
parentfdcc8aa953a1123a289791dd192090651036d593 (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/net')
-rw-r--r--include/net/sock.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 55de3bd719a5..827366b62680 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -109,6 +109,7 @@ struct net;
109 * @skc_refcnt: reference count 109 * @skc_refcnt: reference count
110 * @skc_tx_queue_mapping: tx queue number for this connection 110 * @skc_tx_queue_mapping: tx queue number for this connection
111 * @skc_hash: hash value used with various protocol lookup tables 111 * @skc_hash: hash value used with various protocol lookup tables
112 * @skc_u16hashes: two u16 hash values used by UDP lookup tables
112 * @skc_family: network address family 113 * @skc_family: network address family
113 * @skc_state: Connection state 114 * @skc_state: Connection state
114 * @skc_reuse: %SO_REUSEADDR setting 115 * @skc_reuse: %SO_REUSEADDR setting
@@ -131,7 +132,10 @@ struct sock_common {
131 atomic_t skc_refcnt; 132 atomic_t skc_refcnt;
132 int skc_tx_queue_mapping; 133 int skc_tx_queue_mapping;
133 134
134 unsigned int skc_hash; 135 union {
136 unsigned int skc_hash;
137 __u16 skc_u16hashes[2];
138 };
135 unsigned short skc_family; 139 unsigned short skc_family;
136 volatile unsigned char skc_state; 140 volatile unsigned char skc_state;
137 unsigned char skc_reuse; 141 unsigned char skc_reuse;