From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXJRG-00007f-4d for qemu-devel@nongnu.org; Tue, 19 Jan 2010 14:08:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXJRB-0008Vh-CY for qemu-devel@nongnu.org; Tue, 19 Jan 2010 14:08:29 -0500 Received: from [199.232.76.173] (port=53097 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXJRB-0008VY-4P for qemu-devel@nongnu.org; Tue, 19 Jan 2010 14:08:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58018) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXJRA-0006Au-MR for qemu-devel@nongnu.org; Tue, 19 Jan 2010 14:08:24 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0JJ8N8P001328 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 19 Jan 2010 14:08:24 -0500 From: Amit Shah Date: Wed, 20 Jan 2010 00:36:58 +0530 Message-Id: <1263928018-32531-9-git-send-email-amit.shah@redhat.com> In-Reply-To: <1263928018-32531-8-git-send-email-amit.shah@redhat.com> References: <1263928018-32531-1-git-send-email-amit.shah@redhat.com> <1263928018-32531-2-git-send-email-amit.shah@redhat.com> <1263928018-32531-3-git-send-email-amit.shah@redhat.com> <1263928018-32531-4-git-send-email-amit.shah@redhat.com> <1263928018-32531-5-git-send-email-amit.shah@redhat.com> <1263928018-32531-6-git-send-email-amit.shah@redhat.com> <1263928018-32531-7-git-send-email-amit.shah@redhat.com> <1263928018-32531-8-git-send-email-amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH 8/8] virtio-serial: Use MSI vectors for port virtqueues List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Amit Shah 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 --- 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