From patchwork Wed Feb 27 13:24:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gal Hammer X-Patchwork-Id: 223605 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AA6A92C0087 for ; Thu, 28 Feb 2013 00:23:34 +1100 (EST) Received: from localhost ([::1]:36617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAgyo-0001g7-Pg for incoming@patchwork.ozlabs.org; Wed, 27 Feb 2013 08:23:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAgyf-0001fx-D6 for qemu-devel@nongnu.org; Wed, 27 Feb 2013 08:23:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAgya-0005Bk-Ij for qemu-devel@nongnu.org; Wed, 27 Feb 2013 08:23:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAgya-0005Bb-Ap for qemu-devel@nongnu.org; Wed, 27 Feb 2013 08:23:16 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1RDNE6U007812 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 27 Feb 2013 08:23:15 -0500 Received: from [10.35.4.161] (dhcp-4-161.tlv.redhat.com [10.35.4.161]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1RDNCRU003540; Wed, 27 Feb 2013 08:23:12 -0500 Message-ID: <512E08FC.1020805@redhat.com> Date: Wed, 27 Feb 2013 15:24:12 +0200 From: Gal Hammer User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Amit Shah References: <510A2797.8070101@redhat.com> <20130131112540.GD520@redhat.com> <510C4960.4030201@redhat.com> <20130203121137.GA5931@redhat.com> <510F8288.8020202@redhat.com> <20130204095902.GA9053@redhat.com> <20130227123539.GC14401@amit.redhat.com> In-Reply-To: <20130227123539.GC14401@amit.redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Paolo Bonzini , qemu-devel@nongnu.org, "Michael S. Tsirkin" Subject: Re: [Qemu-devel] How many msi-x vectors should be allocated for the virtio-serial device? X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 27/02/2013 14:35, Amit Shah wrote: > On (Mon) 04 Feb 2013 [11:59:02], Michael S. Tsirkin wrote: >> On Mon, Feb 04, 2013 at 10:42:32AM +0100, Paolo Bonzini wrote: >>> Il 03/02/2013 13:11, Michael S. Tsirkin ha scritto: >>>>>> static Property virtio_serial_properties[] = { >>>>>> DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), >>>>>> - DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, DEV_NVECTORS_UNSPECIFIED), >>>>>> + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), >>>>>> DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0), >>>>>> DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features), >>>>>> DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, serial.max_virtserial_ports, 31), >>>>>> >>>>>> plus the backwards-compatibility stuff. >>>>>> >>>>>> Paolo >>>> Makes sense, but the logic in virtio_serial_init_pci is >>>> then dead code and should go away. >>>> >>> >>> It won't be dead code for the backwards-compatible machine types (that >>> use DEV_NVECTORS_UNSPECIFIED). >>> >>> Paolo >> >> Good point. Ack. Want to post this with proper signature etc? > > Gal, do you want to submit a patch for this? > > Amit > Attached. Gal. From ac35ad272744abb83e2dcafcd207471ff6bc1583 Mon Sep 17 00:00:00 2001 From: Gal Hammer Date: Wed, 27 Feb 2013 15:15:31 +0200 Subject: [PATCH] Set virtio-serial device to have a default of 2 MSI vectors. The virtio-serial device is expected to use 2 MSI vectors, one for control queue and a second shared for all queues. Signed-off-by: Gal Hammer --- hw/virtio-pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index a869f53..ba56ab2 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -975,6 +975,9 @@ static int virtio_serial_init_pci(PCIDevice *pci_dev) if (!vdev) { return -1; } + + /* backwards-compatibility with machines that were created with + DEV_NVECTORS_UNSPECIFIED */ vdev->nvectors = proxy->nvectors == DEV_NVECTORS_UNSPECIFIED ? proxy->serial.max_virtserial_ports + 1 : proxy->nvectors; @@ -1155,7 +1158,7 @@ static const TypeInfo virtio_net_info = { static Property virtio_serial_properties[] = { DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), - DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, DEV_NVECTORS_UNSPECIFIED), + DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0), DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features), DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, serial.max_virtserial_ports, 31),