diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-11-08 05:17:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-08 23:53:04 -0500 |
commit | fdcc8aa953a1123a289791dd192090651036d593 (patch) | |
tree | b30e27d1ba4d3330e5eb9b7da43d4dfb3a4e42f8 /include | |
parent | 415ce61aef5e9b2ed2516a13888c733bea15aedf (diff) |
udp: add a counter into udp_hslot
Adds a counter in udp_hslot to keep an accurate count
of sockets present in chain.
This will permit to upcoming UDP lookup algo to chose
the shortest chain when secondary hash is added.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/udp.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/udp.h b/include/net/udp.h index 22aa2e7eb1d7..9167281e47dc 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -50,8 +50,16 @@ struct udp_skb_cb { | |||
50 | }; | 50 | }; |
51 | #define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) | 51 | #define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) |
52 | 52 | ||
53 | /** | ||
54 | * struct udp_hslot - UDP hash slot | ||
55 | * | ||
56 | * @head: head of list of sockets | ||
57 | * @count: number of sockets in 'head' list | ||
58 | * @lock: spinlock protecting changes to head/count | ||
59 | */ | ||
53 | struct udp_hslot { | 60 | struct udp_hslot { |
54 | struct hlist_nulls_head head; | 61 | struct hlist_nulls_head head; |
62 | int count; | ||
55 | spinlock_t lock; | 63 | spinlock_t lock; |
56 | } __attribute__((aligned(2 * sizeof(long)))); | 64 | } __attribute__((aligned(2 * sizeof(long)))); |
57 | 65 | ||