A late change to the SR-IOV infrastructure broke passthrough of
VFs. device_set_devclass() was being used to try to force the
ppt driver to attach to the device, but this didn't work because
the DF_FIXEDCLASS flag wasn't being set on the device, so the
ppt driver probe routine would not match when it returned
BUS_NOWILDCARD. Fix this by adding a new device function that
both sets the devclass and sets the DF_FIXEDCLASS flag, and use
that to force the ppt driver to attach to VFs.
Details
- Reviewers
jhb - Commits
- rS279868: Fix SR-IOV passthrough devices to allow ppt to attach
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
I assume this worked when you tested it? I really need to test that your wildcard change fixes the devctl case. If it does then I will implement a "clear driver" command that can be used to undo a fixed devclass (so a VF can be pulled back into the host if an admin wishes to do so)
Yes, it works now. Also, independent of this (but with the vmm.ko fix that already went in), devctl does work to force the ppt driver to attach to a device:
$ sudo devctl detach ixl4
$ sudo devctl set driver pci11:0:3 ppt
$ dmesg | tail
ixlv2: Ethernet address: 3a:73:97:c0:97:42
ixlv3: <Intel(R) Ethernet Connection XL710 VF Driver, Version - 1.2.1> at device 0.19 on pci11
ixlv3: Using MSIX interrupts with 5 vectors
ixlv3: Ethernet address: 6a:66:dd:df:e7:b2
ixlv0: link state changed to UP
ixlv1: link state changed to UP
ixlv2: link state changed to UP
ixlv3: link state changed to UP
ixl4: detached
ppt1 mem 0x383ffb800000-0x383ffbffffff,0x383ffe000000-0x383ffe007fff irq 40 at device 0.3 on pci11
$