per-device sysctls
Robert Watson
rwatson at freebsd.org
Thu Feb 26 10:58:39 PST 2004
On Thu, 26 Feb 2004, Dag-Erling Smørgrav wrote:
> "M. Warner Losh" <imp at 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.
>
> 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)?
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:
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 at fledge.watson.org Senior Research Scientist, McAfee Research
More information about the freebsd-arch
mailing list