tech-net archive

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

Re: NET_MPSAFE and ether_ioctl()



thorpej%me.com@localhost (Jason Thorpe) writes:

>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.


It always calls splnet().

With NET_MPSAFE it calls it for ifmedia_ioctl() and ether_ioctl() as these
functions aren't MPSAFE.

Without NET_MPSAFE the whole wm_ioctl is protected as there are no mutexes.

The ugliness goes away when someone cares about the ifmedia and ether
functions.

-- 
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."


Home | Main Index | Thread Index | Old Index