Bug 1331328

Summary: libvirt does not report PCI_HEADER_TYPE in node device XML
Product: Red Hat Enterprise Linux 7 Reporter: Marcel Kolaja <mkolaja>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: high    
Version: 7.2CC: berrange, bmcclain, dyuan, fjin, jdenemar, jherrman, jishao, jsuchane, michal.skrivanek, mkletzan, mkolaja, mpoledni, rbalakri, snagar, tjelinek
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.2.17-13.el7_2.5 Doc Type: Bug Fix
Doc Text:
Previously, the node device XML did not contain the PCI header type, which caused guest PCI devices to be unavailable for passthrough assignment. With this update, the libvirt service reports the PCI header type properly, and guest PCI devices can be assigned for passthrough as expected.
Story Points: ---
Clone Of: 1317531 Environment:
Last Closed: 2016-06-23 06:12:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1317531    
Bug Blocks:    

Description Marcel Kolaja 2016-04-28 10:13:14 UTC
This bug has been copied from bug #1317531 and has been proposed
to be backported to 7.2 z-stream (EUS).

Comment 7 Jiri Denemark 2016-05-20 06:42:34 UTC
Moving back to ASSIGNED based on review results.

Comment 8 Michal Privoznik 2016-05-24 05:40:47 UTC
Moving back to POST:

http://post-office.corp.redhat.com/archives/rhvirt-patches/2016-May/msg00216.html

Comment 10 Jingjing Shao 2016-05-27 07:48:11 UTC
For the XML of endpoints should not change, for bridge ,it should add the header type as the right part and the cardbus-bridge testing needs special hardware with cardbus-bridge´╝îfor now we can not get the suitable system


Verified the bug as below with libvirt-1.2.17-13.el7_2.5.x86_64

1.[root@ibm-x3850x5-05 jishao]# virsh nodedev-list --tree
  +- pci_0000_80_01_0
  |   |
  |   +- pci_0000_86_00_0
  |   |   |
  |   |   +- net_eth2_90_e2_ba_30_79_5c
  |   |     
  |   +- pci_0000_86_00_1
  |   |   |
  |   |   +- net_eth5_90_e2_ba_30_79_5d
  |   |     
  |   +- pci_0000_86_10_0
  |   |   |
  |   |   +- net_eth6_a6_59_70_2b_bb_62
  |   |     
  |   +- pci_0000_86_10_1
  |   |   |
  |   |   +- net_eth3_f2_4a_b4_81_32_9a

2. [root@ibm-x3850x5-05 jishao]#  lspci -vv
80:01.0 PCI bridge: Intel Corporation 5520/5500/X58 I/O Hub PCI Express Root Port 1 (rev 22) (prog-if 00 [Normal decode])
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR- FastB2B- DisINTx+
....
Capabilities: [90] Express (v2) Root Port (Slot+), MSI 00
......

86:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01)
.....
Capabilities: [a0] Express (v2) Endpoint, MSI 00
......

86:10.0 Ethernet controller: Intel Corporation 82599 Ethernet Controller Virtual Function (rev 01)
....
Capabilities: [a0] Express (v0) Endpoint, MSI 00
.....

3.[root@ibm-x3850x5-05 jishao]# virsh nodedev-dumpxml pci_0000_80_01_0
<device>
  <name>pci_0000_80_01_0</name>
  <path>/sys/devices/pci0000:80/0000:80:01.0</path>
  <parent>computer</parent>
  <driver>
    <name>pcieport</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>128</bus>
    <slot>1</slot>
    <function>0</function>
    <product id='0x3408'>5520/5500/X58 I/O Hub PCI Express Root Port 1</product>
    <vendor id='0x8086'>Intel Corporation</vendor>
    <iommuGroup number='19'>
      <address domain='0x0000' bus='0x80' slot='0x01' function='0x0'/>
    </iommuGroup>
    <numa node='1'/>
    <capability type='pci-bridge'/>   <===========add the pci header type
    <pci-express>
      <link validity='cap' port='1' speed='5' width='4'/>
      <link validity='sta' speed='5' width='4'/>
    </pci-express>
  </capability>
</device>

[root@ibm-x3850x5-05 jishao]# virsh nodedev-dumpxml pci_0000_86_00_0
<device>
  <name>pci_0000_86_00_0</name>
  <path>/sys/devices/pci0000:80/0000:80:01.0/0000:86:00.0</path>
  <parent>pci_0000_80_01_0</parent>
  <driver>
    <name>ixgbe</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>134</bus>
    <slot>0</slot>
    <function>0</function>
    <product id='0x10fb'>82599ES 10-Gigabit SFI/SFP+ Network Connection</product>
    <vendor id='0x8086'>Intel Corporation</vendor>
    <capability type='virt_functions'>
      <address domain='0x0000' bus='0x86' slot='0x10' function='0x0'/>
      <address domain='0x0000' bus='0x86' slot='0x10' function='0x2'/>
    </capability>
    <iommuGroup number='27'>
      <address domain='0x0000' bus='0x86' slot='0x00' function='0x0'/>
    </iommuGroup>
    <numa node='1'/>      <===========can not find the pci header type                
    <pci-express>
      <link validity='cap' port='0' speed='5' width='8'/>
      <link validity='sta' speed='5' width='4'/>
    </pci-express>
  </capability>
</device>

[root@ibm-x3850x5-05 jishao]# virsh nodedev-dumpxml pci_0000_86_10_0
<device>
  <name>pci_0000_86_10_0</name>
  <path>/sys/devices/pci0000:80/0000:80:01.0/0000:86:10.0</path>
  <parent>pci_0000_80_01_0</parent>
  <driver>
    <name>ixgbevf</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>134</bus>
    <slot>16</slot>
    <function>0</function>
    <product id='0x10ed'>82599 Ethernet Controller Virtual Function</product>
    <vendor id='0x8086'>Intel Corporation</vendor>
    <capability type='phys_function'>
      <address domain='0x0000' bus='0x86' slot='0x00' function='0x0'/>
    </capability>
    <iommuGroup number='81'>
      <address domain='0x0000' bus='0x86' slot='0x10' function='0x0'/>
    </iommuGroup>
    <numa node='1'/>       <===========can not find the pci header 
    <pci-express> 
      <link validity='cap' port='0' width='0'/>
      <link validity='sta' width='0'/>
    </pci-express>
  </capability>
</device>

Comment 12 errata-xmlrpc 2016-06-23 06:12:26 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/RHBA-2016:1290