tech-net archive

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

Re: NET_MPSAFE and ether_ioctl()



On Thu, Jan 16, 2020 at 09:43:31AM -0800, Jason Thorpe wrote:
> 
> >> 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.

When it calls into non-MPSAFE code, then taking KERNEL_LOCK and possibly
raising spl is obviously necessary.


> Actually, it looks to me that ether_ioctl() IS MP-safe, and that's backed up by the fact that no path to ether_ioctl() or inside ether_ioctl() directly takes the KERNEL_LOCK, as it would otherwise need to do; splnet() is NOT sufficient, and I guess my point here is that I think it's not necessary :-).

To me this just says that the NET_MPSAFE code path is buggy and must also
take KERNEL_LOCK when calling into ether_* and ifmedia_* code.

ether_ioctl being MP-safe isn't obvious to me, it touches ifp fields,
calls into ifmedia itself and even arp code.


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


Home | Main Index | Thread Index | Old Index