tech-net archive

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

NET_MPSAFE and ether_ioctl()



The "wm" driver has the following construct in wm_ioctl():

#ifdef WM_MPSAFE
                s = splnet();
#endif
                /* It may call wm_start, so unlock here */
                error = ether_ioctl(ifp, cmd, data);
#ifdef WM_MPSAFE
                splx(s);
#endif

I'm a little confused as to why it's at all correct for a driver to be using splnet when running in NET_MPSAFE mode. (See also my previous post about ifmedia_ioctl()).

I took at look at what ether_ioctl() could be doing that would necessitate directly going to splnet (rather than doing this as part of acquiring a mutex).  ether_ioctl() will be called while ifp->if_ioctl_lock (which is a standard adaptive mutex).  I am not really seeing a good reason why the splnet call that the "wm" driver makes is necessary.  Can someone explain the reason?

-- thorpej



Home | Main Index | Thread Index | Old Index