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

[Xen-changelog] [linux-2.6.18-xen] PV passthru: assign SR-IOV virtual functions to separate virtual slots


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-linux-2.6.18-xen <patchbot@xxxxxxx>
  • Date: Fri, 19 Oct 2012 16:00:07 +0000
  • Delivery-date: Fri, 19 Oct 2012 16:00:17 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Laszlo Ersek <lersek@xxxxxxxxxx>
# Date 1350661572 -7200
# Node ID 0dbf07f0bdbfea42ba2f43a7e4786394ece74515
# Parent  bd485861bc4206d51400333919787d7f6a79aa3c
PV passthru: assign SR-IOV virtual functions to separate virtual slots

VFs are reported as single-function devices in PCI_HEADER_TYPE, which
causes pci_scan_slot() in the PV domU to skip all VFs beyond #0 in the
pciback-provided slot. Avoid this by assigning each VF to a separate
virtual slot.

Signed-off-by: Laszlo Ersek <lersek@xxxxxxxxxx>
Committed-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r bd485861bc42 -r 0dbf07f0bdbf drivers/xen/pciback/vpci.c
--- a/drivers/xen/pciback/vpci.c        Fri Oct 19 11:36:42 2012 +0200
+++ b/drivers/xen/pciback/vpci.c        Fri Oct 19 17:46:12 2012 +0200
@@ -89,9 +89,15 @@ int pciback_add_pci_dev(struct pciback_d
 
        spin_lock_irqsave(&vpci_dev->lock, flags);
 
-       /* Keep multi-function devices together on the virtual PCI bus */
-       for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
-               if (!list_empty(&vpci_dev->dev_list[slot])) {
+       /*
+        * Keep multi-function devices together on the virtual PCI bus, except
+        * virtual functions.
+        */
+       if (!dev->is_virtfn) {
+               for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
+                       if (list_empty(&vpci_dev->dev_list[slot]))
+                               continue;
+
                        t = list_entry(list_first(&vpci_dev->dev_list[slot]),
                                       struct pci_dev_entry, list);
 
@@ -116,7 +122,7 @@ int pciback_add_pci_dev(struct pciback_d
                               pci_name(dev), slot);
                        list_add_tail(&dev_entry->list,
                                      &vpci_dev->dev_list[slot]);
-                       func = PCI_FUNC(dev->devfn);
+                       func = dev->is_virtfn ? 0 : PCI_FUNC(dev->devfn);
                        goto unlock;
                }
        }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.