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-devel

[Xen-devel] [PATCH] Dom0 PCI: fix SR-IOV function dependency link proble

To: keir.fraser@xxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Dom0 PCI: fix SR-IOV function dependency link problem
From: Yu Zhao <yu.zhao@xxxxxxxxx>
Date: Wed, 03 Jun 2009 13:41:34 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 02 Jun 2009 22:44:38 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.21 (X11/20090409)
PCIe Root Complex Integrated Endpoint does not implement ARI, so this
kind of endpoint uses 3-bit function number. The function dependency
link of the integrated endpoint should be calculated using the device
number field in conjunction with the value from function dependency
link register.

Normal SR-IOV endpoint always implements ARI and the function dependency
link register contains 8-bit function number (i.e. `devfn' from software
perspective).

Signed-off-by: Yu Zhao <yu.zhao@xxxxxxxxx>
# HG changeset patch
# User Yu Zhao <yu.zhao@xxxxxxxxx>
# Date 1244007161 -28800
# Node ID 3a959a6975152b741389d2eed1823d55be4f2889
# Parent  ec3442c2ed48eb11fcacd3fe31af48932f0a6645
PCI: fix SR-IOV function dependency link problem

PCIe Root Complex Integrated Endpoint does not implement ARI, so this
kind of endpoint uses 3-bit function number. The function dependency
link of the integrated endpoint should be calculated using the device
number field in conjunction with the value from function dependency
link register.

Normal SR-IOV endpoint always implements ARI and the function dependency
link register contains 8-bit function number (i.e. `devfn' from software
perspective).

Signed-off-by: Yu Zhao <yu.zhao@xxxxxxxxx>

diff -r ec3442c2ed48 -r 3a959a697515 drivers/pci/iov.c
--- a/drivers/pci/iov.c Wed Jun 03 13:30:08 2009 +0800
+++ b/drivers/pci/iov.c Wed Jun 03 13:32:41 2009 +0800
@@ -366,6 +366,8 @@
        iov->self = dev;
        pci_read_config_dword(dev, pos + PCI_SRIOV_CAP, &iov->cap);
        pci_read_config_byte(dev, pos + PCI_SRIOV_FUNC_LINK, &iov->link);
+       if (!dev->bus->number)  /* Root Complex Integrated Endpoint */
+               iov->link = PCI_DEVFN(PCI_SLOT(dev->devfn), iov->link);
 
        if (pdev)
                iov->dev = pci_dev_get(pdev);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>