svn commit: r347110 - in stable/12: share/man/man4 sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Sat May 4 11:24:21 UTC 2019
Author: tuexen
Date: Sat May 4 11:24:19 2019
New Revision: 347110
URL: https://svnweb.freebsd.org/changeset/base/347110
Log:
MFC r345458:
Add sysctl variable net.inet.tcp.rexmit_initial for setting RTO.Initial
used by TCP.
Reviewed by: rrs@, 0mp@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D19355
Modified:
stable/12/share/man/man4/tcp.4
stable/12/sys/netinet/tcp_subr.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/share/man/man4/tcp.4
==============================================================================
--- stable/12/share/man/man4/tcp.4 Sat May 4 11:21:41 2019 (r347109)
+++ stable/12/share/man/man4/tcp.4 Sat May 4 11:24:19 2019 (r347110)
@@ -34,7 +34,7 @@
.\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
-.Dd August 6, 2018
+.Dd March 23, 2019
.Dt TCP 4
.Os
.Sh NAME
@@ -459,7 +459,7 @@ The actual limit applied to a session's reassembly que
the system-calculated automatic limit and the user-specified
.Va reass.maxqueuelen
limit.
-.It Va rexmit_min , rexmit_slop
+.It Va rexmit_initial , rexmit_min , rexmit_slop
Adjust the retransmit timer calculation for
.Tn TCP .
The slop is
@@ -481,6 +481,7 @@ code.
For this reason, we use 200ms of slop and a near-0
minimum, which gives us an effective minimum of 200ms (similar to
.Tn Linux ) .
+The initial value is used before an RTT measurement has been performed.
.It Va initcwnd_segments
Enable the ability to specify initial congestion window in number of segments.
The default value is 10 as suggested by RFC 6928.
Modified: stable/12/sys/netinet/tcp_subr.c
==============================================================================
--- stable/12/sys/netinet/tcp_subr.c Sat May 4 11:21:41 2019 (r347109)
+++ stable/12/sys/netinet/tcp_subr.c Sat May 4 11:24:19 2019 (r347110)
@@ -1082,6 +1082,9 @@ tcp_init(void)
tcp_keepintvl = TCPTV_KEEPINTVL;
tcp_maxpersistidle = TCPTV_KEEP_IDLE;
tcp_msl = TCPTV_MSL;
+ tcp_rexmit_initial = TCPTV_RTOBASE;
+ if (tcp_rexmit_initial < 1)
+ tcp_rexmit_initial = 1;
tcp_rexmit_min = TCPTV_MIN;
if (tcp_rexmit_min < 1)
tcp_rexmit_min = 1;
@@ -1660,9 +1663,9 @@ tcp_newtcpcb(struct inpcb *inp)
* reasonable initial retransmit time.
*/
tp->t_srtt = TCPTV_SRTTBASE;
- tp->t_rttvar = ((TCPTV_RTOBASE - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4;
+ tp->t_rttvar = ((tcp_rexmit_initial - TCPTV_SRTTBASE) << TCP_RTTVAR_SHIFT) / 4;
tp->t_rttmin = tcp_rexmit_min;
- tp->t_rxtcur = TCPTV_RTOBASE;
+ tp->t_rxtcur = tcp_rexmit_initial;
tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT;
tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT;
tp->t_rcvtime = ticks;
Modified: stable/12/sys/netinet/tcp_syncache.c
==============================================================================
--- stable/12/sys/netinet/tcp_syncache.c Sat May 4 11:21:41 2019 (r347109)
+++ stable/12/sys/netinet/tcp_syncache.c Sat May 4 11:24:19 2019 (r347110)
@@ -155,10 +155,10 @@ 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_backoff[1] +
- * tcp_backoff[2] +
- * tcp_backoff[3]) + 3 * tcp_rexmit_slop,
+ * tcp_rexmit_initial * ( 1 +
+ * tcp_backoff[1] +
+ * tcp_backoff[2] +
+ * tcp_backoff[3]) + 3 * tcp_rexmit_slop,
* 1000 ms * (1 + 2 + 4 + 8) + 3 * 200 ms = 15600 ms,
* the odds are that the user has given up attempting to connect by then.
*/
@@ -424,9 +424,10 @@ syncache_timeout(struct syncache *sc, struct syncache_
int rexmt;
if (sc->sc_rxmits == 0)
- rexmt = TCPTV_RTOBASE;
+ rexmt = tcp_rexmit_initial;
else
- TCPT_RANGESET(rexmt, TCPTV_RTOBASE * tcp_backoff[sc->sc_rxmits],
+ TCPT_RANGESET(rexmt,
+ tcp_rexmit_initial * 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 11:21:41 2019 (r347109)
+++ stable/12/sys/netinet/tcp_timer.c Sat May 4 11:24:19 2019 (r347110)
@@ -110,6 +110,11 @@ int tcp_msl;
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_initial;
+SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_initial, CTLTYPE_INT|CTLFLAG_RW,
+ &tcp_rexmit_initial, 0, sysctl_msec_to_ticks, "I",
+ "Initial Retransmission Timeout");
+
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",
@@ -668,7 +673,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_backoff[tp->t_rxtshift];
+ rexmt = tcp_rexmit_initial * 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 11:21:41 2019 (r347109)
+++ stable/12/sys/netinet/tcp_timer.h Sat May 4 11:24:19 2019 (r347110)
@@ -194,6 +194,7 @@ extern int tcp_keepintvl; /* time between keepalive p
extern int tcp_keepcnt; /* number of keepalives */
extern int tcp_delacktime; /* time before sending a delayed ACK */
extern int tcp_maxpersistidle;
+extern int tcp_rexmit_initial;
extern int tcp_rexmit_min;
extern int tcp_rexmit_slop;
extern int tcp_msl;
More information about the svn-src-stable
mailing list