diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2013-05-02 14:23:08 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-05-03 13:05:49 +0200 |
commit | 2d8214885942becb8f4371a66d6f8c9a9580108a (patch) | |
tree | 64ed61dd1bc57a8a0e6f7481f84934c90bd9c3f1 /include/block/nbd.h | |
parent | e1adb27a83f19799c454cead7bf930a0b3f2bb28 (diff) |
nbd: support large NBD requests
The Linux nbd driver recently increased the maximum supported request
size up to 32 MB:
commit 078be02b80359a541928c899c2631f39628f56df
Author: Michal Belczyk <belczyk@bsd.krakow.pl>
Date: Tue Apr 30 15:28:28 2013 -0700
nbd: increase default and max request sizes
Raise the default max request size for nbd to 128KB (from 127KB) to get it
4KB aligned. This patch also allows the max request size to be increased
(via /sys/block/nbd<x>/queue/max_sectors_kb) to 32MB.
QEMU's 1 MB buffers are too small to handle these requests.
This patch allocates data buffers dynamically and allows up to 32 MB per
request.
Reported-by: Nick Thomas <nick@bytemark.co.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/block/nbd.h')
-rw-r--r-- | include/block/nbd.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/block/nbd.h b/include/block/nbd.h index 0903d7a603..c90f5e4d9e 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -58,7 +58,8 @@ enum { #define NBD_DEFAULT_PORT 10809 -#define NBD_BUFFER_SIZE (1024*1024) +/* Maximum size of a single READ/WRITE data buffer */ +#define NBD_MAX_BUFFER_SIZE (32 * 1024 * 1024) ssize_t nbd_wr_sync(int fd, void *buffer, size_t size, bool do_read); int tcp_socket_incoming(const char *address, uint16_t port); |