Page MenuHomeFreeBSD

Make VF creation more robust.
ClosedPublic

Authored by jhb on May 3 2016, 6:33 PM.
Tags
None
Referenced Files
F86478874: D6192.id.diff
Fri, Jun 21, 12:31 AM
Unknown Object (File)
Nov 12 2023, 3:34 PM
Unknown Object (File)
Nov 8 2023, 7:57 AM
Unknown Object (File)
Nov 5 2023, 5:07 AM
Unknown Object (File)
Oct 7 2023, 6:49 AM
Unknown Object (File)
Oct 4 2023, 5:02 AM
Unknown Object (File)
Sep 28 2023, 3:18 AM
Unknown Object (File)
Aug 6 2023, 7:49 AM
Subscribers

Details

Summary

Make VF creation more robust.

  • Use the correct location of the SRIOV capability when enabling ARI. Also, if enabling ARI fails, fail to create VFs.
  • Save the value of the IOV control and page size registers and restore them (along with the VF count) in pci_cfg_save/pci_cfg_restore. This ensures ARI remains enabled if a PF driver resets itself during the PCI_IOV_INIT callback. Theoretically this might also properly restore SRIOV state across suspend/resume.

(Note: I can split this into two commits, but might be easier to review
in one sitting. I also tested them together.)

Test Plan
  • Try to create VFs on an out-of-tree driver that resets the adapter in the PCI_IOV_INIT callback resulting in the IOV_CTL register being cleared and the ARI setting being lost. This means config access to the VFs doesn't work after they are created.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb retitled this revision from to Make VF creation more robust..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added reviewers: rstone, vangyzen.
vangyzen edited edge metadata.
This revision is now accepted and ready to land.May 3 2016, 7:11 PM
rstone edited edge metadata.
rstone added inline comments.
sys/dev/pci/pci_iov.c
455 ↗(On Diff #15865)

Oof. Good catch.

This revision was automatically updated to reflect the committed changes.