From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHCeo-0008Cq-Ti for qemu-devel@nongnu.org; Fri, 30 Jan 2015 09:34:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YHCek-0003we-2B for qemu-devel@nongnu.org; Fri, 30 Jan 2015 09:34:50 -0500 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:58148 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YHCej-0003wT-O8 for qemu-devel@nongnu.org; Fri, 30 Jan 2015 09:34:45 -0500 From: Peter Lieven Date: Fri, 30 Jan 2015 15:33:00 +0100 Message-Id: <1422628382-3937-3-git-send-email-pl@kamp.de> In-Reply-To: <1422628382-3937-1-git-send-email-pl@kamp.de> References: <1422628382-3937-1-git-send-email-pl@kamp.de> Subject: [Qemu-devel] [PATCH v3 2/4] hw/virtio-blk: add a constant for max number of merged requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, benoit@irqsave.net, ming.lei@canonical.com, Peter Lieven , armbru@redhat.com, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com As it was not obvious (at least for me) where the 32 comes from; add a constant for it. Signed-off-by: Peter Lieven Reviewed-by: Eric Blake --- hw/block/virtio-blk.c | 2 +- include/hw/virtio/virtio-blk.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 4032fca..e04adb8 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -360,7 +360,7 @@ static void virtio_blk_handle_write(VirtIOBlockReq *req, MultiReqBuffer *mrb) block_acct_start(blk_get_stats(req->dev->blk), &req->acct, req->qiov.size, BLOCK_ACCT_WRITE); - if (mrb->num_writes == 32) { + if (mrb->num_writes == VIRTIO_BLK_MAX_MERGE_REQS) { virtio_submit_multiwrite(req->dev->blk, mrb); } diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h index 4652b70..6ef3fa5 100644 --- a/include/hw/virtio/virtio-blk.h +++ b/include/hw/virtio/virtio-blk.h @@ -134,8 +134,10 @@ typedef struct VirtIOBlock { struct VirtIOBlockDataPlane *dataplane; } VirtIOBlock; +#define VIRTIO_BLK_MAX_MERGE_REQS 32 + typedef struct MultiReqBuffer { - BlockRequest blkreq[32]; + BlockRequest blkreq[VIRTIO_BLK_MAX_MERGE_REQS]; unsigned int num_writes; } MultiReqBuffer; -- 1.9.1