This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FreeBSD TCP retransmissions


> Sorry, but this still doesn't apply cleanly:

Fixed.

Thanks,
-- Matt



__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/
Index: current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/ChangeLog,v
retrieving revision 1.34
diff -u -r1.34 ChangeLog
--- current/ChangeLog	15 Oct 2003 13:48:28 -0000	1.34
+++ current/ChangeLog	3 Nov 2003 14:47:50 -0000
@@ -1,3 +1,15 @@
+2003-10-28  Matt Jerdonek  <maj1224@yahoo.com>
+
+	* src/sys/netinet/tcp_output.c (tcp_setpersist): Use variable
+	tcp_rexmit_shift_max instead of TCP_MAXRXTSHIFT
+	* src/sys/netinet/tcp_subr.c (tcp_newtcpcb): Add FreeBSD
+	changes to control minimum retransmit time
+	* src/sys/netinet/tcp_timer.c : Use variable tcp_rexmit_shift_max
+	instead of TCP_MAXRXTSHIFT.  Also add FreeBSD changes to control
+	minimum retransmit time
+	* include/netinet/tcp_timer.h : Add external declarations to 
+	support above.
+	
 2003-10-15  Roland Cassebohm  <roland.cassebohm@visionsystems.de>
 
 	* src/sys/net/if.c (ifinit): Change printf(...) to log(LOG_INIT,...) to
Index: current/include/netinet/tcp_timer.h
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/include/netinet/tcp_timer.h,v
retrieving revision 1.1
diff -u -r1.1 tcp_timer.h
--- current/include/netinet/tcp_timer.h	20 May 2002 22:25:01 -0000	1.1
+++ current/include/netinet/tcp_timer.h	3 Nov 2003 14:47:50 -0000
@@ -145,6 +145,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;       /* min time between retransmissions */
+extern int tcp_rexmit_shift_max; /* maximum retransmission attempts */
 extern int tcp_msl;
 extern int tcp_ttl;			/* time to live for TCP segs */
 extern int tcp_backoff[];
Index: current/src/sys/netinet/tcp_output.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/src/sys/netinet/tcp_output.c,v
retrieving revision 1.2
diff -u -r1.2 tcp_output.c
--- current/src/sys/netinet/tcp_output.c	30 Jul 2003 07:42:32 -0000	1.2
+++ current/src/sys/netinet/tcp_output.c	3 Nov 2003 14:47:50 -0000
@@ -943,6 +943,6 @@
 	TCPT_RANGESET(tt, t * tcp_backoff[tp->t_rxtshift],
 		      TCPTV_PERSMIN, TCPTV_PERSMAX);
 	callout_reset(tp->tt_persist, tt, tcp_timer_persist, tp);
-	if (tp->t_rxtshift < TCP_MAXRXTSHIFT)
+	if (tp->t_rxtshift < tcp_rexmit_shift_max)
 		tp->t_rxtshift++;
 }
Index: current/src/sys/netinet/tcp_subr.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/src/sys/netinet/tcp_subr.c,v
retrieving revision 1.3
diff -u -r1.3 tcp_subr.c
--- current/src/sys/netinet/tcp_subr.c	30 Jul 2003 07:42:32 -0000	1.3
+++ current/src/sys/netinet/tcp_subr.c	3 Nov 2003 14:47:50 -0000
@@ -152,7 +152,7 @@
 static int	tcp_isn_reseed_interval = 0;
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, isn_reseed_interval, CTLFLAG_RW,
     &tcp_isn_reseed_interval, 0, "Seconds between reseeding of ISN secret");
-
+    
 static void	tcp_cleartaocache __P((void));
 static void	tcp_notify __P((struct inpcb *, int));
 
@@ -205,6 +205,7 @@
 	tcp_keepintvl = TCPTV_KEEPINTVL;
 	tcp_maxpersistidle = TCPTV_KEEP_IDLE;
 	tcp_msl = TCPTV_MSL;
+	tcp_rexmit_min = TCPTV_MIN;
 
 	LIST_INIT(&tcb);
 	tcbinfo.listhead = &tcb;
@@ -544,7 +545,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: current/src/sys/netinet/tcp_timer.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/src/sys/netinet/tcp_timer.c,v
retrieving revision 1.2
diff -u -r1.2 tcp_timer.c
--- current/src/sys/netinet/tcp_timer.c	30 Jul 2003 07:42:32 -0000	1.2
+++ current/src/sys/netinet/tcp_timer.c	3 Nov 2003 14:47:50 -0000
@@ -101,6 +101,26 @@
 	*(int *)oidp->oid_arg1 = tt;
         return (0);
 }
+static int
+sysctl_rexmitmax_rangecheck(SYSCTL_HANDLER_ARGS)
+{
+	int error, tt;
+
+	tt = *(int *)oidp->oid_arg1;
+
+	error = sysctl_handle_int(oidp, &tt, 0, req);
+	if (error || !req->newptr)
+		return (error);
+		
+	if (tt > TCP_MAXRXTSHIFT)
+		return (EINVAL);
+		
+	if (tt < 2)
+		return (EINVAL);
+
+	*(int *)oidp->oid_arg1 = tt;
+        return (0);
+}
 #endif
 int	tcp_keepinit;
 SYSCTL_PROC(_net_inet_tcp, TCPCTL_KEEPINIT, keepinit, CTLTYPE_INT|CTLFLAG_RW,
@@ -126,6 +146,14 @@
 static int	always_keepalive = 0;
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW, 
     &always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections");
+    
+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_shift_max = TCP_MAXRXTSHIFT;
+SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_shift_max, CTLTYPE_INT|CTLFLAG_RW,
+    &tcp_rexmit_shift_max, 0, sysctl_rexmitmax_rangecheck, "I", "Maximum TCP retransmissions");    
 
 static int	tcp_keepcnt = TCPTV_KEEPCNT;
 	/* max idle probes */
@@ -337,7 +365,7 @@
 	 * (no responses to probes) reaches the maximum
 	 * backoff that we would use if retransmitting.
 	 */
-	if (tp->t_rxtshift == TCP_MAXRXTSHIFT &&
+	if (tp->t_rxtshift == tcp_rexmit_shift_max &&
 	    ((ticks - tp->t_rcvtime) >= tcp_maxpersistidle ||
 	     (ticks - tp->t_rcvtime) >= TCP_REXMTVAL(tp) * tcp_totbackoff)) {
 		tcpstat.tcps_persistdrop++;
@@ -381,8 +409,8 @@
 	 * been acked within retransmit interval.  Back off
 	 * to a longer retransmit interval and retransmit one segment.
 	 */
-	if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) {
-		tp->t_rxtshift = TCP_MAXRXTSHIFT;
+	if (++tp->t_rxtshift > tcp_rexmit_shift_max) {
+		tp->t_rxtshift = tcp_rexmit_shift_max;
 		tcpstat.tcps_timeoutdrop++;
 		tp = tcp_drop(tp, tp->t_softerror ?
 			      tp->t_softerror : ETIMEDOUT);
@@ -426,7 +454,7 @@
 	 * move the current srtt into rttvar to keep the current
 	 * retransmit times until then.
 	 */
-	if (tp->t_rxtshift > TCP_MAXRXTSHIFT / 4) {
+	if (tp->t_rxtshift > tcp_rexmit_shift_max / 4) {
 #ifdef INET6
 		if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0)
 			in6_losing(tp->t_inpcb);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]