summaryrefslogtreecommitdiffstats
path: root/include/linux/udp.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-11-09 05:26:33 +0000
committerDavid S. Miller <davem@davemloft.net>2009-11-10 20:54:38 -0800
commit30fff9231fad757c061285e347b33c5149c2c2e4 (patch)
tree79d07aba4b8de4367090442292e412d1ccf961ef /include/linux/udp.h
parent0ab365f463b9c5c8b76476a1808dfde1c38f6f19 (diff)
downloadblackbird-op-linux-30fff9231fad757c061285e347b33c5149c2c2e4.tar.gz
blackbird-op-linux-30fff9231fad757c061285e347b33c5149c2c2e4.zip
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>
Diffstat (limited to 'include/linux/udp.h')
-rw-r--r--include/linux/udp.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 59f0ddf2d284..03f72a2ba028 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -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
OpenPOWER on IntegriCloud