History

PCI/IOV: Introduce pci_iov_sysfs_link() function

Currently pci_iov_add_virtfn() scans the SR-IOV BARs, adds the VF to the bus and also creates the sysfs links between the newly added VF and its parent PF. With pdev->no_vf_scan fencing off the entire pci_iov_add_virtfn() call s390 as the sole pdev->no_vf_scan user thus ends up missing these sysfs links which are required for example by QEMU/libvirt. Instead of duplicating the code refactor pci_iov_add_virtfn() to make sysfs link creation callable separately.

Niklas Schnelle committed 6 years ago

Commit a1ceea61 parent c70d82e2 files · +33 −11Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/pci.h+8−0
@@ -2048,6 +2048,8 @@ int pci_iov_virtfn_devfn(struct pci_dev *dev, int id); · 2047 unmodified lines
20482048
20492049 int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
20502050 void pci_disable_sriov(struct pci_dev *dev);
2051+
2052+int pci_iov_sysfs_link(struct pci_dev *dev, struct pci_dev *virtfn, int id);
20512053 int pci_iov_add_virtfn(struct pci_dev *dev, int id);
20522054 void pci_iov_remove_virtfn(struct pci_dev *dev, int id);
20532055 int pci_num_vf(struct pci_dev *dev);
@@ -2073,6 +2075,12 @@ static inline int pci_iov_virtfn_devfn(struct pci_dev *dev, int id) · 19 unmodified lines
20732075 }
20742076 static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
20752077 { return -ENODEV; }
2078+
2079+static inline int pci_iov_sysfs_link(struct pci_dev *dev,
2080+ struct pci_dev *virtfn, int id)
2081+{
2082+ return -ENODEV;
2083+}
20762084 static inline int pci_iov_add_virtfn(struct pci_dev *dev, int id)
20772085 {
20782086 return -ENOSYS;