cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h

Nate Lawson nate at root.org
Mon May 5 10:19:55 PDT 2003


On Mon, 5 May 2003, Harti Brandt wrote:
> M. Warner Losh wrote:
> MWL>Right now there's no safe way to use driver locks.  Sometimes, we have
> MWL>to acquire the locks NET, DRIVER.  Other times you do the reverse.
> MWL>There are other times you do need to call ether_ifdetach with the lock
> MWL>held.  This is a real mess.  I'm contemplating a strawman proposal to
> MWL>help address these issues.
> 
> I'd love to see it.

Your comments are coming in a bit late.  I believe the next step is for
Warner to send out his proposal once he's ready.
 
> But, what's the point in this iterations over fxp if they are deliberatly
> wrong? Others will copy this locking stategy to their drivers.

As author of the diff in question, I have answered this before.  The fxp
locks are to protect access to the card registers, softc, etc. from
multiple kernel threads.  They helped me identify a problem in zalloc
(fixed by drew@) when running without Giant.  They fostered this
discussion which I hope will lead to a documented strategy for how to lock
network drivers.  Do not copy code until this discussion is complete and
ifnet has been locked.

-Nate



More information about the cvs-all mailing list