Bug 517460 - libvirt should allow PCI PM reset on multi-function devices
Summary: libvirt should allow PCI PM reset on multi-function devices
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt
Version: 5.5
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 5.5
Assignee: Mark McLoughlin
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 516837 532386 533941
TreeView+ depends on / blocked
 
Reported: 2009-08-14 07:42 UTC by Mark McLoughlin
Modified: 2010-03-30 08:09 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 08:09:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
nodedev-list output (3.99 KB, text/plain)
2010-01-27 08:04 UTC, Gunannan Ren
no flags Details
lscpi-vvv-n output (33.73 KB, text/plain)
2010-01-27 08:07 UTC, Gunannan Ren
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0205 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2010-03-29 12:27:37 UTC

Description Mark McLoughlin 2009-08-14 07:42:47 UTC
This bug prevents multi-function PCI devices from being assigned to a KVM guest using libvirt.

+++ This bug was initially created as a clone of Bug #515689 +++

This code is wrong:

    /* For now, we just refuse to do a power management reset
     * if there are other functions on this device.                     
     * In future, we could allow it so long as those functions                    
     * are not in use by the host or other guests. 
     */
    if (pciDeviceContainsOtherFunctions(conn, dev)) {
        VIR_WARN("%s contains other functions, not resetting", dev->name);
        return -1;
    }

It turns out that PM reset does not affect other functions on a mutli-function device.

--- Additional comment from markmc on 2009-08-14 03:34:06 EDT ---

Patch committed upstream:

  http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=64a6682b93

Comment 1 Daniel Veillard 2009-12-04 15:34:41 UTC
libvirt-0.6.3-23.el5 has been built in dist-5E-qu-candidate with
the patches,

Daniel

Comment 3 Gunannan Ren 2010-01-05 10:07:38 UTC
Hi Daniel:

  I don't know how to verify the bug, if the multi-function PCI devices are type of the PCI device with the support for SR/IOV like intel82576 NIC?
  I tried libvirt-0.6.3-22.el5 version on KVM host with version kvm-83-140.el5, it seems ok to assign VF to guest. 
  Thank you for your more information.

Comment 4 Mark McLoughlin 2010-01-07 18:46:27 UTC
What you're looking for is a machine where by if you do:

  $> virsh nodedev-dettach ...
  $> virsh nodedev-reset ...

on RHEL5.4 (or any libvirt version before libvirt-0.6.3-23.el5) that nodedev-reset fails and prints a "contains other functions, not resetting" message to /var/log/messages

once you've found suitable hardware to do that, then you can update libvirt and check if nodedev-reset now succeeds

Comment 5 Gunannan Ren 2010-01-27 08:03:44 UTC
The bug has been fixed on libvirt-0.6.3-30.el5

I reproduced the bug on libvirt-0.6.3-22.el5
Is is necessary to have a machine with multi-function PCI device which doesn't support FLR feature and support Power Management feature.
then, 
    virsh nodedev-dettach ...
    virsh nodedev-reset ...
It reports errors to standard output device:

error: Failed to reset device pci_10df_fe00
error: this function is not supported by the hypervisor: No PCI reset capability available for 0000:01:00.1

and simultaneously, prints a error log into /var/log/messages, like:

Jan 27 15:51:43 intel-5504-12-1 libvirtd: 15:51:43.259: warning : 0000:01:00.1 contains other functions, not resetting
Jan 27 15:51:43 intel-5504-12-1 libvirtd: 15:51:43.259: error : this function is not supported by the hypervisor: No PCI reset capability available for 0000:01:00.1

on libvirt-0.6.3-30.el5, no errors occurred.

Comment 6 Gunannan Ren 2010-01-27 08:04:55 UTC
Created attachment 387003 [details]
nodedev-list output

Comment 7 Gunannan Ren 2010-01-27 08:07:22 UTC
Created attachment 387004 [details]
lscpi-vvv-n output

Comment 10 errata-xmlrpc 2010-03-30 08:09:34 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0205.html


Note You need to log in before you can comment on or make changes to this bug.