From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRBTo-0002ie-Ek for qemu-devel@nongnu.org; Thu, 26 Feb 2015 22:20:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRBTj-0006Op-Ga for qemu-devel@nongnu.org; Thu, 26 Feb 2015 22:20:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRBTj-0006Od-9b for qemu-devel@nongnu.org; Thu, 26 Feb 2015 22:20:39 -0500 Date: Fri, 27 Feb 2015 03:26:44 +0008 From: Jason Wang Message-Id: <1425007124.3834.3@smtp.corp.redhat.com> In-Reply-To: <20150226102007.GB24889@redhat.com> References: <1424934286-7099-1-git-send-email-jasowang@redhat.com> <1424934286-7099-9-git-send-email-jasowang@redhat.com> <20150226102007.GB24889@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Subject: Re: [Qemu-devel] [PATCH V2 08/11] virtio-pci: switch to use bus specific queue limit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, Anthony Liguori On Thu, Feb 26, 2015 at 6:20 PM, Michael S. Tsirkin wrote: > On Thu, Feb 26, 2015 at 03:04:43PM +0800, Jason Wang wrote: >> Instead of depending on a macro, switch to use a bus specific queue >> limit. >> >> Cc: Anthony Liguori >> Cc: Michael S. Tsirkin >> Signed-off-by: Jason Wang >> --- >> hw/virtio/virtio-pci.c | 10 +++++----- >> 1 file changed, 5 insertions(+), 5 deletions(-) >> >> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c >> index 7fa8141..23c4649 100644 >> --- a/hw/virtio/virtio-pci.c >> +++ b/hw/virtio/virtio-pci.c >> @@ -215,7 +215,7 @@ static void >> virtio_pci_start_ioeventfd(VirtIOPCIProxy *proxy) >> return; >> } >> >> - for (n = 0; n < VIRTIO_PCI_QUEUE_MAX; n++) { >> + for (n = 0; n < virtio_get_queue_max(vdev); n++) { >> if (!virtio_queue_get_num(vdev, n)) { >> continue; >> } > > This is done on guest IO, and I think after applying the > next patch which increases the number to >500 for pci, it's too much > work: VCPU is blocked meanwhile. Same applies to other places. > > At minimum, we'll need a faster way to locate active VQs. > Maybe just replace the continue with break in above. Since it looks like virtqueue index used by all virtio devices are contiguous?