diff options
author | Eric Dumazet <edumazet@google.com> | 2013-06-07 17:48:57 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-12 09:25:23 +0200 |
commit | e9897071350bd9d94a56b5b6f79c85b1a98fc7e7 (patch) | |
tree | d01026afb4450ef685722cd7a0fe1815336170ca /net/ipv4/devinet.c | |
parent | net_sched: htb: do not setup default rate estimators (diff) | |
download | linux-e9897071350bd9d94a56b5b6f79c85b1a98fc7e7.tar.xz linux-e9897071350bd9d94a56b5b6f79c85b1a98fc7e7.zip |
igmp: hash a hash table to speedup ip_check_mc_rcu()
After IP route cache removal, multicast applications using
a lot of multicast addresses hit a O(N) behavior in ip_check_mc_rcu()
Add a per in_device hash table to get faster lookup.
This hash table is created only if the number of items in mc_list is
above 4.
Reported-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/devinet.c')
-rw-r--r-- | net/ipv4/devinet.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index b047e2d8a614..3469506c106d 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c @@ -215,6 +215,7 @@ void in_dev_finish_destroy(struct in_device *idev) WARN_ON(idev->ifa_list); WARN_ON(idev->mc_list); + kfree(rcu_dereference_protected(idev->mc_hash, 1)); #ifdef NET_REFCNT_DEBUG pr_debug("%s: %p=%s\n", __func__, idev, dev ? dev->name : "NIL"); #endif |