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 Tue, Jun 25, 2019 at 4:03 PM Nick Hudson <nick.hudson%gmx.co.uk@localhost> wrote:
>
> On 24/06/2019 10:40, Ryota Ozaki wrote:
> > On Mon, Jun 24, 2019 at 6:27 PM matthew green <mrg%eterna.com.au@localhost> wrote:
> >>
> >>> 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...)
> >>
> >> great!  i studied the code and i couldn't find any issues
> >> in any of the relevant paths, so i'm glad to hear it's
> >> supposed to be like this.
> >>
> >> for one particular case (ether_ioctl) how is this diff:
> >>
> >> - * Common ioctls for Ethernet interfaces.  Note, we must be
> >> - * called at splnet().
> >> + * Common ioctls for Ethernet interfaces.
> >> + *
> >> + * Non IFEF_MPSAFE drivers must call this function at at least called
> >> + * at splsoftnet().
> >>
> >> or should they also be with kernel lock?
> >
> > Yes.
> >
> > Also I think splnet is still needed for ether_ioctl for sure because
> > it has to care not only the network stack but also network drivers.
>
> If a driver is made MP safe and regardless of if it is marked
> IFEF_MPSAFE then I think the splnet part can be dropped.  That is,
> struct ifnet is either KERNEL_LOCK / IFNET_LOCK AND driver mutex
> protected.  The driver mutexes provide appropriate mutex exclusion
> between threads and interrupts.
>
> Would you agree?

Oh, agree.  I assumed non MP-safe drivers, not non IFEF_MPSAFE drivers.

  ozaki-r


Home | Main Index | Thread Index | Old Index