svn commit: r366564 - stable/12/sys/netinet/cc

Richard Scheffenegger rscheff at FreeBSD.org
Fri Oct 9 09:33:46 UTC 2020


Author: rscheff
Date: Fri Oct  9 09:33:45 2020
New Revision: 366564
URL: https://svnweb.freebsd.org/changeset/base/366564

Log:
  MFC r366149: TCP newreno: improve after_idle ssthresh
  
  Adjust ssthresh in after_idle to the maximum of
  the prior ssthresh, or 3/4 of the prior cwnd. See
  RFC2861 section 2 for an in depth explanation for
  the rationale around this.
  
  As newreno is the default "fall-through" reaction,
  most tcp variants will benefit from this.
  
  Reviewed by:	tuexen
  MFC after:	2 weeks
  Sponsored by:	NetApp, Inc.
  Differential Revision:	https://reviews.freebsd.org/D22438

Modified:
  stable/12/sys/netinet/cc/cc_newreno.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/cc/cc_newreno.c
==============================================================================
--- stable/12/sys/netinet/cc/cc_newreno.c	Fri Oct  9 05:28:32 2020	(r366563)
+++ stable/12/sys/netinet/cc/cc_newreno.c	Fri Oct  9 09:33:45 2020	(r366564)
@@ -213,12 +213,19 @@ newreno_after_idle(struct cc_var *ccv)
 	 * wirespeed, overloading router and switch buffers along the way.
 	 *
 	 * See RFC5681 Section 4.1. "Restarting Idle Connections".
+	 *
+	 * In addition, per RFC2861 Section 2, the ssthresh is set to the
+	 * maximum of the former ssthresh or 3/4 of the old cwnd, to
+	 * not exit slow-start prematurely.
 	 */
 	if (V_tcp_do_rfc3390)
 		rw = min(4 * CCV(ccv, t_maxseg),
 		    max(2 * CCV(ccv, t_maxseg), 4380));
 	else
 		rw = CCV(ccv, t_maxseg) * 2;
+
+	CCV(ccv, snd_ssthresh) = max(CCV(ccv, snd_ssthresh),
+	    CCV(ccv, snd_cwnd)-(CCV(ccv, snd_cwnd)>>2));
 
 	CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd));
 }


More information about the svn-src-stable mailing list