diff options
author | David S. Miller <davem@davemloft.net> | 2014-07-16 23:30:25 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-16 23:30:25 -0700 |
commit | e18a44590a363b6785f12f87167d46be4421ed5b (patch) | |
tree | cab09b28d188606139b1b50b661f42da157c52ba /include/net | |
parent | 3e1c0f0b06e38b50bfca197a6443d639353bb035 (diff) | |
parent | 2dc41cff7545d55c6294525c811594576f8e119c (diff) |
Merge branch 'udp_hash'
David Held says:
====================
udp: Fix multicast performance issues.
Fix performance issues with listening to many different multicast
sockets on different addresses with the same port. Instead of always
using hash1, fall back to hash2 lookup when hash1 lookup is long.
Patch 1 is a general cleanup and simplification which also makes the
main implementation in Patch 2 simpler.
Eric's recent change 63c6f81cdde5 avoided this being an issue in early
demux. This makes it work for regular delivery as well.
v1->v2
- updated hash collision detection
v2->v3
- avoid flushing under lock unnecessarily at ARRAY_SIZE boundary
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sock.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 29e48a6d1ded..28f734601b50 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -660,6 +660,20 @@ static inline void sk_add_bind_node(struct sock *sk, #define sk_for_each_bound(__sk, list) \ hlist_for_each_entry(__sk, list, sk_bind_node) +/** + * sk_nulls_for_each_entry_offset - iterate over a list at a given struct offset + * @tpos: the type * to use as a loop cursor. + * @pos: the &struct hlist_node to use as a loop cursor. + * @head: the head for your list. + * @offset: offset of hlist_node within the struct. + * + */ +#define sk_nulls_for_each_entry_offset(tpos, pos, head, offset) \ + for (pos = (head)->first; \ + (!is_a_nulls(pos)) && \ + ({ tpos = (typeof(*tpos) *)((void *)pos - offset); 1;}); \ + pos = pos->next) + static inline struct user_namespace *sk_user_ns(struct sock *sk) { /* Careful only use this in a context where these parameters |