From owner-cvs-src@FreeBSD.ORG Mon May 5 10:19:54 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ACD5D37B404 for ; Mon, 5 May 2003 10:19:54 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 9032B43FBF for ; Mon, 5 May 2003 10:19:53 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 5191 invoked by uid 1000); 5 May 2003 17:19:54 -0000 Date: Mon, 5 May 2003 10:19:54 -0700 (PDT) From: Nate Lawson To: Harti Brandt In-Reply-To: <20030505122236.G53365@beagle.fokus.fraunhofer.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: "M. Warner Losh" Subject: Re: cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2003 17:19:55 -0000 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