peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame qemu-virtio-serial-Use-MSI-vectors-for-port-virtqueues.patch

amitshah 99a9ef
From 43fa8533e10c478825952d489269d55e5c652c1a Mon Sep 17 00:00:00 2001
amitshah 99a9ef
From: Amit Shah <amit.shah@redhat.com>
amitshah 99a9ef
Date: Wed, 20 Jan 2010 00:36:58 +0530
amitshah 99a9ef
Subject: [PATCH 8/9] virtio-serial: Use MSI vectors for port virtqueues
amitshah 99a9ef
amitshah 99a9ef
This commit enables the use of MSI interrupts for virtqueue
amitshah 99a9ef
notifications for ports. We use nr_ports + 1 (for control channel) msi
amitshah 99a9ef
entries for the ports, as only the in_vq operations need an interrupt on
amitshah 99a9ef
the guest.
amitshah 99a9ef
amitshah 99a9ef
Signed-off-by: Amit Shah <amit.shah@redhat.com>
amitshah 99a9ef
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
amitshah 99a9ef
---
amitshah 99a9ef
 hw/virtio-pci.c |    4 ++++
amitshah 99a9ef
 1 files changed, 4 insertions(+), 0 deletions(-)
amitshah 99a9ef
amitshah 99a9ef
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
amitshah 99a9ef
index c1a1e4c..4451a63 100644
amitshah 99a9ef
--- a/hw/virtio-pci.c
amitshah 99a9ef
+++ b/hw/virtio-pci.c
amitshah 99a9ef
@@ -497,10 +497,13 @@ static int virtio_serial_init_pci(PCIDevice *pci_dev)
amitshah 99a9ef
     if (!vdev) {
amitshah 99a9ef
         return -1;
amitshah 99a9ef
     }
amitshah 99a9ef
+    vdev->nvectors = proxy->nvectors ? proxy->nvectors
amitshah 99a9ef
+                                     : proxy->max_virtserial_ports + 1;
amitshah 99a9ef
     virtio_init_pci(proxy, vdev,
amitshah 99a9ef
                     PCI_VENDOR_ID_REDHAT_QUMRANET,
amitshah 99a9ef
                     PCI_DEVICE_ID_VIRTIO_CONSOLE,
amitshah 99a9ef
                     proxy->class_code, 0x00);
amitshah 99a9ef
+    proxy->nvectors = vdev->nvectors;
amitshah 99a9ef
     return 0;
amitshah 99a9ef
 }
amitshah 99a9ef
 
amitshah 99a9ef
@@ -577,6 +580,7 @@ static PCIDeviceInfo virtio_info[] = {
amitshah 99a9ef
         .init      = virtio_serial_init_pci,
amitshah 99a9ef
         .exit      = virtio_exit_pci,
amitshah 99a9ef
         .qdev.props = (Property[]) {
amitshah 99a9ef
+            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 0),
amitshah 99a9ef
             DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
amitshah 99a9ef
             DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, max_virtserial_ports,
amitshah 99a9ef
                                31),
amitshah 99a9ef
-- 
amitshah 99a9ef
1.6.2.5
amitshah 99a9ef