Hide Forgot
+++ This bug was initially created as a clone of Bug #1004629 +++ Description of problem: libvirt should forbid to define or start 'hostdev' network which contains PF pci addresses.It is failed to assigned VF to guest when the first pci nic device of hostdev network is PF. Version-Release number of selected component (if applicable): libvirt-0.10.2-23.el6.x86_64 How reproducible: 100% Steps to Reproduce: # lspci|grep 82576 0e:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) <==== PF address 0e:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 0f:10.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:10.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:10.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:10.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:10.4 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:10.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:10.6 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:10.7 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:11.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:11.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:11.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:11.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:11.4 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 0f:11.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 10:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 10:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01) 11:10.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) <==== VF address 11:10.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 11:10.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 11:10.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 11:10.4 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 11:10.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 11:10.6 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 11:10.7 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 11:11.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 11:11.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 11:11.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 11:11.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 11:11.4 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) 11:11.5 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01) # virsh net-dumpxml hostnet <network> <name>hostnet</name> <uuid>6b49be3c-bb91-c16d-b475-2929678720f4</uuid> <forward mode='hostdev' managed='yes'> <address type='pci' domain='0x0000' bus='0x0e' slot='0x00' function='0x0'/> <==== PF address <address type='pci' domain='0x0000' bus='0x11' slot='0x10' function='0x0'/> <==== VF address </forward> </network> # virsh attach-device r6 vfpool.xml error: Failed to attach device from vfpool.xml error: unsupported configuration: Interface type hostdev is currently supported on SR-IOV Virtual Functions only # virsh attach-device r6 vfpool.xml error: Failed to attach device from vfpool.xml error: unsupported configuration: Interface type hostdev is currently supported on SR-IOV Virtual Functions only Actual results: It is failed to assigned VF to guest when the first pci nic device of hostdev network is PF. Expected results: libvirt should forbid to define or start 'hostdev' network which contains PF pci addresses Additional info: --- Additional comment from RHEL Product and Program Management on 2013-09-05 01:52:40 EDT --- Since this bug report was entered in bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
This patch handles the bad config detailed here, as well as several other cases: https://www.redhat.com/archives/libvir-list/2017-March/msg01235.html
*** Bug 1311464 has been marked as a duplicate of this bug. ***
Fix pushed upstream: commit 5c8d622f5d7fefd43e31a7aa6bdc4fe07d26bf73 Author: Laine Stump <laine> Date: Sat Mar 25 14:00:13 2017 -0400 network: better validation of devices in hostdev network pool
# lspci | grep 82599 86:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01) 86:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01) 86:10.0 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01) 86:10.1 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01) 86:10.2 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01) (1)Check the"devices must be listed by PCI address, not by netdev name" # cat hostnet.xml <network> <name>hostnet</name> <uuid>6b49be3c-bb91-c16d-b475-2929678720f4</uuid> <forward mode='hostdev' managed='yes'> <pf dev='ens2f1'/> </forward> </network> # virsh net-define hostnet.xml Network hostnet defined from hostnet.xml # virsh net-dumpxml hostnet <network> <name>hostnet</name> <uuid>6b49be3c-bb91-c16d-b475-2929678720f4</uuid> <forward mode='hostdev' managed='yes'> <pf dev='ens2f1'/> </forward> </network> # virsh net-start hostnet Network hostnet started # virsh net-list --all Name State Autostart Persistent ---------------------------------------------------------- hostnet active no yes # virsh net-dumpxml hostnet <network> <name>hostnet</name> <uuid>6b49be3c-bb91-c16d-b475-2929678720f4</uuid> <forward mode='hostdev' managed='yes'> <pf dev='ens2f1'/> <address type='pci' domain='0x0000' bus='0x86' slot='0x10' function='0x1'/> <address type='pci' domain='0x0000' bus='0x86' slot='0x10' function='0x3'/> <address type='pci' domain='0x0000' bus='0x86' slot='0x10' function='0x5'/> <address type='pci' domain='0x0000' bus='0x86' slot='0x10' function='0x7'/> </forward> </network> # virsh net-destroy hostnet Network hostnet destroyed # virsh net-dumpxml hostnet <network> <name>hostnet</name> <uuid>6b49be3c-bb91-c16d-b475-2929678720f4</uuid> <forward mode='hostdev' managed='yes'> <pf dev='ens2f1'/> </forward> </network> (2) Check "listing a device by PCI address is valid only for hostdev networks, not for other types of network (e.g. macvtap passthrough)." # cat macvtap.xml <network> <name>macvtap</name> <uuid>a53c4f33-58ea-4b2e-80b4-f9d103b7b0a3</uuid> <forward dev='ens2f1' mode='passthrough'> <interface dev='ens2f1'/> </forward> </network> # virsh net-define macvtap.xml Network macvtap defined from macvtap.xml # virsh net-dumpxml macvtap <network> <name>macvtap</name> <uuid>a53c4f33-58ea-4b2e-80b4-f9d103b7b0a3</uuid> <forward dev='ens2f1' mode='passthrough'> <interface dev='ens2f1'/> </forward> </network> # virsh net-start macvtap Network macvtap started # virsh net-dumpxml macvtap <network> <name>macvtap</name> <uuid>a53c4f33-58ea-4b2e-80b4-f9d103b7b0a3</uuid> <forward dev='ens2f1' mode='passthrough'> <interface dev='ens2f1'/> </forward> </network> # virsh net-destroy macvtap Network macvtap destroyed (3)Check "each device in a hostdev pool must be an SR-IOV VF " # cat hostnet.xml <network> <name>hostnet</name> <uuid>6b49be3c-bb91-c16d-b475-2929678720f4</uuid> <forward mode='hostdev' managed='yes'> <address type='pci' domain='0x0000' bus='0x86' slot='0x00' function='0x1'/> </forward> </network> # virsh net-list --all Name State Autostart Persistent ---------------------------------------------------------- # virsh net-define hostnet.xml error: Failed to define network from hostnet.xml error: unsupported configuration: device '/sys/bus/pci/devices/0000:86:00.1' in network 'hostnet' is not an SR-IOV Virtual Function According to the testing above, change the status to verified
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2017:1846