All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Paul Brook <paul@codesourcery.com>, qemu-devel@nongnu.org
Subject: [Qemu-devel] TCP_NODELAY for -redir
Date: Mon, 13 Nov 2006 14:30:27 -0500	[thread overview]
Message-ID: <20061113193027.GA2729@nevyn.them.org> (raw)

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;

             reply	other threads:[~2006-11-13 19:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-13 19:30 Daniel Jacobowitz [this message]
2006-11-17  2:44 ` [Qemu-devel] TCP_NODELAY for -redir 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061113193027.GA2729@nevyn.them.org \
    --to=drow@false.org \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.