tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Bridge forwarding employing pktqueue



Ryota Ozaki <ozaki-r%iij.ad.jp@localhost> wrote:
> >> An integrated patch is attached and available here:
> >> http://www.netbsd.org/~ozaki-r/bridge-pktq.diff
> >
> > Why xc_broadcast()?
> 
> I just followed the code of if_detach though, we need to
> wait for pktq_barrier (packet draining) completion here.
> Otherwise, the packet draining (xmit) conflicts with
> following bridge_stop that may also xmit.

pktq_barrier() is synchronous i.e. when it returns - you can assume that
the pktqueue is empty.  The reason why xc_broadcast/xc_wait() was added
to if_detach() is actually unrelated to pktqueue.  We have to wait for
interrupts to complete as they may reference struct ifnet via mbuf.

I do not think you need xc_broadcast stuff in the bridge code.

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index