Bug 1427780
| Summary: | RHEV for Power: VFIO passthrough of SR-IOV virtual functions | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Dan Zheng <dzheng> |
| Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 7.4 | CC: | abologna, bugproxy, dgibson, hannsj_uhl, jen, jsuchane, juzhang, knoel, laine, leiwang, michen, mtessun, pkrempa, qzhang, rbalakri, virt-maint, ycui, zhengtli |
| Target Milestone: | rc | Keywords: | TestOnly |
| Target Release: | 7.4 | ||
| Hardware: | ppc64le | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1314131 | Environment: | |
| Last Closed: | 2017-08-02 07:44:59 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: | 1314131, 1315131, 1421940 | ||
| Bug Blocks: | 1299988, 1359843, 1395265, 1401400, 1445460 | ||
|
Comment 9
Dan Zheng
2017-04-27 09:40:42 UTC
(In reply to Dan Zheng from comment #9) > ### Test case 6: RHEL7-18505 [SR-IOV] Hotplug/unplug network device with > managed='yes' --- PASS > > As bug 1272300, detach-device will cause host crash. So I did not test > detach. Detaching should work just fine since, unlike PFs, VFs each have their own IOMMU group. Test packages:
qemu-kvm-rhev-2.9.0-2.el7.ppc64le
kernel-3.10.0-657.el7.ppc64le
libvirt-3.2.0-3.el7.ppc64le
### Test case 5: RHEL7-18526 - [SR-IOV] Hot-plug VFs from sriov vfs pool to guest and hot-unplug VF --- hotunplug will cause host to crash
1. Prepare one network with hostdev forward mode
<network connections='2'>
<name>hostnet</name>
<uuid>c1fb4ead-21b8-4d69-8ad9-669c55b3dfc7</uuid>
<forward mode='hostdev' managed='yes'>
<driver name='vfio'/>
<address type='pci' domain='0x0003' bus='0x0f' slot='0x06' function='0x1'/>
<address type='pci' domain='0x0003' bus='0x0f' slot='0x06' function='0x0'/>
</forward>
</network>
2. Prepare one xml like the following one:
# cat vfpool.xml
<interface type='network'>
<source network='hostnet'/>
</interface>
3. Hot-plug the vf to the guest.
# virsh attach-device vm1 vfpool.xml
Device attached successfully
# virsh attach-device vm1 vfpool.xml
Device attached successfully
# virsh attach-device vm1 vfpool.xml
error: Failed to attach device from vfpool.xml
error: internal error: network 'hostnet' requires exclusive access to interfaces, but none are available <=== This is as expected
4. Dumpxml:
<interface type='hostdev' managed='yes'>
<mac address='52:54:00:e7:5f:78'/>
<driver name='vfio'/>
<source>
<address type='pci' domain='0x0003' bus='0x0f' slot='0x06' function='0x1'/>
</source>
<model type='virtio'/>
<alias name='hostdev0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</interface>
<interface type='hostdev' managed='yes'>
<mac address='52:54:00:63:0b:cc'/>
<driver name='vfio'/>
<source>
<address type='pci' domain='0x0003' bus='0x0f' slot='0x06' function='0x0'/>
</source>
<model type='virtio'/>
<alias name='hostdev1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</interface>
5. Detach the last interface
# virsh detach-device vm1 vf-detach.xml
Device detached successfully
6. The last interface is removed in dumpxml and lspci within guest.
7. Try four VFs (2 of them are from another PF port) and attach the vf pool to guest and detach them ok.
8. Repeat attach and detach one VF of the pool, the host will crash and restart.
0003:0f:06.0 Ethernet controller: Intel Corporation XL710/X710 Virtual Function (rev 01)
0003:0f:06.1 Ethernet controller: Intel Corporation XL710/X710 Virtual Function (rev 01)
pci_0003_0f_06_1 and pci_0003_0f_06_0 belong to different iommuGroup
<iommuGroup number='7'>
<address domain='0x0003' bus='0x0f' slot='0x06' function='0x1'/>
</iommuGroup>
<iommuGroup number='6'>
<address domain='0x0003' bus='0x0f' slot='0x06' function='0x0'/>
</iommuGroup>
But the host still restart after executing detach.
vf-detach.xml has same content as those in dumpxml of this interface
# virsh detach-device vm1 vf-detach.xml
Write failed: Broken pipe
[root@work-machine xxx]#
kernel-3.10.0-666.el7.ppc64le
qemu-kvm-rhev-2.9.0-2.el7.ppc64le
libvirt-3.2.0-4.el7.ppc64le
### Test case 8: [SR-IOV] Attach interfaces from macvtap network with passthrough mode ---PASS
1. Configure 2 VFs and define a macvtap passthrough network.
# ip l
...
7: enP3p15s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq portid 6805ca37df21 state UP mode DEFAULT qlen 1000
link/ether 68:05:ca:37f:21 brd ff:ff:ff:ff:ff:ff
vf 0 MAC 00:00:00:00:00:00, spoof checking on, link-state auto, trust on
vf 1 MAC 00:00:00:00:00:00, spoof checking on, link-state auto, trust on
...
12: enP3p15s6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
link/ether 52:56:29:6b:86:2f brd ff:ff:ff:ff:ff:ff
13: enP3p15s6f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
link/ether 72:cd:51:38:64:ce brd ff:ff:ff:ff:ff:ff
# virsh net-list --all
Name State Autostart Persistent
----------------------------------------------------------
default active yes yes
macvtap-passthrough active no yes
# virsh net-dumpxml macvtap-passthrough
<network>
<name>macvtap-passthrough</name>
<uuid>a53c4f33-58ea-4b2e-80b4-f9d103b7b0a3</uuid>
<forward dev='enP3p15s6' mode='passthrough'>
<interface dev='enP3p15s6'/>
<interface dev='enP3p15s6f1'/>
</forward>
</network>
2. Add the following xml to the guests( vm1 and vm2)
<interface type='network'>
<source network='macvtap-passthrough'/>
<model type='virtio'/>
</interface>
3. Start vm1, vm1 can be logon successfully.
# virsh dumpxml vm1|grep interface -A7
<interface type='direct'>
<mac address='52:54:00:6c:b03'/>
<source network='macvtap-passthrough' dev='enP3p15s6' mode='passthrough'/>
<target dev='macvtap0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</interface>
4. Destroy vm1 and start it again.
5. Check network
# virsh net-dumpxml macvtap-passthrough
<network connections='1'>
<name>macvtap-passthrough</name>
<uuid>a53c4f33-58ea-4b2e-80b4-f9d103b7b0a3</uuid>
<forward dev='enP3p15s6' mode='passthrough'>
<interface dev='enP3p15s6' connections='1'/>
<interface dev='enP3p15s6f1'/>
</forward>
</network>
6. Start vm2.
# virsh list --all
Id Name State
----------------------------------------------------
3 vm1 running
4 vm2 running
7. Check network. 2 connections are displayed.
# virsh net-dumpxml macvtap-passthrough
<network connections='2'>
<name>macvtap-passthrough</name>
<uuid>a53c4f33-58ea-4b2e-80b4-f9d103b7b0a3</uuid>
<forward dev='enP3p15s6' mode='passthrough'>
<interface dev='enP3p15s6' connections='1'/>
<interface dev='enP3p15s6f1' connections='1'/>
</forward>
</network>
8. Check dumpxml of vm2
# virsh dumpxml vm2|grep interface -A7
<interface type='direct'>
<mac address='52:54:00:a1:d4:de'/>
<source network='macvtap-passthrough' dev='enP3p15s6f1' mode='passthrough'/>
<target dev='macvtap1'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</interface>
9. Logon vm1 and vm2 ok. lspci can list the nic device.
(In reply to Dan Zheng from comment #11) [...] > 7. Try four VFs (2 of them are from another PF port) and attach the vf pool > to guest and detach them ok. > > 8. Repeat attach and detach one VF of the pool, the host will crash and > restart. > 0003:0f:06.0 Ethernet controller: Intel Corporation XL710/X710 Virtual > Function (rev 01) > 0003:0f:06.1 Ethernet controller: Intel Corporation XL710/X710 Virtual > Function (rev 01) > pci_0003_0f_06_1 and pci_0003_0f_06_0 belong to different iommuGroup > <iommuGroup number='7'> > <address domain='0x0003' bus='0x0f' slot='0x06' function='0x1'/> > </iommuGroup> > <iommuGroup number='6'> > <address domain='0x0003' bus='0x0f' slot='0x06' function='0x0'/> > </iommuGroup> > > But the host still restart after executing detach. > vf-detach.xml has same content as those in dumpxml of this interface > > # virsh detach-device vm1 vf-detach.xml > Write failed: Broken pipe > [root@work-machine xxx]# I've been able to make the host reach an unusable state without even resorting to using VFs backed by separate PFs, just with the simple case described in steps 1-6. Even though we're not talking about a full host crash, it was still enough to force me to reboot the machine in order to be able to move forward with testing. It seems to me that the i40evf driver is just not very reliable, at least on ppc64le: see Bug 1445460 for some more evidence of that. The host crash problem is tracked by BZ 1445460 now. And no other new bugs are found. So it is marked verified now. |