diff options
author | Stefan Hajnoczi | 2013-04-15 16:14:48 +0200 |
---|---|---|
committer | Paolo Bonzini | 2013-04-15 16:35:17 +0200 |
commit | 97ebbab0e324831dff47dbfa4bed55808cb3ec74 (patch) | |
tree | ad5c8fa8650ae79a6b92eb09e50aa5ac6062fa79 /block/nbd.c | |
parent | nbd: use TCP_CORK in nbd_co_send_request() (diff) | |
download | qemu-97ebbab0e324831dff47dbfa4bed55808cb3ec74.tar.gz qemu-97ebbab0e324831dff47dbfa4bed55808cb3ec74.tar.xz qemu-97ebbab0e324831dff47dbfa4bed55808cb3ec74.zip |
nbd: set TCP_NODELAY
Disable the Nagle algorithm to reduce latency. Note this means we must
also use TCP_CORK when sending header followed by payload to avoid
fragmenting lots of little packets. The previous patch took care of
that.
Suggested-by: Nick Thomas <nick@bytemark.co.uk>
Tested-by: Nick Thomas <nick@bytemark.co.uk>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'block/nbd.c')
-rw-r--r-- | block/nbd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/nbd.c b/block/nbd.c index 485bbf0b81..d9dc454498 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -406,6 +406,9 @@ static int nbd_establish_connection(BlockDriverState *bs) sock = unix_socket_outgoing(qemu_opt_get(s->socket_opts, "path")); } else { sock = tcp_socket_outgoing_opts(s->socket_opts); + if (sock >= 0) { + socket_set_nodelay(sock); + } } /* Failed to establish connection */ |