[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netbsd-tech-net
Subject:    Re: Bridge forwarding employing pktqueue
From:       Ryota Ozaki <ozaki-r () iij ! ad ! jp>
Date:       2014-06-22 13:00:17
Message-ID: CAKrYomgnW6Stq6ZeF52sY5STDX09=Py2zHnRWsn+HA6aNBCDEA () mail ! gmail ! com
[Download RAW message or body]

On Sun, Jun 22, 2014 at 8:33 AM, Mindaugas Rasiukevicius
<rmind@netbsd.org> wrote:
> Ryota Ozaki <ozaki-r@iij.ad.jp> 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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic