From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycm3s-0002f3-0T for qemu-devel@nongnu.org; Mon, 30 Mar 2015 22:37:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ycm3m-0008PM-Ph for qemu-devel@nongnu.org; Mon, 30 Mar 2015 22:37:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycm3m-0008PD-G4 for qemu-devel@nongnu.org; Mon, 30 Mar 2015 22:37:46 -0400 Date: Tue, 31 Mar 2015 10:37:29 +0800 From: Jason Wang Message-Id: <1427769449.11302.4@smtp.corp.redhat.com> In-Reply-To: <20150320123906.74d2c8f5.cornelia.huck@de.ibm.com> References: <1426671309-13645-1-git-send-email-jasowang@redhat.com> <1426671309-13645-15-git-send-email-jasowang@redhat.com> <20150320123906.74d2c8f5.cornelia.huck@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Subject: Re: [Qemu-devel] [PATCH V4 14/19] virtio: introduce vector to virtqueues mapping List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cornelia Huck Cc: qemu-devel@nongnu.org, mst@redhat.com On Fri, Mar 20, 2015 at 7:39 PM, Cornelia Huck wrote: > On Wed, 18 Mar 2015 17:35:04 +0800 > Jason Wang wrote: > >> Currently we will try to traverse all virtqueues to find a subset >> that >> using a specific vector. This is sub optimal when we will support >> hundreds or even thousands of virtqueues. So this patch introduces a >> method which could be used by transport to get all virtqueues that >> using a same vector. This is done through QLISTs and the number of >> QLISTs was queried through a transport specific method. When guest >> setting vectors, the virtqueue will be linked and helpers for >> traverse >> the list was also introduced. >> >> The first user will be virtio pci which will use this to speed up >> MSI-X masking and unmasking handling. >> >> Cc: Michael S. Tsirkin >> Signed-off-by: Jason Wang >> --- >> hw/virtio/virtio-pci.c | 8 ++++++++ >> hw/virtio/virtio.c | 32 >> ++++++++++++++++++++++++++++++-- >> include/hw/virtio/virtio-bus.h | 1 + >> include/hw/virtio/virtio.h | 3 +++ >> 4 files changed, 42 insertions(+), 2 deletions(-) > > I'm still not too happy introducing this overhead for all devices when > only pci will make use of it. > > Could we perhaps make the queue handling dependant on whether the > transport actually provides the query_nvectors callback? Though I don't think it will introduce noticeable overhead. But looks like we can do as you suggest. Will do it in next version. Thanks