Commit 97ebbab0 authored by Stefan Hajnoczi's avatar Stefan Hajnoczi Committed by Paolo Bonzini
Browse files

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: default avatarNick Thomas <nick@bytemark.co.uk>
Tested-by: default avatarNick Thomas <nick@bytemark.co.uk>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 0fcece25
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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 */