Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 May 2019 10:36:16 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r347095 - in stable/12/sys/netinet: . tcp_stacks
Message-ID:  <201905041036.x44AaGrU013705@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sat May  4 10:36:16 2019
New Revision: 347095
URL: https://svnweb.freebsd.org/changeset/base/347095

Log:
  MFC r344367:
  Use exponential backoff for retransmitting SYN segments as specified
  in the TCP RFCs.
  
  Reviewed by:		rrs@, Richard Scheffenegger
  Sponsored by:		Netflix, Inc.
  Differential Revision:	https://reviews.freebsd.org/D18974

Modified:
  stable/12/sys/netinet/tcp_stacks/rack.c
  stable/12/sys/netinet/tcp_syncache.c
  stable/12/sys/netinet/tcp_timer.c
  stable/12/sys/netinet/tcp_timer.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/tcp_stacks/rack.c
==============================================================================
--- stable/12/sys/netinet/tcp_stacks/rack.c	Sat May  4 10:33:31 2019	(r347094)
+++ stable/12/sys/netinet/tcp_stacks/rack.c	Sat May  4 10:36:16 2019	(r347095)
@@ -2882,7 +2882,7 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *ra
 	TCPSTAT_INC(tcps_rexmttimeo);
 	if ((tp->t_state == TCPS_SYN_SENT) ||
 	    (tp->t_state == TCPS_SYN_RECEIVED))
-		rexmt = MSEC_2_TICKS(RACK_INITIAL_RTO * tcp_syn_backoff[tp->t_rxtshift]);
+		rexmt = MSEC_2_TICKS(RACK_INITIAL_RTO * tcp_backoff[tp->t_rxtshift]);
 	else
 		rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
 	TCPT_RANGESET(tp->t_rxtcur, rexmt,

Modified: stable/12/sys/netinet/tcp_syncache.c
==============================================================================
--- stable/12/sys/netinet/tcp_syncache.c	Sat May  4 10:33:31 2019	(r347094)
+++ stable/12/sys/netinet/tcp_syncache.c	Sat May  4 10:36:16 2019	(r347095)
@@ -155,11 +155,11 @@ static int	 syncookie_cmp(struct in_conninfo *inc, str
 /*
  * Transmit the SYN,ACK fewer times than TCP_MAXRXTSHIFT specifies.
  * 3 retransmits corresponds to a timeout with default values of
- * TCPTV_RTOBASE * (                 1 +
- *                  tcp_syn_backoff[1] +
- *                  tcp_syn_backoff[2] +
- *                  tcp_syn_backoff[3]) + 3 * tcp_rexmit_slop,
- * 3000 ms * (1 + 1 + 1 + 1) +  3 * 200 ms = 12600 ms,
+ * TCPTV_RTOBASE * (             1 +
+ *                  tcp_backoff[1] +
+ *                  tcp_backoff[2] +
+ *                  tcp_backoff[3]) + 3 * tcp_rexmit_slop,
+ * 3000 ms * (1 + 2 + 4 + 8) +  3 * 200 ms = 45600 ms,
  * the odds are that the user has given up attempting to connect by then.
  */
 #define SYNCACHE_MAXREXMTS		3
@@ -426,7 +426,7 @@ syncache_timeout(struct syncache *sc, struct syncache_
 	if (sc->sc_rxmits == 0)
 		rexmt = TCPTV_RTOBASE;
 	else
-		TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_syn_backoff[sc->sc_rxmits],
+		TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_backoff[sc->sc_rxmits],
 		    tcp_rexmit_min, TCPTV_REXMTMAX);
 	sc->sc_rxttime = ticks + rexmt;
 	sc->sc_rxmits++;

Modified: stable/12/sys/netinet/tcp_timer.c
==============================================================================
--- stable/12/sys/netinet/tcp_timer.c	Sat May  4 10:33:31 2019	(r347094)
+++ stable/12/sys/netinet/tcp_timer.c	Sat May  4 10:36:16 2019	(r347095)
@@ -233,9 +233,6 @@ tcp_slowtimo(void)
 	VNET_LIST_RUNLOCK_NOSLEEP();
 }
 
-int	tcp_syn_backoff[TCP_MAXRXTSHIFT + 1] =
-    { 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 64, 64 };
-
 int	tcp_backoff[TCP_MAXRXTSHIFT + 1] =
     { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, 512, 512 };
 
@@ -671,7 +668,7 @@ tcp_timer_rexmt(void * xtp)
 	TCPSTAT_INC(tcps_rexmttimeo);
 	if ((tp->t_state == TCPS_SYN_SENT) ||
 	    (tp->t_state == TCPS_SYN_RECEIVED))
-		rexmt = TCPTV_RTOBASE * tcp_syn_backoff[tp->t_rxtshift];
+		rexmt = TCPTV_RTOBASE * tcp_backoff[tp->t_rxtshift];
 	else
 		rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
 	TCPT_RANGESET(tp->t_rxtcur, rexmt,

Modified: stable/12/sys/netinet/tcp_timer.h
==============================================================================
--- stable/12/sys/netinet/tcp_timer.h	Sat May  4 10:33:31 2019	(r347094)
+++ stable/12/sys/netinet/tcp_timer.h	Sat May  4 10:36:16 2019	(r347095)
@@ -199,7 +199,6 @@ extern int tcp_rexmit_slop;
 extern int tcp_msl;
 extern int tcp_ttl;			/* time to live for TCP segs */
 extern int tcp_backoff[];
-extern int tcp_syn_backoff[];
 extern int tcp_totbackoff;
 extern int tcp_rexmit_drop_options;
 



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