Date: Thu, 26 Feb 2004 13:57:38 -0500 (EST) From: Robert Watson <rwatson@freebsd.org> To: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= <des@des.no> Cc: arch@freebsd.org Subject: Re: per-device sysctls Message-ID: <Pine.NEB.3.96L.1040226135237.79901X-100000@fledge.watson.org> In-Reply-To: <xzpptc1k77y.fsf@dwp.des.no>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 26 Feb 2004, Dag-Erling Sm=F8rgrav wrote: > "M. Warner Losh" <imp@bsdimp.com> 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: <Intel 82371AB/EB (PIIX4) USB controller> 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: <NETGEAR MA401RA Wireless PC Card> at port 0x100-0x13f irq 11 function 0 config 1 on pccard1 drm0: <ATI Rage 128 Mobility LF (AGP)> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1040226135237.79901X-100000>