diff options
author | Donald Dutile <ddutile@redhat.com> | 2012-11-05 15:20:36 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-11-09 22:10:39 -0500 |
commit | 1789382a72a537447d65ea4131d8bcc1ad85ce7b (patch) | |
tree | a22142cf3882ccf95e9be73642d3738fb5a72af1 /include/linux/pci.h | |
parent | 625e1d59a89f50bace376f429d8cf50347af75f7 (diff) |
PCI: SRIOV control and status via sysfs
Provide files under sysfs to determine the maximum number of VFs
an SR-IOV-capable PCIe device supports, and methods to enable and
disable the VFs on a per-device basis.
Currently, VF enablement by SR-IOV-capable PCIe devices is done
via driver-specific module parameters. If not setup in modprobe files,
it requires admin to unload & reload PF drivers with number of desired
VFs to enable. Additionally, the enablement is system wide: all
devices controlled by the same driver have the same number of VFs
enabled. Although the latter is probably desired, there are PCI
configurations setup by system BIOS that may not enable that to occur.
Two files are created for the PF of PCIe devices with SR-IOV support:
sriov_totalvfs Contains the maximum number of VFs the device
could support as reported by the TotalVFs register
in the SR-IOV extended capability.
sriov_numvfs Contains the number of VFs currently enabled on
this device as reported by the NumVFs register in
the SR-IOV extended capability.
Writing zero to this file disables all VFs.
Writing a positive number to this file enables that
number of VFs.
These files are readable for all SR-IOV PF devices. Writes to the
sriov_numvfs file are effective only if a driver that supports the
sriov_configure() method is attached.
Signed-off-by: Donald Dutile <ddutile@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index ee2179546c63..7ef8fba319da 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -573,6 +573,7 @@ struct pci_driver { | |||
573 | int (*resume_early) (struct pci_dev *dev); | 573 | int (*resume_early) (struct pci_dev *dev); |
574 | int (*resume) (struct pci_dev *dev); /* Device woken up */ | 574 | int (*resume) (struct pci_dev *dev); /* Device woken up */ |
575 | void (*shutdown) (struct pci_dev *dev); | 575 | void (*shutdown) (struct pci_dev *dev); |
576 | int (*sriov_configure) (struct pci_dev *dev, int num_vfs); /* PF pdev */ | ||
576 | const struct pci_error_handlers *err_handler; | 577 | const struct pci_error_handlers *err_handler; |
577 | struct device_driver driver; | 578 | struct device_driver driver; |
578 | struct pci_dynids dynids; | 579 | struct pci_dynids dynids; |