Source-Changes-D archive

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

Re: CVS commit: src/sys/net



On Wed, Sep 30, 2015 at 11:15 PM, Christoph Badura <bad%bsd.de@localhost> wrote:
> On Wed, Sep 30, 2015 at 07:12:32AM +0000, Ryota Ozaki wrote:
>> Modified Files:
>>       src/sys/net: if.h if_llatbl.c if_llatbl.h
>>
>> Log Message:
>> Make GATEWAY (fastforward) work again
>>
>> With GATEWAY (fastforward), the whole forwarding processing runs in
>> hardware interrupt context. So we cannot use rwlock for lltable and
>> llentry in that case.
>>
>> This change replaces rwlock with mutex(IPL_NET) for lltable and llentry
>> when GATEWAY is enabled. We need to tweak locking only around rtree
>> in lltable_free. Other than that, what we need to do is to change macros
>> for locks.
>>
>> I hope fastforward runs in softint some day in the future...
>
> Well, the point of the fast forwarding code was that the fast forwarding
> is done in interrupt context.  If no flow exists the normal (slow)
> forwarding path running in softint is used.

(Hardware) interrupt context isn't must for the fast forwarding,
IIUC. FreeBSD doesn't run it in the interrupt context nowadays and we
already have some network drivers run if_input (ether_input normally)
in softint context, e.g., pq3etsec [*].

My hope is that all network device drivers implement softint-based RX and
run if_input (i.e., Layer 2) in softint context. Then we can make
Layer 2 components (bridge, vlan, bpf, etc.) MP-safe easier than now.

[*] https://wiki.netbsd.org/users/msaitoh/Comparison_of_implementations_of_Ethernet_drivers/

  ozaki-r


Home | Main Index | Thread Index | Old Index