mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
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>
This commit is contained in:
parent
64153ce0a7
commit
e989707135
4 changed files with 77 additions and 3 deletions
|
|
@ -84,6 +84,7 @@ struct ip_mc_list {
|
|||
struct ip_mc_list *next;
|
||||
struct ip_mc_list __rcu *next_rcu;
|
||||
};
|
||||
struct ip_mc_list __rcu *next_hash;
|
||||
struct timer_list timer;
|
||||
int users;
|
||||
atomic_t refcnt;
|
||||
|
|
|
|||
|
|
@ -50,12 +50,17 @@ struct ipv4_devconf {
|
|||
DECLARE_BITMAP(state, IPV4_DEVCONF_MAX);
|
||||
};
|
||||
|
||||
#define MC_HASH_SZ_LOG 9
|
||||
|
||||
struct in_device {
|
||||
struct net_device *dev;
|
||||
atomic_t refcnt;
|
||||
int dead;
|
||||
struct in_ifaddr *ifa_list; /* IP ifaddr chain */
|
||||
|
||||
struct ip_mc_list __rcu *mc_list; /* IP multicast filter chain */
|
||||
struct ip_mc_list __rcu * __rcu *mc_hash;
|
||||
|
||||
int mc_count; /* Number of installed mcasts */
|
||||
spinlock_t mc_tomb_lock;
|
||||
struct ip_mc_list *mc_tomb;
|
||||
|
|
|
|||
Loading…
Reference in a new issue