WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xend: pass-through: use identity-mapping

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: pass-through: use identity-mapping of PCI functions
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Jul 2009 06:10:24 -0700
Delivery-date: Wed, 22 Jul 2009 06:19:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1248267926 -3600
# Node ID 091036b8dbb9420a1bb0aaf2dc793c268371b0e9
# Parent  4fc621f62ed13c83ffa7ade12d4c3a8c56b8d34e
xend: pass-through: use identity-mapping of PCI functions

This reverses changeset "xend: pass-through: Implement least-mapping
of virtual" (19854:22067ba1de0d) and reverts the code to identity
mapping physical PCI functions to virtual ones when multi-function
virtual devices are in use. It is my opinion that this is both safer
and simpler than least-mapping, and that in the absence of further
analysis identity-mapping the best choice for now.

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>
---
 tools/python/xen/util/pci.py |    9 +++++++--
 tools/python/xen/xm/main.py  |   14 +++-----------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff -r 4fc621f62ed1 -r 091036b8dbb9 tools/python/xen/util/pci.py
--- a/tools/python/xen/util/pci.py      Wed Jul 22 14:04:14 2009 +0100
+++ b/tools/python/xen/util/pci.py      Wed Jul 22 14:05:26 2009 +0100
@@ -287,13 +287,19 @@ def parse_pci_name_extended(pci_dev_str)
     # Virtual slot assignment takes place here if specified in the bdf,
     # else it is done inside qemu-xen, as it knows which slots are free
     pci = []
-    vfunc = 0;
     func_list = pci_func_list_process(pci_dev_str, template,
                                       pci_dev_info['func'])
     for func in func_list:
         pci_dev = template.copy()
         pci_dev['func'] = "0x%x" % func
 
+        if len(func_list) == 1:
+            # For single-function devices vfunc must be 0
+            vfunc = 0
+        else:
+            # For multi-function virtual devices,
+            # identity map the func to vfunc
+            vfunc = func
         if pci_dev_info['vdevfn'] == '':
             vdevfn = AUTO_PHP_SLOT | vfunc
         else:
@@ -301,7 +307,6 @@ def parse_pci_name_extended(pci_dev_str)
         pci_dev['vdevfn'] = "0x%02x" % vdevfn
 
         pci.append(pci_dev)
-        vfunc += 1
 
     # For pci attachment and detachment is it important that virtual
     # function 0 is done last. This is because is virtual function 0 that
diff -r 4fc621f62ed1 -r 091036b8dbb9 tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Wed Jul 22 14:04:14 2009 +0100
+++ b/tools/python/xen/xm/main.py       Wed Jul 22 14:05:26 2009 +0100
@@ -2226,17 +2226,9 @@ def xm_pci_list(args):
     if len(devs) == 0:
         return
 
-    def f(x):
-        # The vfunc shouldn't be used for ordering if the vslot hasn't been
-        # assigned as the output looks odd beacuse the vfunc isn't reported
-        # but the (physical) function is.
-        if x['vdevfn'] & AUTO_PHP_SLOT:
-            vdevfn = AUTO_PHP_SLOT
-        else:
-            vdevfn = x['vdevfn']
-        return (vdevfn << 32) | \
-                   PCI_BDF(x['domain'], x['bus'], x['slot'], x['func'])
-    devs.sort(None, f)
+    devs.sort(None,
+              lambda x: (x['vdevfn'] - PCI_FUNC(x['vdevfn'])) << 32 |
+                         PCI_BDF(x['domain'], x['bus'], x['slot'], x['func']))
 
     has_vdevfn = False
     for x in devs:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: pass-through: use identity-mapping of PCI functions, Xen patchbot-unstable <=