aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2013-04-25 00:42:29 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-04-24 22:31:58 -0400
commit5a8eb24292ffd68604cedeb24ad2b4bc02cfc037 (patch)
treef85a264eccef0fec9337be43d8ff5fa5bac7a250 /include/linux/pci.h
parentd44e7a9a1f1e56918f8e937dcf750626ac5ad9b4 (diff)
pci: Add SRIOV helper function to determine if VFs are assigned to guest
This function is meant to add a helper function that will determine if a PF has any VFs that are currently assigned to a guest. We currently have been implementing this function per driver, and going forward I would like to avoid that by making this function generic and using this helper. v2: Removed extern from declaration of pci_vfs_assigned in pci.h and return 0 if SR-IOV is disabled with is inline with other PCI SRIOV functions. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 710067f3618c..43e45ac36458 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1644,6 +1644,7 @@ extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
1644extern void pci_disable_sriov(struct pci_dev *dev); 1644extern void pci_disable_sriov(struct pci_dev *dev);
1645extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); 1645extern irqreturn_t pci_sriov_migration(struct pci_dev *dev);
1646extern int pci_num_vf(struct pci_dev *dev); 1646extern int pci_num_vf(struct pci_dev *dev);
1647int pci_vfs_assigned(struct pci_dev *dev);
1647extern int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); 1648extern int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
1648extern int pci_sriov_get_totalvfs(struct pci_dev *dev); 1649extern int pci_sriov_get_totalvfs(struct pci_dev *dev);
1649#else 1650#else
@@ -1662,6 +1663,10 @@ static inline int pci_num_vf(struct pci_dev *dev)
1662{ 1663{
1663 return 0; 1664 return 0;
1664} 1665}
1666static inline int pci_vfs_assigned(struct pci_dev *dev)
1667{
1668 return 0;
1669}
1665static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) 1670static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs)
1666{ 1671{
1667 return 0; 1672 return 0;