Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 923026

Summary: qemu-kvm: vfio: failed to enable vectors, -1
Product: Red Hat Enterprise Linux 7 Reporter: Chao Yang <chayang>
Component: qemu-kvmAssignee: Alex Williamson <alex.williamson>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: acathrow, alex.williamson, chayang, hhuang, juzhang, michen, qzhang, shuang, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-24 01:52:39 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:
Attachments:
Description Flags
qmpvf.py none

Description Chao Yang 2013-03-19 03:21:54 UTC
Description of problem:
Repeatedly hot plug/unplug VFs, qemu-kvm complained "qemu-kvm: vfio: failed to enable vectors, -1"

Version-Release number of selected component (if applicable):
qemu-kvm-1.4.0-1.el7.x86_64
3.8.0-0.40.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
CLI:
/usr/libexec/qemu-kvm -name SR-IOV -M pc-i440fx-1.4 -cpu Nehalem -enable-kvm -m 4096 -smp 4,sockets=4,cores=1,threads=1 -uuid 8caf1895-52ef-4231-e4ec-73171b8b265b -nodefaults -rtc base=utc -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-scsi-pci,id=scsi0,bus=pci.0 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=/root/sriov.raw,if=none,id=drive-scsi0-0-0,format=raw -device scsi-hd,bus=scsi0.0,scsi-id=0,drive=drive-scsi0-0-0,id=scsi0-0-0,bootindex=2 -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:6c:08:46,bus=pci.0 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0 -spice port=5900,disable-ticketing,seamless-migration=on -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864 -device intel-hda,id=sound0,bus=pci.0 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -balloon none -qmp tcp:0:4455,server,nowait

script to perform hot plug/unplug in a loop:
-- a snip: 
    qmp_socket.send("qmp_capabilities")
    for i in range(num):
       	print "It is the %d-th times loop" %(i)
	cmd = "device_add driver=vfio-pci host=06:1f.4 id=hostnet1"
        qmp_socket.send(cmd)
        time.sleep(5)
        cmd = "device_add driver=vfio-pci host=06:1f.2 id=hostnet2"
        qmp_socket.send(cmd)
        time.sleep(5)
        cmd = "device_del id=hostnet1"
        qmp_socket.send(cmd)
        time.sleep(5)
        cmd = "device_del id=hostnet2"
        qmp_socket.send(cmd)
        time.sleep(5)
        ....

# python /home/qmpvf.py --help
Usage: qmpvf.py [options]

Options:
  -h, --help            show this help message and exit
  -n NUM, --num=NUM     Times want to try
  -f PORT, --file=PORT  QMP port/filename
  -p PROTOCOL, --protocol=PROTOCOL
                        QMP protocol

# python /home/qmpvf.py  -f 4455 -n 500

Comment 2 Alex Williamson 2013-03-19 04:24:32 UTC
What VF is being tested here?  82576?  82599?

Where can I get qmpvf.py?

You're testing up to 500 iterations, how many does it typically take to get an error?

Comment 3 Chao Yang 2013-03-19 05:23:21 UTC
(In reply to comment #2)
> What VF is being tested here?  82576?  82599?
> 
82599 VFs
> Where can I get qmpvf.py?
> 
Will upload it.
> You're testing up to 500 iterations, how many does it typically take to get
> an error?
I hit once at 12 iterations, sometimes 50.

Comment 4 Chao Yang 2013-03-19 05:25:29 UTC
Created attachment 712394 [details]
qmpvf.py

Comment 5 Chao Yang 2013-03-22 02:22:51 UTC
I hit "qemu-kvm: vfio: failed to modify vector, -1" while keeping scp a 2G file from guest A to guest B through vfio-pci. This error was claimed by guest B, and its VF interface lost IP.
Not sure if they are same issue, just leave this comment here to keep you posted.

# /usr/libexec/qemu-kvm -name SR-IOV -M q35 -cpu Nehalem -enable-kvm -m 2048 -smp 4,sockets=2,cores=2,threads=1 -uuid 8caf1895-52ef-4231-e4ec-73171b8b265b -nodefaults -rtc base=utc -device piix3-usb-uhci,id=usb,bus=pcie.0 -device virtio-scsi-pci,id=scsi0,bus=pcie.0 -device virtio-serial-pci,id=virtio-serial0,bus=pcie.0,addr=0x6 -drive file=/home/sriov-pcie.qcow2,if=none,id=drive-scsi0-0-0,format=qcow2 -device scsi-hd,bus=scsi0.0,scsi-id=0,drive=drive-scsi0-0-0,id=scsi0-0-0,bootindex=1 -netdev tap,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=26:a5:6b:87:93:12,bus=pcie.0 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -device usb-tablet,id=input0 -spice port=5900,disable-ticketing,seamless-migration=on -vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=67108864 -device intel-hda,id=sound0,bus=pcie.0 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -balloon none -monitor stdio -serial unix:/tmp/serial,server,nowait -device vfio-pci,host=06:1f.4,id=vf_061f4
char device redirected to /dev/pts/3 (label charserial0)
QEMU 1.4.0 monitor - type 'help' for more information
(qemu) main_channel_link: add main channel client
main_channel_handle_parsed: net test: latency 0.550000 ms, bitrate 529335745 bps (504.813905 Mbps)
red_dispatcher_set_cursor_peer: 
inputs_connect: inputs channel client create
main_channel_handle_parsed: agent start
qemu-kvm: vfio: failed to modify vector, -1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Comment 6 Alex Williamson 2013-12-19 19:28:39 UTC
Can this be reproduced on latest bits?  This may be related to bug 1029743

Comment 7 Chao Yang 2013-12-24 01:15:58 UTC
(In reply to Alex Williamson from comment #6)
> Can this be reproduced on latest bits?  This may be related to bug 1029743

Not reproducible with qemu-kvm-1.5.3-30.el7.x86_64, 3.10.0-61.el7.x86_64 after 2000 iterations repeatedly hot plugging/unplugging VFs through same script in Comment 4.

Comment 8 Alex Williamson 2013-12-24 01:52:39 UTC
Thanks for the re-test