[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1289571974.3185.254.camel@edumazet-laptop>
Date: Fri, 12 Nov 2010 15:26:14 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Américo Wang <xiyou.wangcong@...il.com>
Cc: Cypher Wu <cypher.w@...il.com>, linux-kernel@...r.kernel.org,
netdev <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>
Subject: Re: [PATCH net-next-2.6] igmp: RCU conversion of in_dev->mc_list
Le vendredi 12 novembre 2010 à 14:34 +0100, Eric Dumazet a écrit :
> Le vendredi 12 novembre 2010 à 10:22 +0100, Eric Dumazet a écrit :
> > Le vendredi 12 novembre 2010 à 16:19 +0800, Américo Wang a écrit :
> > > On Fri, Nov 12, 2010 at 08:27:54AM +0100, Eric Dumazet wrote:
> >
> > > >A RCU conversion is far more complex.
> > > >
> > >
> > > Yup.
> >
> >
> > Well, actually this is easy in this case.
> >
> > I'll post a patch to do this RCU conversion.
> >
> >
>
> Note : compile tested only, I'll appreciate if someone can test it ;)
>
> Note: one patch from net-2.6 is not yet included in net-next-2.6, so
> please make sure you have it before testing ;)
>
> ( http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=18943d292facbc70e6a36fc62399ae833f64671b )
>
>
> Thanks
>
> [PATCH net-next-2.6] 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@...il.com>
> Cc: Cypher Wu <cypher.w@...il.com>
> Cc: Américo Wang <xiyou.wangcong@...il.com>
> ---
...
> void ip_mc_up(struct in_device *in_dev)
> {
> - struct ip_mc_list *i;
> + struct ip_mc_list *pmc;
>
> ASSERT_RTNL();
>
> ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS);
>
> - for (i=in_dev->mc_list; i; i=i->next)
> - igmp_group_added(i);
> + for_each_pmc_rtnl(in_dev, pmc);
> + igmp_group_added(pmc);
> }
Oops there is an extra ; after the for_each_pmc_rtnl(in_dev, pmc)
should be
for_each_pmc_rtnl(in_dev, pmc)
igmp_group_added(pmc);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists