Bug 1455017

Summary: LnkCap speed='(null)' in the nodedev-dumpxml of wireless NIC
Product: Red Hat Enterprise Linux 7 Reporter: Jingjing Shao <jishao>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED ERRATA QA Contact: Jingjing Shao <jishao>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 7.4CC: dyuan, hannsj_uhl, laine, lhuang, mzhan, rbalakri, xuzhang, yalzhang
Target Milestone: rcKeywords: Patch, Regression
Target Release: 7.4   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-3.2.0-7.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-02 01:34:35 UTC Type: Bug
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:    
Bug Blocks: 1442831    

Description Jingjing Shao 2017-05-24 03:44:36 UTC
Description of problem:
LnkCap speed='(null)'  in the nodedev-dumpxml of wireless NIC 

Version-Release number of selected component (if applicable):
libvirt-3.2.0-5.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. # virsh nodedev-list --tree
computer
  +- pci_0000_00_1c_1
  |   |
  |   +- pci_0000_04_00_0
  |       |
  |       +- net_wlp4s0_5a_86_10_8c_c7_2c

2.# lspci 

04:00.0 Network controller: Intel Corporation Wireless 7265 (rev 99)
......

Capabilities: [40] Express (v2) Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <512ns, L1 unlimited
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset+ SlotPowerLimit 0.000W
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr+ NoSnoop+ FLReset-
                        MaxPayload 128 bytes, MaxReadReq 128 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
                LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L1, Exit Latency L0s <4us, L1 <32us
                        ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
                LnkCtl: ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk+
                        ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
                DevCap2: Completion Timeout: Range B, TimeoutDis+, LTR+, OBFF Via WAKE#
                DevCtl2: Completion Timeout: 16ms to 55ms, TimeoutDis-, LTR+, OBFF Disabled
                LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
                         Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
                         Compliance De-emphasis: -6dB
                LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete-, EqualizationPhase1-
                         EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
.....

3.# virsh nodedev-dumpxml pci_0000_04_00_0                                                                                        
 <device>
  <name>pci_0000_04_00_0</name>
   <path>/sys/devices/pci0000:00/0000:00:1c.1/0000:04:00.0</path>
    <parent>pci_0000_00_1c_1</parent>
    <driver>
    <name>iwlwifi</name>
    </driver>
    <capability type='pci'>
     <domain>0</domain>
     <bus>4</bus>
     <slot>0</slot>
     <function>0</function>
     <product id='0x095b'>Wireless 7265</product>
     <vendor id='0x8086'>Intel Corporation</vendor>
     <pci-express>
     <link validity='cap' port='0' speed='(null)' width='1'/>  
     <link validity='sta' speed='2.5' width='1'/>
     </pci-express>
  </capability>
</device>

4.  # virsh nodedev-detach pci_0000_04_00_0
error: Failed to detach device pci_0000_04_00_0
error: malformed 'speed' attribute: (null)


Actual results:
speed='(null)' and make the detachment failed

Expected results:
speed='2.5' and device can be detached successfully

Additional info:
Try on the 7.3 version libvirt-2.0.0-10, it is all right . the speed='2.5' and device can be detached successfully

Comment 3 Laine Stump 2017-05-24 16:52:00 UTC
I expected something like this would happen when I saw the patch below pushed upstream:

commit 1128769f9ee50bb250333a5a5d276afbe74711ea
Author: Marek Marczykowski-Górecki <marmarek>
Date:   Tue May 16 15:19:19 2017 +0200

    pci: fix link maximum speed detection
    
    Commit 8e09663 "pci: recognize/report GEN4 (PCIe 4.0) card 16GT/s Link
    speed" introduced another speed into enum, but mistakenly also altered
    field width, so one bit of link width was included there.
    

So it's fixed upstream already. I'll backport that to the RHEL build momentarily.

Comment 6 Jingjing Shao 2017-06-01 06:11:03 UTC
Verify this bug as below.

# rpm -q libvirt
libvirt-3.2.0-7.el7.x86_64

1. # virsh nodedev-list --tree
computer
  +- pci_0000_00_1c_1
  |   |
  |   +- pci_0000_04_00_0
  |       |
  |       +- net_wlp4s0_5a_86_10_8c_c7_2c

2. # virsh nodedev-dumpxml pci_0000_04_00_0
<device>
  <name>pci_0000_04_00_0</name>
  <path>/sys/devices/pci0000:00/0000:00:1c.1/0000:04:00.0</path>
  <parent>pci_0000_00_1c_1</parent>
  <driver>
    <name>iwlwifi</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>4</bus>
    <slot>0</slot>
    <function>0</function>
    <product id='0x095b'>Wireless 7265</product>
    <vendor id='0x8086'>Intel Corporation</vendor>
    <iommuGroup number='11'>
      <address domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </iommuGroup>
    <pci-express>
      <link validity='cap' port='0' speed='2.5' width='1'/>
      <link validity='sta' speed='2.5' width='1'/>
    </pci-express>
  </capability>
</device>

3. # virsh nodedev-detach pci_0000_04_00_0
 Device pci_0000_04_00_0 detached

4. # virsh nodedev-reattach pci_0000_04_00_0
Device pci_0000_04_00_0 re-attached

Comment 7 errata-xmlrpc 2017-08-02 01:34:35 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