RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1004676 - libvirt should forbid to define or start 'hostdev' network which contains PF pci addresses
Summary: libvirt should forbid to define or start 'hostdev' network which contains PF ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Laine Stump
QA Contact: Jingjing Shao
URL:
Whiteboard:
: 1311464 (view as bug list)
Depends On: 1004629
Blocks: 1401400
TreeView+ depends on / blocked
 
Reported: 2013-09-05 08:08 UTC by hongming
Modified: 2017-08-02 01:25 UTC (History)
8 users (show)

Fixed In Version: libvirt-3.2.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1004629
Environment:
Last Closed: 2017-08-01 17:06:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1311464 0 unspecified CLOSED libvirt will crash when start a guest with hostdev network whose interface pool specified with a list of <interface> ele... 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Internal Links: 1311464

Description hongming 2013-09-05 08:08:05 UTC
+++ 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.

Comment 12 Laine Stump 2017-03-25 18:02:56 UTC
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

Comment 13 Laine Stump 2017-03-26 23:59:00 UTC
*** Bug 1311464 has been marked as a duplicate of this bug. ***

Comment 14 Laine Stump 2017-03-27 16:35:30 UTC
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

Comment 16 Jingjing Shao 2017-04-11 05:53:06 UTC
# 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

Comment 17 errata-xmlrpc 2017-08-01 17:06:41 UTC
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

Comment 18 errata-xmlrpc 2017-08-01 23:48:45 UTC
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

Comment 19 errata-xmlrpc 2017-08-02 01:25:04 UTC
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


Note You need to log in before you can comment on or make changes to this bug.