From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XycuL-0002UC-Jw for qemu-devel@nongnu.org; Wed, 10 Dec 2014 03:46:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XycuF-0002kq-G7 for qemu-devel@nongnu.org; Wed, 10 Dec 2014 03:46:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XycuF-0002km-7h for qemu-devel@nongnu.org; Wed, 10 Dec 2014 03:45:59 -0500 Date: Wed, 10 Dec 2014 15:48:06 +0800 From: Fam Zheng Message-ID: <20141210074806.GB32726@ad.nay.redhat.com> References: <1418142410-19057-1-git-send-email-pl@kamp.de> <1418142410-19057-5-git-send-email-pl@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1418142410-19057-5-git-send-email-pl@kamp.de> Subject: Re: [Qemu-devel] [PATCH 4/4] virtio-blk: introduce multiread List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, benoit@irqsave.net, ming.lei@canonical.com, armbru@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, pbonzini@redhat.com, mreitz@redhat.com On Tue, 12/09 17:26, Peter Lieven wrote: > diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h > index 3f2652f..0ee9582 100644 > --- a/include/hw/virtio/virtio-blk.h > +++ b/include/hw/virtio/virtio-blk.h > @@ -134,13 +134,6 @@ typedef struct VirtIOBlock { > struct VirtIOBlockDataPlane *dataplane; > } VirtIOBlock; > > -#define VIRTIO_BLK_MAX_MERGE_REQS 32 > - > -typedef struct MultiReqBuffer { > - BlockRequest blkreq[VIRTIO_BLK_MAX_MERGE_REQS]; > - unsigned int num_writes; > -} MultiReqBuffer; > - > typedef struct VirtIOBlockReq { > VirtIOBlock *dev; > VirtQueueElement elem; > @@ -149,8 +142,21 @@ typedef struct VirtIOBlockReq { > QEMUIOVector qiov; > struct VirtIOBlockReq *next; > BlockAcctCookie acct; > + QEMUIOVector mr_qiov; > + struct VirtIOBlockReq *mr_next; > } VirtIOBlockReq; > > +#define MAX_MERGE_REQS 32 Why do you need to rename this macro after introducing it in previous patch? > + > +typedef struct MultiReqBuffer { > + VirtIOBlockReq *reqs[MAX_MERGE_REQS]; > + unsigned int num_reqs; > + bool is_write; > + int niov; > + int64_t sector_num; > + int nb_sectors; > +} MultiReqBuffer; > + > VirtIOBlockReq *virtio_blk_alloc_request(VirtIOBlock *s); > > void virtio_blk_free_request(VirtIOBlockReq *req); > @@ -160,6 +166,6 @@ int virtio_blk_handle_scsi_req(VirtIOBlock *blk, > > void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb); > > -void virtio_submit_multiwrite(BlockBackend *blk, MultiReqBuffer *mrb); > +void virtio_submit_multireq(BlockBackend *blk, MultiReqBuffer *mrb); > > #endif