[PATCH RFC 09/25] PCI/LUO: Save SR-IOV number of VF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



During the PCI prepare callback, save the SR-IOV number if the device
is a physical function.

Signed-off-by: Chris Li <chrisl@xxxxxxxxxx>
---
 drivers/pci/liveupdate.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/liveupdate.c b/drivers/pci/liveupdate.c
index 189827c6111b2c00ebb24404a205cde3f75d33c3..09faba99e9218b443f66060db5142208e22c7dd5 100644
--- a/drivers/pci/liveupdate.c
+++ b/drivers/pci/liveupdate.c
@@ -21,6 +21,7 @@ static LIST_HEAD(probe_devices);
 struct pci_dev_ser {
 	u32	path;		/* domain + bus + slot + fn */
 	u8	requested;
+	u16	num_vfs;
 	char	driver_name[63];
 	u64	driver_data;	/* driver data */
 };
@@ -153,6 +154,8 @@ static int pci_save_device_state(struct device *dev, struct pci_dev_ser *s)
 	strscpy(s->driver_name, name, sizeof(s->driver_name));
 	s->path = pci_get_device_path(pdev);
 	s->requested = dev->lu.requested;
+	if (pdev->sriov && pdev->is_physfn)
+		s->num_vfs = pdev->sriov->num_VFs;
 	return 0;
 }
 
@@ -381,9 +384,9 @@ static void pci_dev_do_restore(struct pci_dev *dev, struct pci_dev_ser *s)
 		dev->dev.lu.requested = 1;
 	else
 		dev->dev.lu.depended = 1;
-	pci_info(dev, "liveupdate restore [%s] driver: %s data: [%llx]\n",
+	pci_info(dev, "liveupdate restore [%s] driver: %s data: [%llx] num_vfs: %d\n",
 		 s->requested ? "requested" : "depended",
-		 s->driver_name, s->driver_data);
+		 s->driver_name, s->driver_data, s->num_vfs);
 	list_move_tail(&dev->dev.lu.lu_next, &probe_devices);
 }
 

-- 
2.50.1.487.gc89ff58d15-goog





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux