From owner-freebsd-net Fri Sep 28 12:43:42 2001 Delivered-To: freebsd-net@freebsd.org Received: from mrout1.yahoo.com (mrout1.yahoo.com [216.145.54.171]) by hub.freebsd.org (Postfix) with ESMTP id 0E7AA37B40F for ; Fri, 28 Sep 2001 12:43:36 -0700 (PDT) Received: from milk.yahoo.com (milk.yahoo.com [216.145.52.137]) by mrout1.yahoo.com (8.11.6/8.11.6/y.out) with ESMTP id f8SJhQf31029; Fri, 28 Sep 2001 12:43:26 -0700 (PDT) Received: (from root@localhost) by milk.yahoo.com (8.11.0/8.11.0) id f8SJhP637382; Fri, 28 Sep 2001 12:43:25 -0700 (PDT) (envelope-from jayanth) Date: Fri, 28 Sep 2001 12:43:25 -0700 From: jayanth 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> References: <200109270652.PAA03232@const.kawasaki.flab.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="NMuMz9nt05w80d4+" Content-Disposition: inline User-Agent: Mutt/1.2i 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 +0900 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --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