Page MenuHomeFreeBSD

vmm: Add ppt device list sysctl
AbandonedPublic

Authored by christos on Sun, Apr 14, 11:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 26, 5:11 AM
Unknown Object (File)
Wed, Apr 17, 5:13 PM
Unknown Object (File)
Mon, Apr 15, 7:30 PM
Unknown Object (File)
Mon, Apr 15, 6:40 AM
Unknown Object (File)
Mon, Apr 15, 6:28 AM

Details

Reviewers
markj
Group Reviewers
bhyve
Summary

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 57102
Build 53990: arc lint + arc unit

Event Timeline

Isn't this basically the same as pciconf -l | grep ppt?

Isn't this basically the same as pciconf -l | grep ppt?

It is, but I thought it'd be handy to have it as a sysctl as well. We also have hw.vmm.ppt.devices which is the same as pciconf -l | grep ppt | wc -l.

Does this give any information pciconf -l would not already give? I would rather we'd improve our tooling than use a sysctl for that? I'd almost want something like ifconfig -g bridge -l in devctl or somewhere appropriate?

% pciconf -l | grep ppt
ppt0@pci0:2:0:0: class=0x028000 rev=0x1a hdr=0x00 vendor=0x8086 device=0x2723 subvendor=0x1a56 subdevice=0x1653

Maybe if the commit message would describe why this is helpful anyway, it would help to understand the problem it is trying to solve?

In D44792#1020926, @bz wrote:

Does this give any information pciconf -l would not already give? I would rather we'd improve our tooling than use a sysctl for that? I'd almost want something like ifconfig -g bridge -l in devctl or somewhere appropriate?

% pciconf -l | grep ppt
ppt0@pci0:2:0:0: class=0x028000 rev=0x1a hdr=0x00 vendor=0x8086 device=0x2723 subvendor=0x1a56 subdevice=0x1653

Maybe if the commit message would describe why this is helpful anyway, it would help to understand the problem it is trying to solve?

As mentioned, it doesn't provide any more information than pciconf -l | grep ppt, I implemented this for completeness, since we already have hw.vmm.ppt.devices. The sysctl can be used by other tools (like devctl as you said) to fetch the pptdevs list.

Generally speaking, sysctls are convenient for users, but not very much so for programs. For instance, sysctl interfaces make it hard to sandbox applications since we don't have a file descriptor-based interface for sysctls. It's also impossible to change or extend after the fact without breaking compatibility, which isn't true of ioctls. I'd prefer not to add this unless there's some more specific reason for wanting it.