From owner-cvs-all Mon Sep 20 0:58: 0 1999 Delivered-To: cvs-all@freebsd.org Received: from sasami.jurai.net (sasami.jurai.net [63.67.141.99]) by hub.freebsd.org (Postfix) with ESMTP id A1A3E158F4; Mon, 20 Sep 1999 00:57:52 -0700 (PDT) (envelope-from winter@jurai.net) Received: from localhost (winter@localhost) by sasami.jurai.net (8.8.8/8.8.7) with ESMTP id DAA23384; Mon, 20 Sep 1999 03:57:51 -0400 (EDT) Date: Mon, 20 Sep 1999 03:57:50 -0400 (EDT) From: "Matthew N. Dodd" To: John-Mark Gurney Cc: Bill Paul , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/pci if_sk.c if_skreg.h In-Reply-To: <19990919231444.17922@hydrogen.fircrest.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk The correct solution for drivers which attached numbered sub instances (children) is to embrace the joy and rapture that is new-bus and implement bus methods for attaching your children to. This takes up no more than 50 lines of nicely formatted code. On Sun, 19 Sep 1999, John-Mark Gurney wrote: > Bill Paul scribbled this message on Sep 17: > > Fix the mechanism used to choose the unit numbers for the IP interfaces > > attached by the SysKonnect driver. Use ifunit() to scan for existing > > skN interfaces and pick the first unused one. > > this is probably not just related to the sk[c] driver, but all ethernet > drivers that do this... we have a race condition w/ the allocation of > an interface number... > > if there is another attach of a similar device going on at the same > time (which can happen as we go to a more modularized setup), two > devices could end up w/ the same unit number which I'm sure if_attach > would fall over in (hopefully)... we need to initalize ifp->if_unit > in if_attach and do it in a locked way instead of leaving this up to > chance... > > I haven't taken a look at how if_attach behaves, but this should be > fixed, and any other race conditions like it... > > -- | Matthew N. Dodd | '78 Datsun 280Z | '75 Volvo 164E | FreeBSD/NetBSD | | winter@jurai.net | 2 x '84 Volvo 245DL | ix86,sparc,pmax | | http://www.jurai.net/~winter | This Space For Rent | ISO8802.5 4ever | To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message