From: Rusty Russell <rusty@rustcorp.com.au>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>,
Anthony Liguori <aliguori@us.ibm.com>,
virtualization@lists.linux-foundation.org
Subject: [PATCH 1/2] virtio: block: set max_segment_size and max_sectors to infinite.
Date: Mon, 17 Nov 2008 17:24:15 +1030 [thread overview]
Message-ID: <200811171724.15682.rusty@rustcorp.com.au> (raw)
In-Reply-To: <200811171722.43792.rusty@rustcorp.com.au>
Setting max_segment_size allows more than 64k per sg element, unless
the host specified a limit. Setting max_sectors indicates that our
max_hw_segments is the only limit.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
diff -r 446171198334 drivers/block/virtio_blk.c
--- a/drivers/block/virtio_blk.c Mon Nov 17 08:34:57 2008 +1030
+++ b/drivers/block/virtio_blk.c Mon Nov 17 17:16:35 2008 +1030
@@ -277,6 +277,9 @@
}
set_capacity(vblk->disk, cap);
+ /* No real sector limit. */
+ blk_queue_max_sectors(vblk->disk->queue, -1U);
+
/* Host can optionally specify maximum segment size and number of
* segments. */
err = virtio_config_val(vdev, VIRTIO_BLK_F_SIZE_MAX,
@@ -284,6 +287,8 @@
&v);
if (!err)
blk_queue_max_segment_size(vblk->disk->queue, v);
+ else
+ blk_queue_max_segment_size(vblk->disk->queue, -1UL);
err = virtio_config_val(vdev, VIRTIO_BLK_F_SEG_MAX,
offsetof(struct virtio_blk_config, seg_max),
next prev parent reply other threads:[~2008-11-17 6:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200811141215.33950.rusty@rustcorp.com.au>
[not found] ` <20081114093023.GQ26778@kernel.dk>
2008-11-17 6:52 ` [PATCH RFC] virtio: use QUEUE_FLAG_CLUSTER in virtio_blk Rusty Russell
2008-11-17 6:54 ` Rusty Russell [this message]
2008-11-17 7:04 ` [PATCH 2/2] virtio: block: dynamic maximum segments Rusty Russell
2008-11-26 17:42 ` [PATCH 1/2] virtio: block: set max_segment_size and max_sectors to infinite Chris Wright
2008-11-27 13:00 ` Rusty Russell
2008-11-27 13:04 ` Jens Axboe
2008-12-03 18:43 ` Chris Wright
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=200811171724.15682.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=aliguori@us.ibm.com \
--cc=jens.axboe@oracle.com \
--cc=kvm-devel@lists.sourceforge.net \
--cc=virtualization@lists.linux-foundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.