提交 97ebbab0 编写于 作者: S Stefan Hajnoczi 提交者: Paolo Bonzini

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: NNick Thomas <nick@bytemark.co.uk>
Tested-by: NNick Thomas <nick@bytemark.co.uk>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 0fcece25
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册