Page MenuHomeFreeBSD

Fix SR-IOV passthrough devices to allow ppt to attach

Authored by rstone on Mar 10 2015, 7:35 PM.



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.

Diff Detail

rS FreeBSD src repository - subversion
Lint Skipped
Unit Tests Skipped

Event Timeline

rstone retitled this revision from to Fix SR-IOV passthrough devices to allow ppt to attach.
rstone edited the test plan for this revision. (Show Details)
rstone updated this object.
jhb edited edge metadata.

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)

This revision is now accepted and ready to land.Mar 10 2015, 8:32 PM

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

rstone updated this revision to Diff 4173.

Closed by commit rS279868 (authored by @rstone).

Nice! Definitely time to add clear driver then. Thanks.