Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Sep 2001 12:43:25 -0700
From:      jayanth <jayanth@yahoo-inc.com>
To:        tsuchiya@flab.fujitsu.co.jp
Cc:        jayanth@yahoo-inc.com, net@FreeBSD.ORG, silby@silby.com, jlemon@flugsvamp.com
Subject:   Re: TCP performance question
Message-ID:  <20010928124325.B36879@yahoo-inc.com>
In-Reply-To: <200109270652.PAA03232@const.kawasaki.flab.fujitsu.co.jp>; from tsuchiya@flab.fujitsu.co.jp on Thu, Sep 27, 2001 at 03:52:15PM %2B0900
References:  <200109270652.PAA03232@const.kawasaki.flab.fujitsu.co.jp>

next in thread | previous in thread | raw e-mail | index | archive | help

--NMuMz9nt05w80d4+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Yoshi,
I have attached a patch. Let me know if this fixes the problem.

jayanth



tsuchiya@flab.fujitsu.co.jp (tsuchiya@flab.fujitsu.co.jp) wrote:
> 
> >	This issue is a combination of mbuf cluster size and the 
> >	TF_MORETOCOME flag.
> 
> >	        if (len) {
> >	                if (len == tp->t_maxseg)
> >	                        goto send;
> >	                if (!(tp->t_flags & TF_MORETOCOME) &&
> >	                    (idle || tp->t_flags & TF_NODELAY) &&
> >	                    (tp->t_flags & TF_NOPUSH) == 0 &&
> >	                    len + off >= so->so_snd.sb_cc)
> >	                        goto send;
> 
> When I changed the condition, the problem we had did not occur. I am wondering
> what is the right fix.
> Yoshi
> 
> 

--NMuMz9nt05w80d4+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="idle.patch"

--- tcp_output.c	Fri Sep 28 11:15:32 2001
+++ tcp_output.c.new	Fri Sep 28 12:05:03 2001
@@ -133,7 +133,7 @@
 	 * If there is some data or critical controls (SYN, RST)
 	 * to send, then transmit; otherwise, investigate further.
 	 */
-	idle = (tp->snd_max == tp->snd_una);
+	idle = (tp->t_flags & TF_LASTIDLE) ? 1 : (tp->snd_max == tp->snd_una);
 	if (idle && (ticks - tp->t_rcvtime) >= tp->t_rxtcur) {
 		/*
 		 * We have been idle for "a while" and no acks are
@@ -156,6 +156,13 @@
 			tp->snd_cwnd = tp->t_maxseg * ss_fltsz_local;
 		else     
 			tp->snd_cwnd = tp->t_maxseg * ss_fltsz;
+	}
+	tp->t_flags &= ~TF_LASTIDLE;
+	if (idle) {
+		if (tp->t_flags & TF_MORETOCOME) {
+			tp->t_flags |= TF_LASTIDLE;
+			idle = 0;
+		}
 	}
 again:
 	sendalot = 0;
--- tcp_var.h	Fri Sep 28 11:11:48 2001
+++ tcp_var.h.new	Fri Sep 28 12:04:09 2001
@@ -95,6 +95,7 @@
 #define	TF_SENDCCNEW	0x08000		/* send CCnew instead of CC in SYN */
 #define	TF_MORETOCOME	0x10000		/* More data to be appended to sock */
 #define	TF_LQ_OVERFLOW	0x20000		/* listen queue overflow */
+#define	TF_LASTIDLE	0x40000		/* idle, when previously called */
 	int	t_force;		/* 1 if forcing out a byte */
 
 	tcp_seq	snd_una;		/* send unacknowledged */

--NMuMz9nt05w80d4+--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010928124325.B36879>