slirp: disable Nagle in outgoing connections
PATCH 1/1 slirp: disable Nagle in outgoing connections
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.
--- slirp/tcp_subr.c | 2 ++ 1 file changed, 2 insertions(+)
slirp/tcp_subr.c +2 -0
@@ -416,6 +416,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" )
Signature · 1 line
2.15.1
This patch is correct. LLDB expects 1sec for reply, GDB by default 2.
Debuggers use this option to disable Nagle algorithm in order to quickly transfer messages between gdb-server and gdb-client. It's also fairy portable across systems.
Quoted 8 lines · Andreas Gustafsson
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.
Quoted 6 lines
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 <[email protected]>
Quoted 18 lines
--- slirp/tcp_subr.c | 2 ++ 1 file changed, 2 insertions(+)slirp/tcp_subr.c +2
-0@@ -416,6 +416,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" )
Philippe Mathieu-Daudé
Reviewed-byQuoted 15 lines · Kamil Rytarowski
This patch is correct. LLDB expects 1sec for reply, GDB by default 2.
Debuggers use this option to disable Nagle algorithm in order to quickly transfer messages between gdb-server and gdb-client. It's also fairy portable across systems.
Quoted 8 lines · Andreas Gustafsson
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.
Quoted 8 lines
Quoted 6 lines
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 <[email protected]>Signed-off-by Kamil Rytarowski <[email protected]>
I suppose you meant "Reviewed-by: Kamil Rytarowski <[email protected]>"
Quoted 21 lines
Quoted 19 lines
--- slirp/tcp_subr.c | 2 ++ 1 file changed, 2 insertions(+)slirp/tcp_subr.c +2
-0@@ -416,6 +416,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" )
Quoted 21 lines · Philippe Mathieu-Daudé
Quoted 20 lines · Kamil Rytarowski
This patch is correct. LLDB expects 1sec for reply, GDB by default 2.
Debuggers use this option to disable Nagle algorithm in order to quickly transfer messages between gdb-server and gdb-client. It's also fairy portable across systems.
Quoted 13 lines · Andreas Gustafsson
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.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Andreas Gustafsson <[email protected]>Signed-off-by Kamil Rytarowski <[email protected]>I suppose you meant "Reviewed-by: Kamil Rytarowski <[email protected]>"
Correct!
Quoted 2 lines
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Hello,
Thanks for the Cc.
I have applied it to my tree. I don't think there is any reason to avoid the same change for ingoing connections? Could one of your review the attached patch doing it?
Samuel
commit 99a9a5028e0e15aa3b17d6f884c1e5f48dccea90
Author: Samuel Thibault <[email protected]> Date: Wed Mar 7 23:29:41 2018 +0100
slirp: disable Nagle in ingoing connections
This follows 3929766fb3e4 ('slirp: disable Nagle in outgoing connections'):
for the same reasons, ingoing connections should have the Nagle algorithm disabled.
slirp/socket.c +2 -0
@@ -754,6 +754,8 @@ tcp_listen(Slirp *slirp, uint32_t haddr, u_int hport, uint32_t laddr,return NULL ; }qemu_setsockopt (s,SOL_SOCKET ,SO_OOBINLINE , &opt,sizeof (int )); + opt =1 ; +qemu_setsockopt (s,IPPROTO_TCP ,TCP_NODELAY , &opt,sizeof (int ));getsockname (s,(struct sockaddr *)&addr,&addrlen); so->so_ffamily =AF_INET ;
Philippe Mathieu-Daudé
Reviewed-byQuoted 7 lines · Samuel Thibault
Hello,
Thanks for the Cc.
I have applied it to my tree. I don't think there is any reason to avoid the same change for ingoing connections? Could one of your review the attached patch doing it?
attached patch:
Quoted 3 lines
Samuel
Quoted 1 line · Philippe Mathieu-Daudé, on mer. 07 mars 2018 19:57:28 -0300, wrote:
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Thanks!