Source-Changes-D archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/sys/dev/usb
On Mon, Jun 24, 2019 at 5:26 PM Manuel Bouyer <bouyer%antioche.eu.org@localhost> wrote:
>
> On Mon, Jun 24, 2019 at 08:39:08AM +0100, Nick Hudson wrote:
> >
> >
> > On 24/06/2019 04:30, matthew green wrote:
> > > > > splnet is obsolete in modern USB network drivers.
> > > > > all the code runs at softipl.
> > > > >
> > > > > removing spl was done entirely on purpose.
> > > >
> > > > I saw the comment of ether_ioctl in sys/net/if_ethersubr.c
> > > > > Note, we must be called at splnet().
> > > > so I asked.
> > >
> > > that comment is true for old style drivers, but looking at other
> > > drivers they also only skip this for NET_MPSAFE kernel builds.
> > >
> > > Nick, do we need to make these go back to non-mpsafe stuff for
> > > networking if !NET_MPSAFE?
> >
> > I'm really not sure.
> >
> > splnet is to prevent IPL_NET interrupt handlers (common for most
> > drivers) from running. USB ethernet devices don't have these, however.
> > All handling of device to host communications is done via USB callbacks
> > which run at splsoftserial (aka splusb).
>
> Actually, I think splnet() ( + KERNEL_LOCK) is used to protect the network
> stack when NET_MPSAFE is not defined.
Only KERNEL_LOCK (and some splsoftnet) is required for the network stack
now. Remaining splnets are for network drivers. (softnet_lock is also required
in some cases but it's another story...)
>
> For example pppoe(4) uses it when NET_MPSAFE is not defined.
Because there was a driver, lmc(4), that calls pppoe from hardware interrupt
handler, but now it's removed, so splnet is not required anymore and splsoftnet
is enough now (as per knakahara@).
ozaki-r
Home |
Main Index |
Thread Index |
Old Index