aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gustafsson <gson@gson.org>2018-03-07 23:26:15 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-05-31 21:19:24 +0200
commitad40ba4b68353b78a9bc822013f26dbc39e96261 (patch)
treeb779cf2a14f0337fe83205ae6ce88355e0d1c2a1
parent55efddd7adf20d5849675179aa5cda87c86ed286 (diff)
downloadslirp-ad40ba4b68353b78a9bc822013f26dbc39e96261.zip
slirp-ad40ba4b68353b78a9bc822013f26dbc39e96261.tar.gz
slirp-ad40ba4b68353b78a9bc822013f26dbc39e96261.tar.bz2
slirp: disable Nagle in outgoing connections
When setting up an outgoing user mode networking TCP connection, disable the Nagle algorithm in the host-side connection. Either the guest is already doing Nagle, in which case there is no point in doing it twice, or it has chosen to disable it, in which case we should respect that choice. This change speeds up GDB remote debugging over TCP over user mode networking (with GDB runing on the guest) by multiple orders of magnitude, and has been part of the local patches applied by pkgsrc since 2012 with no reported ill effects. Signed-off-by: Andreas Gustafsson <gson@gson.org> Reviewed-by: Kamil Rytarowski <n54@gmx.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
-rw-r--r--tcp_subr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tcp_subr.c b/tcp_subr.c
index d72597c..02e7f7c 100644
--- a/tcp_subr.c
+++ b/tcp_subr.c
@@ -414,6 +414,8 @@ int tcp_fconnect(struct socket *so, unsigned short af)
socket_set_fast_reuse(s);
opt = 1;
qemu_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(opt));
+ opt = 1;
+ qemu_setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
addr = so->fhost.ss;
DEBUG_CALL(" connect()ing")