From owner-freebsd-current@FreeBSD.ORG Mon Oct 1 13:25:50 2007 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E25E16A417; Mon, 1 Oct 2007 13:25:50 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id C81F713C469; Mon, 1 Oct 2007 13:25:49 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.1/8.14.1/ALCHEMY.FRANKEN.DE) with ESMTP id l91DPmIa088354; Mon, 1 Oct 2007 15:25:48 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.1/8.14.1/Submit) id l91DPmdU088353; Mon, 1 Oct 2007 15:25:48 +0200 (CEST) (envelope-from marius) Date: Mon, 1 Oct 2007 15:25:48 +0200 From: Marius Strobl To: Stefan Esser Message-ID: <20071001132548.GE55741@alchemy.franken.de> References: <20070930114914.GB38896@alchemy.franken.de> <47001D02.4080700@protected-networks.net> <20070930221748.GC55741@alchemy.franken.de> <0FE79DBF-2E3B-4785-B192-666E02BFFB6D@mac.com> <20070930231620.GD55741@alchemy.franken.de> <4700ECC8.4090702@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4700ECC8.4090702@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: Marcel Moolenaar , Michael Butler , current@FreeBSD.org, jhb@FreeBSD.org Subject: Re: Proposal to revise the new parsing of PCI selectors (was: Re: HEADS UP: [cvs commit: src UPDATING src/share/man/man4 pci.4 src/share/man/man9 pci.9 src/sys/amd64/include legacyvar.h src/sys/amd64/amd64 legacy.c src/sys/amd64/pci pci_bus.c src/sys/arm/xscale/i80321 i80321_pci.c src/sys/arm/xscale/ixp425 ...) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Oct 2007 13:25:50 -0000 On Mon, Oct 01, 2007 at 02:49:12PM +0200, Stefan Esser wrote: > Marius Strobl wrote: > > On Sun, Sep 30, 2007 at 03:34:57PM -0700, Marcel Moolenaar wrote: > >> On Sep 30, 2007, at 3:17 PM, Marius Strobl wrote: > >> > >>>> Where it would previously succeed, I now get .. > >>>> > >>>> toshi# pciconf -wb pci0:30:0 0x1a 8 > >>>> pciconf: ioctl(PCIOCWRITE): Operation not supported by device > >>>> > >>> As mentioned the format of the location strings has changed, > >>> you probably need to use pci0:0:30:0. > >> If compatibility is a concern, we may be able to make the parsing > >> a bit more smart without too much complexity. We can count the > >> number of colons for exampl,e and assume missing elements are 0. > >> So, if one enters pci1:2:3, the domain will be 0. If one enters > >> pci4:5, both the domain and bus will be 0, etc. > >> > >> Just a thought... > >> > > > > Unfortunately, for pciconf(8) the function is already optional > > so pci1:2:3 would be ambiguous. > > > Well, since it was me who chose to parse it that way, when pciconf > saw the light of day, I can say that the logical extension appears > to be the support of 3 formats for the PCI device selector: > > pci1:2:3:4 (full, domain/bus/slot/function, required if domain!=0) > pci2:3:4 (abridged, in case the domain is "0") > pci2:3 (abridged, in case the domain and function are "0") > > > Since most devices are on a system with just a single PCI host > adapter, the two abridged formats could still be used, as before. > > Just in case of multiple PCI domains, the full 4 value form was > required for any domain other than "0". > > No compatibility problems, and the 3 value form would keep the > current meaning (it would become domain/bus/slot now). > > This appears to be in compliance with POLA. It means, that all the > current scripts (which may be shared between 6.x and 7.x) can stay > unmodified, since the 2- and 3-value formats keep their semantics. > And if PCI domains are used, its obvious there are no compatibility > issues (since they are no present in 6.x). > > > Since this was a change to my original code, I'd like to make the > change I outlined above, unless there are strong objections. > I'm ok with what you propose, I'd wait for John to comment whether he sees any issues regarding the hints feature he is working on though. Marius