Skip to contentSkip to conversation

PCI: sync up the SR-IOV changes between Dom0 and upstream kernels

PATCH New Yu Zhao 1 participant 1 message Apr 3, 2009 PCI

lore
Share & tools
lore

Yu Zhao

author
#0 lore raw

PATCH 1/1 PCI: sync up the SR-IOV changes between Dom0 and upstream kernels

The SR-IOV patches for the upstream kernel are finally in-tree. This patch backports some minor changes that appeared in the upstream kernel after the Dom0 patches were checked-in.

drivers/pci/Kconfig +4 -4
diff -r 67a7ffcc5067 -r 0e265f73b23a drivers/pci/Kconfig
@@ -41,8 +41,8 @@
 	bool "PCI IOV support"
 	depends on PCI
 	help
-	  PCI-SIG I/O Virtualization (IOV) Specifications support.
-	  Single Root IOV: allows the creation of virtual PCI devices
-	  that share the physical resources from a real device.
+	  I/O Virtualization is a PCI feature supported by some devices
+	  which allows them to create virtual devices which share their
+	  physical resources.
 
-	  When in doubt, say N.
+	  If unsure, say N.
drivers/pci/iov.c +6 -5
diff -r 67a7ffcc5067 -r 0e265f73b23a drivers/pci/iov.c
@@ -309,16 +309,16 @@
 	if (!total)
 		return 0;
 
+	ctrl = 0;
 	list_for_each_entry(pdev, &dev->bus->devices, bus_list)
 		if (pdev->is_physfn)
-			break;
-	if (list_empty(&dev->bus->devices) || !pdev->is_physfn)
-		pdev = NULL;
+			goto found;
 
-	ctrl = 0;
-	if (!pdev && pci_ari_enabled(dev->bus))
+	pdev = NULL;
+	if (pci_ari_enabled(dev->bus))
 		ctrl |= PCI_SRIOV_CTRL_ARI;
 
+found:
 	pci_write_config_word(dev, pos + PCI_SRIOV_CTRL, ctrl);
 	pci_write_config_word(dev, pos + PCI_SRIOV_NUM_VF, total);
 	pci_read_config_word(dev, pos + PCI_SRIOV_VF_OFFSET, &offset);
@@ -507,6 +507,7 @@
 /**
  * pci_enable_sriov - enable the SR-IOV capability
  * @dev: the PCI device
+ * @nr_virtfn: number of Virtual Functions to enable
  *
  * Returns 0 on success, or negative on failure.
  */
drivers/pci/quirks.c +27 -36

85 lines not on this page · raw message

# HG changeset patch
# User Yu Zhao <[email protected]>
# Date 1238744927 14400
# Node ID 0e265f73b23aa3ea25620bec931697ead6221d98
# Parent 67a7ffcc50679d134e6079c738c63049d6314add
PCI: sync up the SR-IOV changes between Dom0 and upstream kernel

The SR-IOV patches for the upstream kernel are finally in-tree. This patch backports some minor changes that appeared in the upstream kernel after the Dom0 patches were checked-in.

drivers/pci/Kconfig +4 -4
diff -r 67a7ffcc5067 -r 0e265f73b23a drivers/pci/Kconfig
@@ -41,8 +41,8 @@
 	bool "PCI IOV support"
 	depends on PCI
 	help
-	  PCI-SIG I/O Virtualization (IOV) Specifications support.
-	  Single Root IOV: allows the creation of virtual PCI devices
-	  that share the physical resources from a real device.
+	  I/O Virtualization is a PCI feature supported by some devices
+	  which allows them to create virtual devices which share their
+	  physical resources.
 
-	  When in doubt, say N.
+	  If unsure, say N.
drivers/pci/iov.c +6 -5
diff -r 67a7ffcc5067 -r 0e265f73b23a drivers/pci/iov.c
@@ -309,16 +309,16 @@
 	if (!total)
 		return 0;
 
+	ctrl = 0;
 	list_for_each_entry(pdev, &dev->bus->devices, bus_list)
 		if (pdev->is_physfn)
-			break;
-	if (list_empty(&dev->bus->devices) || !pdev->is_physfn)
-		pdev = NULL;
+			goto found;
 
-	ctrl = 0;
-	if (!pdev && pci_ari_enabled(dev->bus))
+	pdev = NULL;
+	if (pci_ari_enabled(dev->bus))
 		ctrl |= PCI_SRIOV_CTRL_ARI;
 
+found:
 	pci_write_config_word(dev, pos + PCI_SRIOV_CTRL, ctrl);
 	pci_write_config_word(dev, pos + PCI_SRIOV_NUM_VF, total);
 	pci_read_config_word(dev, pos + PCI_SRIOV_VF_OFFSET, &offset);
@@ -507,6 +507,7 @@
 /**
  * pci_enable_sriov - enable the SR-IOV capability
  * @dev: the PCI device
+ * @nr_virtfn: number of Virtual Functions to enable
  *
  * Returns 0 on success, or negative on failure.
  */
drivers/pci/quirks.c +27 -36

85 lines not on this page · raw message

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel