From owner-cvs-all Wed Jul 17 22:44:55 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DBAB637B401; Wed, 17 Jul 2002 22:44:39 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8723543E4A; Wed, 17 Jul 2002 22:44:39 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.12.5/8.12.4) with ESMTP id g6I5idCV016067; Wed, 17 Jul 2002 22:44:39 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.5/8.12.4/Submit) id g6I5idxA016066; Wed, 17 Jul 2002 22:44:39 -0700 (PDT) (envelope-from dillon) Date: Wed, 17 Jul 2002 22:44:39 -0700 (PDT) From: Matthew Dillon Message-Id: <200207180544.g6I5idxA016066@apollo.backplane.com> To: Mike Silbersack Cc: cvs-committers@FreeBSD.ORG, Subject: Re: cvs commit: src/sys/netinet tcp_timer.h References: <20020718001924.J83856-100000@patrocles.silby.com> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Here's the proposed patch. -Matt0 Index: tcp_subr.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/tcp_subr.c,v retrieving revision 1.136 diff -u -r1.136 tcp_subr.c --- tcp_subr.c 11 Jul 2002 23:18:43 -0000 1.136 +++ tcp_subr.c 18 Jul 2002 05:34:57 -0000 @@ -196,6 +196,8 @@ tcp_keepintvl = TCPTV_KEEPINTVL; tcp_maxpersistidle = TCPTV_KEEP_IDLE; tcp_msl = TCPTV_MSL; + tcp_rexmit_min = TCPTV_MIN; + tcp_rexmit_slop = TCPTV_CPU_VAR; INP_INFO_LOCK_INIT(&tcbinfo, "tcp"); LIST_INIT(&tcb); @@ -542,7 +544,7 @@ */ tp->t_srtt = TCPTV_SRTTBASE; tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4; - tp->t_rttmin = TCPTV_MIN; + tp->t_rttmin = tcp_rexmit_min; tp->t_rxtcur = TCPTV_RTOBASE; tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT; tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT; Index: tcp_timer.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/tcp_timer.c,v retrieving revision 1.51 diff -u -r1.51 tcp_timer.c --- tcp_timer.c 10 Jun 2002 20:05:38 -0000 1.51 +++ tcp_timer.c 18 Jul 2002 05:34:57 -0000 @@ -109,6 +109,14 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, msl, CTLTYPE_INT|CTLFLAG_RW, &tcp_msl, 0, sysctl_msec_to_ticks, "I", "Maximum segment lifetime"); +int tcp_rexmit_min; +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_min, CTLTYPE_INT|CTLFLAG_RW, + &tcp_rexmit_min, 0, sysctl_msec_to_ticks, "I", "Minimum Retransmission Timeout"); + +int tcp_rexmit_slop; +SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, CTLTYPE_INT|CTLFLAG_RW, + &tcp_rexmit_slop, 0, sysctl_msec_to_ticks, "I", "Retransmission Timer Slop"); + static int always_keepalive = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW, &always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); Index: tcp_timer.h =================================================================== RCS file: /home/ncvs/src/sys/netinet/tcp_timer.h,v retrieving revision 1.20 diff -u -r1.20 tcp_timer.h --- tcp_timer.h 17 Jul 2002 23:32:03 -0000 1.20 +++ tcp_timer.h 18 Jul 2002 05:34:57 -0000 @@ -92,11 +92,18 @@ /* * Minimum retransmit timer is 3 ticks, for algorithmic stability. - * The maximum is 64 seconds. The prior minimum of 1*hz (1 second) badly - * breaks throughput on any networks faster then a modem that has minor - * (e.g. 1%) packet loss. + * TCPT_RANGESET() will add another TCPTV_CPU_VAR to deal with + * the expected worst-case processing variances by the kernels + * representing the end points. Such variances do not always show + * up in the srtt because the timestamp is often calculated at + * the interface rather then at the TCP layer. This value is + * typically 50ms. + * + * The prior minimum of 1*hz (1 second) badly breaks throughput on any + * networks faster then a modem that has minor (e.g. 1%) packet loss. */ #define TCPTV_MIN ( 3 ) /* minimum allowable value */ +#define TCPTV_CPU_VAR ( hz/20 ) /* cpu variance allowed (50ms) */ #define TCPTV_REXMTMAX ( 64*hz) /* max allowable REXMT value */ #define TCPTV_TWTRUNC 8 /* RTO factor to truncate TW */ @@ -116,7 +123,7 @@ * Force a time value to be in a certain range. */ #define TCPT_RANGESET(tv, value, tvmin, tvmax) do { \ - (tv) = (value); \ + (tv) = (value) + tcp_rexmit_slop; \ if ((u_long)(tv) < (u_long)(tvmin)) \ (tv) = (tvmin); \ else if ((u_long)(tv) > (u_long)(tvmax)) \ @@ -130,6 +137,8 @@ extern int tcp_maxidle; /* time to drop after starting probes */ extern int tcp_delacktime; /* time before sending a delayed ACK */ extern int tcp_maxpersistidle; +extern int tcp_rexmit_min; +extern int tcp_rexmit_slop; extern int tcp_msl; extern int tcp_ttl; /* time to live for TCP segs */ extern int tcp_backoff[]; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message