qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
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 V2 2/4] hw/virtio-blk: add a constant for max number of merged requests
Date: Tue, 16 Dec 2014 16:21:25 +0100	[thread overview]
Message-ID: <1418743287-20467-3-git-send-email-pl@kamp.de> (raw)
In-Reply-To: <1418743287-20467-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>
---
 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 b19b102..490f961 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -326,7 +326,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 3979dc4..3f2652f 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.7.9.5

  parent reply	other threads:[~2014-12-16 15:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16 15:21 [Qemu-devel] [PATCH V2 0/4] *virtio-blk: add multiread support Peter Lieven
2014-12-16 15:21 ` [Qemu-devel] [PATCH V2 1/4] block: add accounting for merged requests Peter Lieven
2014-12-16 15:21 ` Peter Lieven [this message]
2014-12-16 15:21 ` [Qemu-devel] [PATCH V2 3/4] block-backend: expose bs->bl.max_transfer_length Peter Lieven
2014-12-16 15:21 ` [Qemu-devel] [PATCH V2 4/4] virtio-blk: introduce multiread Peter Lieven
2014-12-16 15:48 ` [Qemu-devel] [PATCH V2 0/4] *virtio-blk: add multiread support Kevin Wolf
2014-12-16 16:00   ` Peter Lieven
2014-12-18 10:34     ` Kevin Wolf
2014-12-18 14:44       ` Peter Lieven
2014-12-25 14:46       ` Peter Lieven

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=1418743287-20467-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).