qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] TCP_NODELAY for -redir
@ 2006-11-13 19:30 Daniel Jacobowitz
  2006-11-17  2:44 ` Daniel Jacobowitz
  2006-12-19  3:23 ` [Qemu-devel] TCP_NODELAY for -redir Daniel Jacobowitz
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2006-11-13 19:30 UTC (permalink / raw)
  To: Paul Brook, qemu-devel

I was trying to run GDB remote debug tests through a -redir socket
today.  It crawled unbelievably.  Paul guessed that slirp wasn't using
TCP_NODELAY, and Nagle was to blame.

He was even righter than usual.  Adding TCP_NODELAY speeds up this
particular workload by (very approximately) 54x.  See trivial attached
patch.

Is this going to bite other things, i.e. does it need to be
configurable?

-- 
Daniel Jacobowitz
CodeSourcery

---
 slirp/tcp.h      |    2 +-
 slirp/tcp_subr.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

Index: qemu/slirp/tcp.h
===================================================================
--- qemu.orig/slirp/tcp.h	2006-11-13 14:25:24.000000000 -0500
+++ qemu/slirp/tcp.h	2006-11-13 14:25:29.000000000 -0500
@@ -112,7 +112,7 @@ struct tcphdr {
 /*
  * User-settable options (used with setsockopt).
  */
-/* #define	TCP_NODELAY	0x01 */	/* don't delay send to coalesce packets */
+#define	TCP_NODELAY	0x01	/* don't delay send to coalesce packets */
 /* #define	TCP_MAXSEG	0x02 */	/* set maximum segment size */
 
 /*
Index: qemu/slirp/tcp_subr.c
===================================================================
--- qemu.orig/slirp/tcp_subr.c	2006-11-13 14:22:34.000000000 -0500
+++ qemu/slirp/tcp_subr.c	2006-11-13 14:23:31.000000000 -0500
@@ -499,6 +499,8 @@ tcp_connect(inso)
 	setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int));
 	opt = 1;
 	setsockopt(s,SOL_SOCKET,SO_OOBINLINE,(char *)&opt,sizeof(int));
+	opt = 1;
+	setsockopt(s,IPPROTO_TCP,TCP_NODELAY,(char *)&opt,sizeof(int));
 	
 	so->so_fport = addr.sin_port;
 	so->so_faddr = addr.sin_addr;

^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: [Qemu-devel] TCP_NODELAY for -redir
@ 2006-11-17 12:06 Wessel, Jason
  0 siblings, 0 replies; 5+ messages in thread
From: Wessel, Jason @ 2006-11-17 12:06 UTC (permalink / raw)
  To: qemu-devel

I am in total agreement with the change. :-)

Jason. 

> -----Original Message-----
> From: 
> qemu-devel-bounces+jason.wessel=windriver.com@nongnu.org 
> [mailto:qemu-devel-bounces+jason.wessel=windriver.com@nongnu.o
> rg] On Behalf Of Daniel Jacobowitz
> Sent: Thursday, November 16, 2006 8:44 PM
> To: qemu-devel@nongnu.org
> Subject: Re: [Qemu-devel] TCP_NODELAY for -redir
> 
> On Mon, Nov 13, 2006 at 02:30:27PM -0500, Daniel Jacobowitz wrote:
> > I was trying to run GDB remote debug tests through a -redir socket 
> > today.  It crawled unbelievably.  Paul guessed that slirp 
> wasn't using 
> > TCP_NODELAY, and Nagle was to blame.
> > 
> > He was even righter than usual.  Adding TCP_NODELAY speeds up this 
> > particular workload by (very approximately) 54x.  See 
> trivial attached 
> > patch.
> > 
> > Is this going to bite other things, i.e. does it need to be 
> > configurable?
> 
> No comments on this...
> 
> My reasoning, by the way, was that slirp is being used as a 
> TCP-to-TCP gateway.  I think that if we were to use nagle 
> here, we'd end up doing it twice: once at the sender inside 
> the guest, and once again on the host's TCP stack.  Using 
> TCP_NODELAY lets the guest take responsibility.
> 
> 
> --
> Daniel Jacobowitz
> CodeSourcery
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-12-19  3:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-13 19:30 [Qemu-devel] TCP_NODELAY for -redir Daniel Jacobowitz
2006-11-17  2:44 ` Daniel Jacobowitz
2006-11-17 14:33   ` [Qemu-devel] PPC Bug Report - Trap Exception setting SRR0 incorrectly Ely Soto
2006-12-19  3:23 ` [Qemu-devel] TCP_NODELAY for -redir Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2006-11-17 12:06 Wessel, Jason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).