qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] virtio: enable msi-x for console+balloon
Date: Wed, 25 Nov 2009 09:16:48 +0100	[thread overview]
Message-ID: <1259137008-9669-2-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1259137008-9669-1-git-send-email-kraxel@redhat.com>

Enable MSI-X for virtio-console-pci and virtio-balloon-pci.
Add entries to the compatibility machine types so MSI-X will
be disabled for pc-0.10 and pc-0.11.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/pc.c         |   16 ++++++++++++++++
 hw/virtio-pci.c |   11 +++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index fdaa52c..cb78923 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1297,6 +1297,14 @@ static QEMUMachine pc_machine_v0_11 = {
             .driver   = "virtio-blk-pci",
             .property = "vectors",
             .value    = stringify(0),
+        },{
+            .driver   = "virtio-balloon-pci",
+            .property = "vectors",
+            .value    = stringify(0),
+        },{
+            .driver   = "virtio-console-pci",
+            .property = "vectors",
+            .value    = stringify(0),
         },
         { /* end of list */ }
     }
@@ -1324,6 +1332,14 @@ static QEMUMachine pc_machine_v0_10 = {
             .driver   = "virtio-blk-pci",
             .property = "vectors",
             .value    = stringify(0),
+        },{
+            .driver   = "virtio-balloon-pci",
+            .property = "vectors",
+            .value    = stringify(0),
+        },{
+            .driver   = "virtio-console-pci",
+            .property = "vectors",
+            .value    = stringify(0),
         },
         { /* end of list */ }
     },
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index aebcf9d..cb8ab21 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -483,10 +483,13 @@ static int virtio_console_init_pci(PCIDevice *pci_dev)
     if (!vdev) {
         return -1;
     }
+    vdev->nvectors = proxy->nvectors;
     virtio_init_pci(proxy, vdev,
                     PCI_VENDOR_ID_REDHAT_QUMRANET,
                     PCI_DEVICE_ID_VIRTIO_CONSOLE,
                     proxy->class_code, 0x00);
+    /* make the actual value visible */
+    proxy->nvectors = vdev->nvectors;
     return 0;
 }
 
@@ -531,11 +534,14 @@ static int virtio_balloon_init_pci(PCIDevice *pci_dev)
     VirtIODevice *vdev;
 
     vdev = virtio_balloon_init(&pci_dev->qdev);
+    vdev->nvectors = proxy->nvectors;
     virtio_init_pci(proxy, vdev,
                     PCI_VENDOR_ID_REDHAT_QUMRANET,
                     PCI_DEVICE_ID_VIRTIO_BALLOON,
                     PCI_CLASS_MEMORY_RAM,
                     0x00);
+    /* make the actual value visible */
+    proxy->nvectors = vdev->nvectors;
     return 0;
 }
 
@@ -569,6 +575,7 @@ static PCIDeviceInfo virtio_info[] = {
         .init      = virtio_console_init_pci,
         .exit      = virtio_exit_pci,
         .qdev.props = (Property[]) {
+            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2),
             DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
             DEFINE_PROP_END_OF_LIST(),
         },
@@ -579,6 +586,10 @@ static PCIDeviceInfo virtio_info[] = {
         .init      = virtio_balloon_init_pci,
         .exit      = virtio_exit_pci,
         .qdev.reset = virtio_pci_reset,
+        .qdev.props = (Property[]) {
+            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 3),
+            DEFINE_PROP_END_OF_LIST(),
+        },
     },{
         /* end of list */
     }
-- 
1.6.2.5

  reply	other threads:[~2009-11-25  9:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25  8:16 [Qemu-devel] [PATCH 1/2] pc: add machine type for 0.12 Gerd Hoffmann
2009-11-25  8:16 ` Gerd Hoffmann [this message]
2009-12-07  9:37   ` [Qemu-devel] Re: [PATCH 2/2] virtio: enable msi-x for console+balloon Michael S. Tsirkin
2009-12-07 10:32     ` Gerd Hoffmann
2009-12-07 10:59       ` Michael S. Tsirkin
2009-12-07 11:24         ` Gerd Hoffmann
2009-12-07 13:03           ` Michael S. Tsirkin
2009-12-07 13:16             ` Gerd Hoffmann
2009-12-07 14:13               ` Michael S. Tsirkin
2009-12-07 14:30                 ` Gerd Hoffmann
2009-12-07 14:43                   ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1259137008-9669-2-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).