On Sun, Jun 22, 2014 at 8:33 AM, Mindaugas Rasiukevicius <[email protected]> wrote: > Ryota Ozaki <[email protected]> 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.
Hmm, without it, I encountered an error on destroying a bridge for some reason. xc_broadcast might just hide the error, not fix it. I'll revisit the problem tomorrow. Thanks, ozaki-r > > -- > Mindaugas
