diff options
author | Eric Dumazet | 2010-11-12 06:46:50 +0100 |
---|---|---|
committer | David S. Miller | 2010-11-12 22:18:57 +0100 |
commit | 1d7138de878d1d4210727c1200193e69596f93b3 (patch) | |
tree | f7abb08bfdf35d1e876f93d24ce44072d2f6ed72 /include/linux/igmp.h | |
parent | stmmac: update the driver documentation (diff) | |
download | kernel-qcow2-linux-1d7138de878d1d4210727c1200193e69596f93b3.tar.gz kernel-qcow2-linux-1d7138de878d1d4210727c1200193e69596f93b3.tar.xz kernel-qcow2-linux-1d7138de878d1d4210727c1200193e69596f93b3.zip |
igmp: RCU conversion of in_dev->mc_list
in_dev->mc_list is protected by one rwlock (in_dev->mc_list_lock).
This can easily be converted to a RCU protection.
Writers hold RTNL, so mc_list_lock is removed, not replaced by a
spinlock.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Cypher Wu <cypher.w@gmail.com>
Cc: Américo Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/igmp.h')
-rw-r--r-- | include/linux/igmp.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 93fc2449af10..7d164670f264 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h @@ -167,10 +167,10 @@ struct ip_sf_socklist { */ struct ip_mc_socklist { - struct ip_mc_socklist *next; + struct ip_mc_socklist __rcu *next_rcu; struct ip_mreqn multi; unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ - struct ip_sf_socklist *sflist; + struct ip_sf_socklist __rcu *sflist; struct rcu_head rcu; }; @@ -186,11 +186,14 @@ struct ip_sf_list { struct ip_mc_list { struct in_device *interface; __be32 multiaddr; + unsigned int sfmode; struct ip_sf_list *sources; struct ip_sf_list *tomb; - unsigned int sfmode; unsigned long sfcount[2]; - struct ip_mc_list *next; + union { + struct ip_mc_list *next; + struct ip_mc_list __rcu *next_rcu; + }; struct timer_list timer; int users; atomic_t refcnt; @@ -201,6 +204,7 @@ struct ip_mc_list { char loaded; unsigned char gsquery; /* check source marks? */ unsigned char crcount; + struct rcu_head rcu; }; /* V3 exponential field decoding */ |