[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 05/43] nbd: Allow larger requests
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 05/43] nbd: Allow larger requests |
Date: |
Tue, 5 Jul 2016 17:50:14 +0200 |
From: Eric Blake <address@hidden>
The NBD layer was breaking up request at a limit of 2040 sectors
(just under 1M) to cater to old qemu-nbd. But the server limit
was raised to 32M in commit 2d8214885 to match the kernel, more
than three years ago; and the upstream NBD Protocol is proposing
documentation that without any explicit communication to state
otherwise, a client should be able to safely assume that a 32M
transaction will work. It is time to rely on the larger sizing,
and any downstream distro that cares about maximum
interoperability to older qemu-nbd servers can just tweak the
value of #define NBD_MAX_SECTORS.
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Cc: address@hidden
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/nbd-client.c | 4 ----
include/block/nbd.h | 2 ++
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/block/nbd-client.c b/block/nbd-client.c
index 4d13444..420bce8 100644
--- a/block/nbd-client.c
+++ b/block/nbd-client.c
@@ -269,10 +269,6 @@ static int nbd_co_writev_1(BlockDriverState *bs, int64_t
sector_num,
return -reply.error;
}
-/* qemu-nbd has a limit of slightly less than 1M per request. Try to
- * remain aligned to 4K. */
-#define NBD_MAX_SECTORS 2040
-
int nbd_client_co_readv(BlockDriverState *bs, int64_t sector_num,
int nb_sectors, QEMUIOVector *qiov)
{
diff --git a/include/block/nbd.h b/include/block/nbd.h
index df1f804..eeda3eb 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -77,6 +77,8 @@ enum {
/* Maximum size of a single READ/WRITE data buffer */
#define NBD_MAX_BUFFER_SIZE (32 * 1024 * 1024)
+#define NBD_MAX_SECTORS (NBD_MAX_BUFFER_SIZE / BDRV_SECTOR_SIZE)
+
/* Maximum size of an export name. The NBD spec requires 256 and
* suggests that servers support up to 4096, but we stick to only the
* required size so that we can stack-allocate the names, and because
--
1.8.3.1
- [Qemu-block] [PULL 00/43] Block layer patches, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 01/43] qemu-img: fix failed autotests, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 03/43] block: Document supported flags during bdrv_aligned_preadv(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 04/43] block: Fix harmless off-by-one in bdrv_aligned_preadv(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 05/43] nbd: Allow larger requests,
Kevin Wolf <=
- [Qemu-block] [PULL 07/43] iscsi: Advertise realistic limits to block layer, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 02/43] block: Tighter assertions on bdrv_aligned_pwritev(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 08/43] scsi: Advertise limits by blocksize, not 512, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 06/43] nbd: Advertise realistic limits to block layer, Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 09/43] block: Give nonzero result to blk_get_max_transfer_length(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 11/43] iscsi: Set request_alignment during .bdrv_refresh_limits(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 10/43] blkdebug: Set request_alignment during .bdrv_refresh_limits(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 12/43] qcow2: Set request_alignment during .bdrv_refresh_limits(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 13/43] raw-win32: Set request_alignment during .bdrv_refresh_limits(), Kevin Wolf, 2016/07/05
- [Qemu-block] [PULL 16/43] block: Switch transfer length bounds to byte-based, Kevin Wolf, 2016/07/05