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
2048 2048
2049int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);2049int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
2050void pci_disable_sriov(struct pci_dev *dev);2050void pci_disable_sriov(struct pci_dev *dev);
2051
2052int pci_iov_sysfs_link(struct pci_dev *dev, struct pci_dev *virtfn, int id);
2051int pci_iov_add_virtfn(struct pci_dev *dev, int id);2053int pci_iov_add_virtfn(struct pci_dev *dev, int id);
2052void pci_iov_remove_virtfn(struct pci_dev *dev, int id);2054void pci_iov_remove_virtfn(struct pci_dev *dev, int id);
2053int pci_num_vf(struct pci_dev *dev);2055int 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
2073}2075}
2074static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)2076static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
2075{ return -ENODEV; }2077{ return -ENODEV; }
2078
2079static inline int pci_iov_sysfs_link(struct pci_dev *dev,
2080 struct pci_dev *virtfn, int id)
2081{
2082 return -ENODEV;
2083}
2076static inline int pci_iov_add_virtfn(struct pci_dev *dev, int id)2084static inline int pci_iov_add_virtfn(struct pci_dev *dev, int id)
2077{2085{
2078 return -ENOSYS;2086 return -ENOSYS;