[Bridge] Re: [PATCH] fix oops when mangling and brouting and tcpdumping packets

Stephen Hemminger shemminger at osdl.org
Tue Aug 24 14:25:34 PDT 2004

On Tue, 24 Aug 2004 22:35:10 +0200
Bart De Schuymer <bdschuym at pandora.be> wrote:

> On Tuesday 24 August 2004 20:38, Stephen Hemminger wrote:
> > How about this, it is basically Bart's patch with:
> > 	* some more cleanups to handle_bridge
> > 	* removing extra rcu_read_lock (already done in netif_receive_skb)
> > 	* pass bridge port to hook since already dereferenced in handle_bridge
> Looks good.
> I'm not sure if the rcu_dereference() is needed, however. Can the bridge port 
> be removed while a packet is being processed? I thought the rcu_read_lock() 
> protects against that (del_nbp() does call_rcu(&p->rcu, destroy_nbp_rcu)).
> cheers,
> Bart

rcu_read_lock is not really a lock, it just turns off preempt.
So, rcu_dereference is needed on CPU with weak consitency like Alpha.
It handles the case where a packet is processed between del_nbp() and destroy_nbp_rcu
where the bridge port still exists, but is being deleted.

More information about the Bridge mailing list