From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYrWu-0004y3-Cw for qemu-devel@nongnu.org; Fri, 20 Mar 2015 03:39:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYrWq-0003jx-DV for qemu-devel@nongnu.org; Fri, 20 Mar 2015 03:39:40 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:51702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYrWq-0003h4-4m for qemu-devel@nongnu.org; Fri, 20 Mar 2015 03:39:36 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Mar 2015 07:39:33 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 85D591B0804B for ; Fri, 20 Mar 2015 07:39:53 +0000 (GMT) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t2K7dTCV9044462 for ; Fri, 20 Mar 2015 07:39:29 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t2K7dTGd025449 for ; Fri, 20 Mar 2015 01:39:29 -0600 Date: Fri, 20 Mar 2015 08:39:24 +0100 From: Cornelia Huck Message-ID: <20150320083924.7267dfa2.cornelia.huck@de.ibm.com> In-Reply-To: <20150318140614-mutt-send-email-mst@redhat.com> References: <1426671309-13645-1-git-send-email-jasowang@redhat.com> <1426671309-13645-7-git-send-email-jasowang@redhat.com> <20150318140614-mutt-send-email-mst@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V4 06/19] virtio-ccw: using VIRTIO_NO_VECTOR instead of 0 for invalid virtqueue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Christian Borntraeger , Jason Wang , qemu-devel@nongnu.org, Alexander Graf , Richard Henderson On Wed, 18 Mar 2015 14:08:56 +0100 "Michael S. Tsirkin" wrote: > On Wed, Mar 18, 2015 at 05:34:56PM +0800, Jason Wang wrote: > > There's no need to use vector 0 for invalid virtqueue. So this patch > > changes to use VIRTIO_NO_VECTOR instead. > > > > Cc: Michael S. Tsirkin > > Cc: Cornelia Huck > > CC: Christian Borntraeger > > Cc: Richard Henderson > > Cc: Alexander Graf > > Signed-off-by: Jason Wang > > I don't know what does this actually do. > Cornelia? I actually have the same patch somewhere in my queue. The point here is that 0 is plain wrong (it's a valid queue), while VIRTIO_NO_VECTOR is most certainly no valid queue. > > > --- > > hw/s390x/virtio-ccw.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c > > index 130535c..c8b87aa 100644 > > --- a/hw/s390x/virtio-ccw.c > > +++ b/hw/s390x/virtio-ccw.c > > @@ -281,7 +281,7 @@ static int virtio_ccw_set_vqs(SubchDev *sch, uint64_t addr, uint32_t align, > > > > virtio_queue_set_addr(vdev, index, addr); > > if (!addr) { > > - virtio_queue_set_vector(vdev, index, 0); > > + virtio_queue_set_vector(vdev, index, VIRTIO_NO_VECTOR); > > } else { > > /* Fail if we don't have a big enough queue. */ > > /* TODO: Add interface to handle vring.num changing */ > > Right below this, we have > /* tell notify handler in case of config change */ > vdev->config_vector = VIRTIO_PCI_QUEUE_MAX; > > which also does not seem to make sense. Basically we have: - at most 64 virtqueues with their own indicators (always 64 indicator bits when using classic I/O interrupts, up to 64 indicator bits when using adapter interrupts) - another indicator bit for configuration changes (bit 0 of the secondary indicator bits) That way, the configuration change indicator is always one bit behind the last possible queue indicator. > > These changes need some testing though. My identical patch seemed to work for me.