From: Peter Lieven <pl@kamp.de>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, famz@redhat.com, benoit@irqsave.net,
ming.lei@canonical.com, Peter Lieven <pl@kamp.de>,
armbru@redhat.com, mreitz@redhat.com, stefanha@redhat.com,
pbonzini@redhat.com
Subject: [Qemu-devel] [PATCH v4 2/5] hw/virtio-blk: add a constant for max number of merged requests
Date: Mon, 2 Feb 2015 14:52:19 +0100 [thread overview]
Message-ID: <1422885142-6391-3-git-send-email-pl@kamp.de> (raw)
In-Reply-To: <1422885142-6391-1-git-send-email-pl@kamp.de>
As it was not obvious (at least for me) where the 32 comes from;
add a constant for it.
Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
---
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
next prev parent reply other threads:[~2015-02-02 13:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-02 13:52 [Qemu-devel] [PATCH v4 0/5] this series adds the long missing multiread support to virtio-blk Peter Lieven
2015-02-02 13:52 ` [Qemu-devel] [PATCH v4 1/5] block: add accounting for merged requests Peter Lieven
2015-02-02 13:52 ` Peter Lieven [this message]
2015-02-02 13:52 ` [Qemu-devel] [PATCH v4 3/5] block-backend: expose bs->bl.max_transfer_length Peter Lieven
2015-02-02 13:52 ` [Qemu-devel] [PATCH v4 4/5] virtio-blk: introduce multiread Peter Lieven
2015-02-02 13:52 ` [Qemu-devel] [PATCH v4 5/5] virtio-blk: add a knob to disable request merging Peter Lieven
2015-02-02 16:09 ` [Qemu-devel] [PATCH v4 0/5] this series adds the long missing multiread support to virtio-blk Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1422885142-6391-3-git-send-email-pl@kamp.de \
--to=pl@kamp.de \
--cc=armbru@redhat.com \
--cc=benoit@irqsave.net \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=ming.lei@canonical.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).