udp: bind() optimisation
UDP bind() can be O(N^2) in some pathological cases. Thanks to secondary hash tables, we can make it O(N) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
0ab365f463
commit
30fff9231f
@@ -88,6 +88,12 @@ static inline struct udp_sock *udp_sk(const struct sock *sk)
|
||||
return (struct udp_sock *)sk;
|
||||
}
|
||||
|
||||
#define udp_portaddr_for_each_entry(__sk, node, list) \
|
||||
hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node)
|
||||
|
||||
#define udp_portaddr_for_each_entry_rcu(__sk, node, list) \
|
||||
hlist_nulls_for_each_entry_rcu(__sk, node, list, __sk_common.skc_portaddr_node)
|
||||
|
||||
#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag)
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user