From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRHQp-0006HF-VD for qemu-devel@nongnu.org; Fri, 27 Feb 2015 04:42:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRHQl-0003Lw-Rb for qemu-devel@nongnu.org; Fri, 27 Feb 2015 04:42:03 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:37465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRHQl-0003Lg-IT for qemu-devel@nongnu.org; Fri, 27 Feb 2015 04:41:59 -0500 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Feb 2015 09:41:58 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 5591D17D8056 for ; Fri, 27 Feb 2015 09:42:13 +0000 (GMT) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t1R9ftG14653452 for ; Fri, 27 Feb 2015 09:41:55 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t1R9ftod024539 for ; Fri, 27 Feb 2015 02:41:55 -0700 Date: Fri, 27 Feb 2015 10:41:53 +0100 From: Cornelia Huck Message-ID: <20150227104153.0b06cd7a.cornelia.huck@de.ibm.com> In-Reply-To: <1425008305.3834.5@smtp.corp.redhat.com> References: <1424934286-7099-1-git-send-email-jasowang@redhat.com> <1424934286-7099-5-git-send-email-jasowang@redhat.com> <20150226140212.6c788d52.cornelia.huck@de.ibm.com> <1425008305.3834.5@smtp.corp.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V2 04/11] virtio-ccw: introduce ccw specific queue limit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: Alexander Graf , Richard Henderson , qemu-devel@nongnu.org, Christian Borntraeger , mst@redhat.com On Fri, 27 Feb 2015 03:46:25 +0008 Jason Wang wrote: > On Thu, Feb 26, 2015 at 9:02 PM, Cornelia Huck > wrote: > > On Thu, 26 Feb 2015 15:04:39 +0800 > > Jason Wang wrote: > > > >> Instead of depending on marco, using a bus specific limit. > >> > >> Cc: Alexander Graf > >> Cc: Cornelia Huck > >> Cc: Christian Borntraeger > >> Cc: Richard Henderson > >> Signed-off-by: Jason Wang > >> --- > >> hw/s390x/s390-virtio-ccw.c | 7 +++++-- > >> hw/s390x/virtio-ccw.c | 13 +++++++------ > >> include/hw/virtio/virtio.h | 1 + > >> 3 files changed, 13 insertions(+), 8 deletions(-) > >> > >> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c > >> index 71bafe0..6aeb815 100644 > >> --- a/hw/s390x/s390-virtio-ccw.c > >> +++ b/hw/s390x/s390-virtio-ccw.c > >> @@ -43,6 +43,7 @@ void io_subsystem_reset(void) > >> > >> static int virtio_ccw_hcall_notify(const uint64_t *args) > >> { > >> + VirtIODevice *vdev; > >> uint64_t subch_id = args[0]; > >> uint64_t queue = args[1]; > >> SubchDev *sch; > >> @@ -55,10 +56,12 @@ static int virtio_ccw_hcall_notify(const > >> uint64_t *args) > >> if (!sch || !css_subch_visible(sch)) { > >> return -EINVAL; > >> } > >> - if (queue >= VIRTIO_PCI_QUEUE_MAX) { > >> + > >> + vdev = virtio_ccw_get_vdev(sch); > >> + if (queue >= virtio_get_queue_max(vdev)) { > > > > But we already know we have a virtio_ccw device, right? So why not > > just > > check against VIRTIO_CCW_QUEUE_MAX? > > The problem is whether or not you want to increase the max queue for > ccw. If yes, for migration compatibility, you could not just use a > marco here since legacy machine type will also get increased. Confused. With "legacy machine type", do you mean s390-virtio? It does not register this hcall. > Something > dynamically like this is need so the machine initialization code can > change this limit. I fear I don't understand how the machine code comes into play here. Is the virtio-ccw device code supposed to inherit the limit from the machine? Anyway, if we move the queue limit to the VirtIODevice, checking the limit there instead of using a #define should work out fine.