Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 May 2003 10:19:54 -0700 (PDT)
From:      Nate Lawson <nate@root.org>
To:        Harti Brandt <brandt@fokus.fraunhofer.de>
Cc:        "M. Warner Losh" <imp@bsdimp.com>
Subject:   Re: cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h
Message-ID:  <Pine.BSF.4.21.0305051014590.5135-100000@root.org>
In-Reply-To: <20030505122236.G53365@beagle.fokus.fraunhofer.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0305051014590.5135-100000>