# HG changeset patch # User Yu Zhao # Date 1237455233 14400 # Node ID ca4f6ffcde880d3f1e187cfd99fd427b334e325f # Parent 1e79dfa07877236ce5abcc61b916c8b5a67cb2c3 Xen: documentation for VT-d/SR-IOV Add a section about how to use the SR-IOV device with VT-d. Signed-off-by: Yu Zhao diff -r 1e79dfa07877 -r ca4f6ffcde88 docs/misc/vtd.txt --- a/docs/misc/vtd.txt Thu Mar 19 01:39:26 2009 -0400 +++ b/docs/misc/vtd.txt Thu Mar 19 05:33:53 2009 -0400 @@ -26,7 +26,18 @@ module /boot/vmlinuz-2.6.18.8-xen root=LABEL=/ ro xencons=ttyS console=tty0 console=ttyS0, pciback.hide=(01:00.0)(03:00.0) module /boot/initrd-2.6.18-xen.img -12) reboot system + or use dynamic hiding via PCI backend sysfs interface: + a) check if the driver has binded to the device + ls -l /sys/bus/pci/devices/0000:01:00.0/driver + ... /sys/bus/pci/devices/0000:01:00.0/driver -> ../../../../bus/pci/drivers/igb + b) if yes, then unload the driver first + echo -n 0000:01:00.0 >/sys/bus/pci/drivers/igb/unbind + c) add the device to the PCI backend + echo -n 0000:01:00.0 >/sys/bus/pci/drivers/pciback/new_slot + d) let the PCI backend bind to the device + echo -n 0000:01:00.0 >/sys/bus/pci/drivers/pciback/bind + +12) reboot system (not requires if you use the dynamic hiding method) 13) add "pci" line in /etc/xen/hvm.conf for to assigned devices pci = [ '01:00.0', '03:00.0' ] 15) start hvm guest and use "lspci" to see the passthru device and @@ -160,3 +171,82 @@ buffer specified by driver. Such devices assigned to HVM domain currently do not work. + + +Using SR-IOV with VT-d +-------------------------------- + +The Single Root I/O Virtualization is a PCI Express feature supported by +some devices such as Intel 82576 which allows you to create virtual PCI +devices (Virtual Function) and assign them to the HVM guest. + +You can use latest lspci (v3.1 and above) to check if your PCIe device +supports the SR-IOV capability or not. + + $ lspci -s 01:00.0 -vvv + + 01:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) + Subsystem: Intel Corporation Gigabit ET Dual Port Server Adapter + + ... + + Capabilities: [160] Single Root I/O Virtualization (SR-IOV) + IOVCap: Migration-, Interrupt Message Number: 000 + IOVCtl: Enable+ Migration- Interrupt- MSE+ ARIHierarchy+ + IOVSta: Migration- + Initial VFs: 8, Total VFs: 8, Number of VFs: 7, Function Dependency Link: 00 + VF offset: 128, stride: 2, Device ID: 10ca + Supported Page Size: 00000553, System Page Size: 00000001 + VF Migration: offset: 00000000, BIR: 0 + Kernel driver in use: igb + + +The function that has the SR-IOV capability is also known as Physical +Function. You need the Physical Function driver (runs in the Dom0 and +controls the physical resources allocation) to enable the Virtual Function. +Following is the Virtual Functions associated with above Physical Function. + + $ lspci | grep -e 01:1[01].[0246] + + 01:10.0 Ethernet controller: Intel Corporation Device 10ca (rev 01) + 01:10.2 Ethernet controller: Intel Corporation Device 10ca (rev 01) + 01:10.4 Ethernet controller: Intel Corporation Device 10ca (rev 01) + 01:10.6 Ethernet controller: Intel Corporation Device 10ca (rev 01) + 01:11.0 Ethernet controller: Intel Corporation Device 10ca (rev 01) + 01:11.2 Ethernet controller: Intel Corporation Device 10ca (rev 01) + 01:11.4 Ethernet controller: Intel Corporation Device 10ca (rev 01) + +We can tell that Physical Function 01:00.0 has 7 Virtual Functions (01:10.0, +01:10.2, 01:10.4, 01:10.6, 01:11.0, 01:11.2, 01:11.4). And the Virtual +Function PCI Configuration Space looks just like normal PCI device. + + $ lspci -s 01:10.0 -vvv + + 01:10.0 Ethernet controller: Intel Corporation 82576 Gigabit Virtual Function + Subsystem: Intel Corporation Gigabit Virtual Function + Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- + Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR-