Bug 782161

Summary: pci-assign: Fix multifunction support
Product: Red Hat Enterprise Linux 6 Reporter: Alex Williamson <alex.williamson>
Component: qemu-kvmAssignee: Alex Williamson <alex.williamson>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: acathrow, bsarathy, chayang, juzhang, minovotn, mkenneth, qzhang, rhod, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.227.el6 Doc Type: Bug Fix
Doc Text:
No Documentation Needed
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 11:38:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Alex Williamson 2012-01-16 17:18:11 UTC
Description of problem:
Multifunction support doesn't work properly with assigned devices.  The device assignment code overwrites the PCI HEADER_TYPE field with the hardware values after the multifunction=on value has been applied.  Thus multifunction=on only works when the physical devices is also a multifunction device, such is the case with may physical function assigned test cases.  When a non-multifunction devices is assigned as function zero, such as a virtual function, the multifunction bit is cleared and functions >0 are not tested by the guest.


Version-Release number of selected component (if applicable):
6.2


How reproducible:
100%

Steps to Reproduce:
1. Assign a device with HEADER_TYPE bit 7 = 0 with multifunction=on
2.
3.
  
Actual results:
HEADER_TYPE shows the physical device value

Expected results:
multifunction=on/off should toggle the guest view of multifunction

Additional info:
Patch posted upstream

Comment 3 Chao Yang 2012-02-15 13:48:51 UTC
Steps:
1. boot a guest with some VFs attached with multifunction turned on.
...
 -device pci-assign,host=03:10.0,multifunction=on,addr=9.0 -device pci-assign,host=03:10.1,addr=9.1 -device pci-assign,host=03:10.2,addr=9.2 -device pci-assign,host=03:10.3,addr=9.3
2. lspci in guest

Actual Results:

Reproduced with qemu-kvm-0.12.1.2-2.225.el6.x86_64.rpm:
# lspci | grep Eth
00:04.0 Ethernet controller: Red Hat, Inc Virtio network device
00:09.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
And dmesg | grep  said no more function was found except 00:09.0
# dmesg | grep 00:09
pci 0000:00:09.0: reg 10 32bit mmio: [0xf4040000-0xf4043fff]
pci 0000:00:09.0: reg 1c 32bit mmio: [0xf4044000-0xf4047fff]
igbvf 0000:00:09.0: setting latency timer to 64
igbvf 0000:00:09.0: irq 26 for MSI/MSI-X
igbvf 0000:00:09.0: irq 27 for MSI/MSI-X
igbvf 0000:00:09.0: irq 28 for MSI/MSI-X
igbvf 0000:00:09.0: Intel(R) 82576 Virtual Function
igbvf 0000:00:09.0: Address: 82:f0:53:d5:3b:64
igbvf 0000:00:09.0: MAC: 1
igbvf 0000:00:09.0: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.0: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.0: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.0: Link is Up 1000 Mbps Full Duplex

------------------------------------------

Verified with qemu-kvm-0.12.1.2-2.229.el6.x86_64.rpm:
# lspci | grep Eth
00:04.0 Ethernet controller: Red Hat, Inc Virtio network device
00:09.0 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
00:09.1 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
00:09.2 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)
00:09.3 Ethernet controller: Intel Corporation 82576 Virtual Function (rev 01)

All functions succeeded to acquire IPs.
And dmesg | grep  said all functions were found:
# dmesg | grep 00:09
pci 0000:00:09.0: reg 10 32bit mmio: [0xf4040000-0xf4043fff]
pci 0000:00:09.0: reg 1c 32bit mmio: [0xf4044000-0xf4047fff]
pci 0000:00:09.1: reg 10 32bit mmio: [0xf4048000-0xf404bfff]
pci 0000:00:09.1: reg 1c 32bit mmio: [0xf404c000-0xf404ffff]
pci 0000:00:09.2: reg 10 32bit mmio: [0xf4050000-0xf4053fff]
pci 0000:00:09.2: reg 1c 32bit mmio: [0xf4054000-0xf4057fff]
pci 0000:00:09.3: reg 10 32bit mmio: [0xf4058000-0xf405bfff]
pci 0000:00:09.3: reg 1c 32bit mmio: [0xf405c000-0xf405ffff]
igbvf 0000:00:09.0: setting latency timer to 64
igbvf 0000:00:09.0: irq 26 for MSI/MSI-X
igbvf 0000:00:09.0: irq 27 for MSI/MSI-X
igbvf 0000:00:09.0: irq 28 for MSI/MSI-X
igbvf 0000:00:09.0: Intel(R) 82576 Virtual Function
igbvf 0000:00:09.0: Address: 82:20:5a:8b:ca:80
igbvf 0000:00:09.0: MAC: 1
igbvf 0000:00:09.1: setting latency timer to 64
igbvf 0000:00:09.1: irq 29 for MSI/MSI-X
igbvf 0000:00:09.1: irq 30 for MSI/MSI-X
igbvf 0000:00:09.1: irq 31 for MSI/MSI-X
igbvf 0000:00:09.1: Intel(R) 82576 Virtual Function
igbvf 0000:00:09.1: Address: f2:3d:ff:0c:bb:a7
igbvf 0000:00:09.1: MAC: 1
igbvf 0000:00:09.2: setting latency timer to 64
igbvf 0000:00:09.2: irq 32 for MSI/MSI-X
igbvf 0000:00:09.2: irq 33 for MSI/MSI-X
igbvf 0000:00:09.2: irq 34 for MSI/MSI-X
igbvf 0000:00:09.2: Intel(R) 82576 Virtual Function
igbvf 0000:00:09.2: Address: 3e:51:ea:6c:af:af
igbvf 0000:00:09.2: MAC: 1
igbvf 0000:00:09.3: setting latency timer to 64
igbvf 0000:00:09.3: irq 35 for MSI/MSI-X
igbvf 0000:00:09.3: irq 36 for MSI/MSI-X
igbvf 0000:00:09.3: irq 37 for MSI/MSI-X
igbvf 0000:00:09.3: Intel(R) 82576 Virtual Function
igbvf 0000:00:09.3: Address: 5e:1d:88:93:c0:a7
igbvf 0000:00:09.3: MAC: 1
igbvf 0000:00:09.0: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.0: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.1: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.1: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.2: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.2: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.2: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.3: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.3: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.3: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.0: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.2: Link is Up 1000 Mbps Full Duplex
igbvf 0000:00:09.1: Link is Up 1000 Mbps Full Duplex


As per above, this issue has been fixed correctly.

Comment 5 Michal Novotny 2012-05-04 09:48:33 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No Documentation Needed

Comment 6 errata-xmlrpc 2012-06-20 11:38:36 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.

http://rhn.redhat.com/errata/RHBA-2012-0746.html