aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-08-02 12:28:22 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-08-02 12:28:22 +0100
commit18a76bf4532dff8758c2be6fe1810c730587f2da (patch)
tree3e33018ead4b1866ea0b31bc8bb2362b44d8c9a5 /tools
parent2cdf870d540bb63c625407350492987410b981e3 (diff)
downloadxen-18a76bf4532dff8758c2be6fe1810c730587f2da.tar.gz
xen-18a76bf4532dff8758c2be6fe1810c730587f2da.tar.bz2
xen-18a76bf4532dff8758c2be6fe1810c730587f2da.zip
xend: pci: Use PCIe FLR for VF of Intel 82599 10GbE Controller
We know it does have PCIe FLR capability even if it doesn't report that. Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/python/xen/util/pci.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/python/xen/util/pci.py b/tools/python/xen/util/pci.py
index 1811d94780..144f25d6aa 100644
--- a/tools/python/xen/util/pci.py
+++ b/tools/python/xen/util/pci.py
@@ -88,6 +88,11 @@ PCI_CAP_ID_VENDOR_SPECIFIC_CAP = 0x09
PCI_CLASS_ID_USB = 0x0c03
PCI_USB_FLRCTRL = 0x4
+# The VF of Intel 82599 10GbE Controller
+# See http://download.intel.com/design/network/datashts/82599_datasheet.pdf
+# For 'VF PCIe Configuration Space', see its Table 9.7.
+DEVICE_ID_82599 = 0x10ed
+
PCI_CAP_ID_AF = 0x13
PCI_AF_CAPs = 0x3
PCI_AF_CAPs_TP_FLR = 0x3
@@ -918,6 +923,17 @@ class PciDevice:
dev_cap = self.pci_conf_read32(pos + PCI_EXP_DEVCAP)
if dev_cap & PCI_EXP_DEVCAP_FLR:
self.pcie_flr = True
+ else:
+ # Quirk for the VF of Intel 82599 10GbE Controller.
+ # We know it does have PCIe FLR capability even if it doesn't
+ # report that (dev_cap.PCI_EXP_DEVCAP_FLR is 0).
+ # See the 82599 datasheet.
+ dev_path = find_sysfs_mnt()+SYSFS_PCI_DEVS_PATH+'/'+self.name
+ vendor_id = parse_hex(os.popen('cat %s/vendor' % dev_path).read())
+ device_id = parse_hex(os.popen('cat %s/device' % dev_path).read())
+ if (vendor_id == VENDOR_INTEL) and \
+ (device_id == DEVICE_ID_82599):
+ self.pcie_flr = True
elif self.dev_type == DEV_TYPE_PCI:
# Try to find the "PCI Advanced Capabilities"
pos = self.find_cap_offset(PCI_CAP_ID_AF)