qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: qemu-devel@nongnu.org
Cc: Amit Shah <amit.shah@redhat.com>
Subject: [Qemu-devel] [PATCH 8/8] virtio-serial: Use MSI vectors for port virtqueues
Date: Wed, 20 Jan 2010 00:36:58 +0530	[thread overview]
Message-ID: <1263928018-32531-9-git-send-email-amit.shah@redhat.com> (raw)
In-Reply-To: <1263928018-32531-8-git-send-email-amit.shah@redhat.com>

This commit enables the use of MSI interrupts for virtqueue
notifications for ports. We use nr_ports + 1 (for control channel) msi
entries for the ports, as only the in_vq operations need an interrupt on
the guest.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 hw/virtio-pci.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index e7fabfb..709d13e 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -499,10 +499,13 @@ static int virtio_serial_init_pci(PCIDevice *pci_dev)
     if (!vdev) {
         return -1;
     }
+    vdev->nvectors = proxy->nvectors ? proxy->nvectors
+                                     : proxy->max_virtserial_ports + 1;
     virtio_init_pci(proxy, vdev,
                     PCI_VENDOR_ID_REDHAT_QUMRANET,
                     PCI_DEVICE_ID_VIRTIO_CONSOLE,
                     proxy->class_code, 0x00);
+    proxy->nvectors = vdev->nvectors;
     return 0;
 }
 
@@ -581,6 +584,7 @@ static PCIDeviceInfo virtio_info[] = {
         .init      = virtio_serial_init_pci,
         .exit      = virtio_exit_pci,
         .qdev.props = (Property[]) {
+            DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 0),
             DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
             DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
             DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, max_virtserial_ports,
-- 
1.6.2.5

  reply	other threads:[~2010-01-19 19:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-19 19:06 [Qemu-devel] [PATCH 0/8] virtio-console: Move to qdev, multiple devices, generic ports Amit Shah
2010-01-19 19:06 ` [Qemu-devel] [PATCH 1/8] virtio: Remove duplicate macro definition for max. virtqueues, bump up the max Amit Shah
2010-01-19 19:06   ` [Qemu-devel] [PATCH 2/8] virtio-console: qdev conversion, new virtio-serial-bus Amit Shah
2010-01-19 19:06     ` [Qemu-devel] [PATCH 3/8] virtio-serial-bus: Maintain guest and host port open/close state Amit Shah
2010-01-19 19:06       ` [Qemu-devel] [PATCH 4/8] virtio-serial-bus: Add a port 'name' property for port discovery in guests Amit Shah
2010-01-19 19:06         ` [Qemu-devel] [PATCH 5/8] virtio-serial-bus: Add ability to hot-unplug ports Amit Shah
2010-01-19 19:06           ` [Qemu-devel] [PATCH 6/8] virtio-serial: Add a 'virtserialport' device for generic serial port support Amit Shah
2010-01-19 19:06             ` [Qemu-devel] [PATCH 7/8] Move virtio-serial to Makefile.objs Amit Shah
2010-01-19 19:06               ` Amit Shah [this message]
2010-01-20 14:56   ` [Qemu-devel] [PATCH 1/8] virtio: Remove duplicate macro definition for max. virtqueues, bump up the max Anthony Liguori
2010-01-21  9:53     ` Markus Armbruster
2010-01-21  9:58       ` Amit Shah

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=1263928018-32531-9-git-send-email-amit.shah@redhat.com \
    --to=amit.shah@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).