PCI/IOV: update num_VFs earlier
PATCH 1/1 PCI/IOV: update num_VFs earlier
Ensure that iov->num_VFs is set before a netlink message is sent when the number of VFs is changed. Otherwise /sys/.../sriov_numvfs is not updated when read immediately after receiving the netlink message.
Signed-off-by Pierre Crégut <[email protected]>
--- drivers/pci/iov.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pci/iov.c +2 -1
@@ -351,6 +351,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn) goto err_pcibios; } + iov->num_VFs = nr_virtfn;pci_iov_set_numvfs (dev, nr_virtfn); iov->ctrl |=PCI_SRIOV_CTRL_VFE |PCI_SRIOV_CTRL_MSE ;pci_cfg_access_lock (dev);
@@ -363,7 +364,6 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn) goto err_pcibios;kobject_uevent (&dev->dev.kobj,KOBJ_CHANGE ); - iov->num_VFs = nr_virtfn;return 0 ;
@@ -379,6 +379,7 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)if (iov->link != dev->devfn)sysfs_remove_link (&dev->dev.kobj,"dep_link" ); + iov->num_VFs =0 ;pci_iov_set_numvfs (dev,0 );return rc; }
Signature · 1 line
2.17.1