Source-Changes-D archive

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

Re: NET_MPSAFE [was Re: CVS commit: src/sys]

On 01/21/17 10:13, Nick Hudson wrote:
On 01/20/17 03:34, Ryota Ozaki wrote:
On Mon, Dec 12, 2016 at 5:24 PM, Nick Hudson <> wrote:
On 11/28/16 09:43, Ryota Ozaki wrote:
On Mon, Nov 28, 2016 at 4:29 PM, Nick Hudson <> wrote:

This is hurting me again.


I think we need NET_MPSAFE finished for netbsd-8
Further investigations show that even if we enable NET_MPSAFE by default,
there are cases that calling driver Tx with holding softnet_lock. For
example, packet transmission via a unconnected socket and TCP syn ack
(tcp_input still needs softnet_lock).

So I have brought another idea to address the issue: Tx softint; it
defers if_start to softint, which is implemented with deferred if_start.
By doing so, driver's if_start is called without holding softnet_lock.
Note that of course the feature is only enabled for drivers that request it.

This is a patch:
The patch includes changes to if_axe for an example.

The drawback of the approach is of course performance degradation.
I tried it with vioif and saw 3% down on iperf. I haven't tested
it using USB devices, so I don't know the performance impact on USB Tx.

Nick, how do you think the approach? And can you try the patch and
benchmark if the approach satisfies you?

I'll look into this, but...

Thinking about this I don't think it's needed as I don't think usb drivers call
if_start from hard interrupt context.

Still not sure how this fixes the softnet_lock held for too long problem


Home | Main Index | Thread Index | Old Index