Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Sep 1999 03:57:50 -0400 (EDT)
From:      "Matthew N. Dodd" <winter@jurai.net>
To:        John-Mark Gurney <gurney_j@resnet.uoregon.edu>
Cc:        Bill Paul <wpaul@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/pci if_sk.c if_skreg.h
Message-ID:  <Pine.BSF.4.10.9909200356250.20959-100000@sasami.jurai.net>
In-Reply-To: <19990919231444.17922@hydrogen.fircrest.net>

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




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