From owner-freebsd-arch@FreeBSD.ORG Thu Feb 26 10:58:39 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 90DFA16A4D4 for ; Thu, 26 Feb 2004 10:58:39 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1775C43D1D for ; Thu, 26 Feb 2004 10:58:39 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i1QIvdDL095451; Thu, 26 Feb 2004 13:57:39 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i1QIvdDW095448; Thu, 26 Feb 2004 13:57:39 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Thu, 26 Feb 2004 13:57:38 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE cc: arch@freebsd.org Subject: Re: per-device sysctls X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2004 18:58:39 -0000 On Thu, 26 Feb 2004, Dag-Erling Sm=F8rgrav wrote: > "M. Warner Losh" writes: > > I guess if you are going to reinvent devinfo, some mechanism to > > replace it should be included. It just looked like a 95% duplication > > of devinfo when I first saw things. >=20 > It should be a simple matter to reimplement devinfo(8) to use the dev > sysctl tree. Does anything else than devinfo(8) use devinfo(3)?=20 devinfo(8) is arguably one of the most useful additions to FreeBSD in a long time :-). Since you have your hands in there, could you take a look at the issue involving devices that share resources: specifically, devinfo(8) (possibly due to defficiences in the sysctls supporting it) does not render things like shared IRQ's well (or at all). For example, I have several devices that appear to share IRQ 11:=20 pcib0: slot 7 INTD is routed to irq 11 pcib0: slot 16 INTA is routed to irq 11 pcib0: slot 16 INTA is routed to irq 11 pcib1: slot 0 INTA is routed to irq 11 pcib0: slot 3 INTA is routed to irq 11 pcib0: slot 3 INTA is routed to irq 11 uhci0: port 0xdce0-0xdcff irq 11 at device 7.2 on pci0 xl0: <3Com 3c556 Fast Etherlink XL> port 0xd400-0xd4ff mem 0xf3ffd800-0xf3ffd87f,0xf3ffdc00-0xf3ffdc7f irq 11 at device 16.0 on pci0 wi0: at port 0x100-0x13f irq 11 function 0 config 1 on pccard1 drm0: port 0xec00-0xecff mem 0xfdffc000-0xfdffffff,0xf8000000-0xfbffffff irq 11 at device 0.0 on pci1 (This probably explains extreme suffering when running with apic and drm, but that's beside the point :-). Devinfo renders this as follows: Interrupt request lines: 0x0 (root0) 0x1 (atkbd0) 0x2-0x3 (root0) 0x4 (sio0) 0x5 (root0) 0x6 (fdc0) 0x7 (ppc0) 0x8 (root0) 0x9 (acpi0) 0xa (root0) 0xb (cbb0) 0xc (psmcpnp0) 0xd (root0) 0xe (ata0) 0xf (ata1) Having a unified and managed namespace for device sysctls sounds like a generally good idea to me, as more and more devices require some of another tweaking. Have you had any thoughts on how to name sysctls and kernel environment variables on a per-driver basis, rather than a per-device basis? I.e., fxp and some other device drivers have configuration settings that affect all instances of devices, rather than specific instances. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research