Bug 1452072
Summary: | RFE: Add support for listing mediated devices to libvirt's node device driver | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Erik Skultety <eskultet> | |
Component: | libvirt | Assignee: | Erik Skultety <eskultet> | |
Status: | CLOSED ERRATA | QA Contact: | zhe peng <zpeng> | |
Severity: | high | Docs Contact: | ||
Priority: | high | |||
Version: | 7.4 | CC: | alex.williamson, dyuan, eskultet, jsuchane, lcheng, lmiksik, rbalakri, xuzhang, zpeng | |
Target Milestone: | rc | Keywords: | FutureFeature | |
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | libvirt-3.2.0-6.el7 | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1454174 (view as bug list) | Environment: | ||
Last Closed: | 2017-08-02 00:08:25 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: | 1376907, 1463285 | |||
Bug Blocks: | 1422276, 1454174 |
Description
Erik Skultety
2017-05-18 09:42:13 UTC
Fixed upstream by commits: commit 4385df97fed24279fa8595a1a49c9f9b3eba5be1 Refs: v3.3.0-92-g4385df97f Author: Erik Skultety <eskultet> AuthorDate: Mon Mar 6 17:20:00 2017 +0100 Commit: Erik Skultety <eskultet> CommitDate: Thu May 18 12:20:15 2017 +0200 nodedev: Introduce new mdev_types and mdev nodedev capabilities The reason for introducing two capabilities, one for the device itself (cap 'mdev') and one for the parent device listing the available types ('mdev_types'), is that we should be able to do 'virsh nodedev-list --cap' not only for existing mdev devices but also for devices that support creation of mdev devices, since one day libvirt might be actually able to create the mdev devices in an automated way (just like we do for NPIV/vHBA). https://bugzilla.redhat.com/show_bug.cgi?id=1452072 Signed-off-by: Erik Skultety <eskultet> commit 500cbc066a5362834462c4eefb260b7c96a8554f Refs: v3.3.0-93-g500cbc066 Author: Erik Skultety <eskultet> AuthorDate: Mon Mar 6 17:17:34 2017 +0100 Commit: Erik Skultety <eskultet> CommitDate: Thu May 18 12:21:33 2017 +0200 nodedev: Introduce the mdev capability to a PCI parent device The parent device needs to report the generic stuff about the supported mediated devices types, like device API, available instances, type name, etc. Therefore this patch introduces a new nested capability element of type 'mdev_types' with the resulting XML of the following format: <device> ... <capability type='pci'> ... <capability type='mdev_types'> <type id='vendor_supplied_id'> <name>optional_vendor_supplied_codename</name> <deviceAPI>vfio-pci</deviceAPI> <availableInstances>NUM</availableInstances> </type> ... <type> ... </type> </capability> </capability> ... </device> https://bugzilla.redhat.com/show_bug.cgi?id=1452072 Signed-off-by: Erik Skultety <eskultet> commit 88ef73e13cddc8c0ff01dfe7a914342f8720c517 Refs: v3.3.0-94-g88ef73e13 Author: Erik Skultety <eskultet> AuthorDate: Mon Mar 6 17:18:48 2017 +0100 Commit: Erik Skultety <eskultet> CommitDate: Thu May 18 12:21:45 2017 +0200 nodedev: Introduce mdev capability for mediated devices Start discovering the mediated devices on the host system and format the attributes for the mediated device into the XML. Compared to the parent device which reports generic information about the abstract mediated devices types, a child device only reports the type name it has been instantiated from and the IOMMU group number, since that's device specific compared to the rest of the info that can be gathered about mediated devices at the moment. This patch introduces both the formatting and parsing routines, updates nodedev.rng schema, adding a testcase as well. The resulting mdev child device XML: <device> <name>mdev_4b20d080_1b54_4048_85b3_a6a62d165c01</name> <path>/sys/devices/.../4b20d080-1b54-4048-85b3-a6a62d165c01</path> <parent>pci_0000_06_00_0</parent> <driver> <name>vfio_mdev</name> </driver> <capability type='mdev'> <type id='vendor_supplied_type_id'/> <iommuGroup number='NUM'/> <capability/> <device/> https://bugzilla.redhat.com/show_bug.cgi?id=1452072 Signed-off-by: Erik Skultety <eskultet> commit a0a0b3cf71cbee1df40dd0fdebd7bb6a84682f09 Refs: [master], [mdev-nodedev-next], {origin/master}, {origin/HEAD}, v3.3.0-95-ga0a0b3cf7 Author: Erik Skultety <eskultet> AuthorDate: Wed Mar 29 12:36:31 2017 +0200 Commit: Erik Skultety <eskultet> CommitDate: Thu May 18 12:21:55 2017 +0200 docs: Document the mediated devices within the nodedev driver https://bugzilla.redhat.com/show_bug.cgi?id=1452072 Signed-off-by: Erik Skultety <eskultet> test with build: libvirt-3.2.0-6.virtcov.el7.x86_64 qemu-kvm-rhev-2.9.0-6.el7.x86_64 kernel-3.10.0-663.el7.x86_64 step: 1. create mdev. #lspci 00:02.0 VGA compatible controller: Intel Corporation HD Graphics P530 (rev 06) # ll /sys/class/mdev_bus/0000\:00\:02.0/mdev_supported_types/i915-GVTg_V5_4/devices total 0 lrwxrwxrwx. 1 root root 0 May 25 10:32 9ea4eb07-c4a8-41d1-bd4a-850d1b0bef74 -> ../../../9ea4eb07-c4a8-41d1-bd4a-850d1b0bef74 2.check virsh man page #man virsh nodedev-list cap --tree List all of the devices available on the node that are known by libvirt. cap is used to filter the list by capability types, the types must be separated by comma, e.g. --cap pci,scsi. Valid capability types include 'system', 'pci', 'usb_device', 'usb', 'net', 'scsi_host', 'scsi_target', 'scsi', 'storage', 'fc_host', 'vports', 'scsi_generic', 'drm', 'mdev', 'mdev_types'. If --tree is used, the output is formatted in a tree representing parents of each node. cap and --tree are mutually exclusive. 3.check cap # virsh nodedev-list --cap mdev mdev_9ea4eb07_c4a8_41d1_bd4a_850d1b0bef74 # virsh nodedev-list --cap mdev_types pci_0000_00_02_0 3.check capability # virsh nodedev-list --tree computer | ... +- pci_0000_00_00_0 +- pci_0000_00_02_0 | | | +- drm_card0 | +- drm_renderD128 | +- mdev_9ea4eb07_c4a8_41d1_bd4a_850d1b0bef74 # virsh nodedev-dumpxml pci_0000_00_02_0 <device> <name>pci_0000_00_02_0</name> <path>/sys/devices/pci0000:00/0000:00:02.0</path> <parent>computer</parent> <driver> <name>i915</name> </driver> <capability type='pci'> <domain>0</domain> <bus>0</bus> <slot>2</slot> <function>0</function> <product id='0x191d'>HD Graphics P530</product> <vendor id='0x8086'>Intel Corporation</vendor> <capability type='mdev_types'> <type id='i915-GVTg_V5_4'> <deviceAPI>vfio-pci</deviceAPI> <availableInstances>0</availableInstances> </type> <type id='i915-GVTg_V5_8'> <deviceAPI>vfio-pci</deviceAPI> <availableInstances>0</availableInstances> </type> </capability> <iommuGroup number='1'> <address domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </iommuGroup> <pci-express/> </capability> </device> # virsh nodedev-dumpxml mdev_9ea4eb07_c4a8_41d1_bd4a_850d1b0bef74 <device> <name>mdev_9ea4eb07_c4a8_41d1_bd4a_850d1b0bef74</name> <path>/sys/devices/pci0000:00/0000:00:02.0/9ea4eb07-c4a8-41d1-bd4a-850d1b0bef74</path> <parent>pci_0000_00_02_0</parent> <driver> <name>vfio_mdev</name> </driver> <capability type='mdev'> <type id='i915-GVTg_V5_4'/> <iommuGroup number='7'/> </capability> </device> I will do more functional testing about this, after that, i will move this bug to verified. i retest this on build: libvirt-3.2.0-9.virtcov.el7.x86_64 does not found any issues, move to verified. I have marked the kernel bug 1376907 as a blocker for this. 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 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 *** Bug 1376907 has been marked as a duplicate of this bug. *** |