Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 May 2019 08:21:27 +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: r347901 - stable/12/sys/netinet/cc
Message-ID:  <201905170821.x4H8LRXg079666@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Fri May 17 08:21:27 2019
New Revision: 347901
URL: https://svnweb.freebsd.org/changeset/base/347901

Log:
  MFC r347381:
  
  Prevent cwnd to collapse down to 1 MSS after exiting recovery.
  
  This is descrined in RFC 6582, which updates RFC 3782.

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

Modified: stable/12/sys/netinet/cc/cc_cubic.c
==============================================================================
--- stable/12/sys/netinet/cc/cc_cubic.c	Fri May 17 08:19:43 2019	(r347900)
+++ stable/12/sys/netinet/cc/cc_cubic.c	Fri May 17 08:21:27 2019	(r347901)
@@ -324,7 +324,12 @@ cubic_post_recovery(struct cc_var *ccv)
 			pipe = CCV(ccv, snd_max) - ccv->curack;
 
 		if (pipe < CCV(ccv, snd_ssthresh))
-			CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg);
+			/*
+			 * Ensure that cwnd does not collapse to 1 MSS under
+			 * adverse conditions. Implements RFC6582
+			 */
+			CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) +
+			    CCV(ccv, t_maxseg);
 		else
 			/* Update cwnd based on beta and adjusted max_cwnd. */
 			CCV(ccv, snd_cwnd) = max(1, ((CUBIC_BETA *

Modified: stable/12/sys/netinet/cc/cc_htcp.c
==============================================================================
--- stable/12/sys/netinet/cc/cc_htcp.c	Fri May 17 08:19:43 2019	(r347900)
+++ stable/12/sys/netinet/cc/cc_htcp.c	Fri May 17 08:21:27 2019	(r347901)
@@ -366,7 +366,12 @@ htcp_post_recovery(struct cc_var *ccv)
 			pipe = CCV(ccv, snd_max) - ccv->curack;
 		
 		if (pipe < CCV(ccv, snd_ssthresh))
-			CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg);
+			/*
+			 * Ensure that cwnd down not collape to 1 MSS under
+			 * adverse conditions. Implements RFC6582
+			 */
+			CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) +
+			    CCV(ccv, t_maxseg);
 		else
 			CCV(ccv, snd_cwnd) = max(1, ((htcp_data->beta *
 			    htcp_data->prev_cwnd / CCV(ccv, t_maxseg))

Modified: stable/12/sys/netinet/cc/cc_newreno.c
==============================================================================
--- stable/12/sys/netinet/cc/cc_newreno.c	Fri May 17 08:19:43 2019	(r347900)
+++ stable/12/sys/netinet/cc/cc_newreno.c	Fri May 17 08:21:27 2019	(r347901)
@@ -299,7 +299,12 @@ newreno_post_recovery(struct cc_var *ccv)
 			pipe = CCV(ccv, snd_max) - ccv->curack;
 
 		if (pipe < CCV(ccv, snd_ssthresh))
-			CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg);
+			/*
+			 * Ensure that cwnd does not collapse to 1 MSS under
+			 * adverse conditons. Implements RFC6582
+			 */
+			CCV(ccv, snd_cwnd) = max(pipe, CCV(ccv, t_maxseg)) +
+			    CCV(ccv, t_maxseg);
 		else
 			CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
 	}



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