git: 653cf466f085 - main - hystart++ may not properly exit CSS back to slowstart.

From: Randall Stewart <rrs_at_FreeBSD.org>
Date: Fri, 01 Apr 2022 12:35:38 UTC
The branch main has been updated by rrs:

URL: https://cgit.FreeBSD.org/src/commit/?id=653cf466f08584c0fd87bc336cdc1db08f0d4434

commit 653cf466f08584c0fd87bc336cdc1db08f0d4434
Author:     Randall Stewart <rrs@FreeBSD.org>
AuthorDate: 2022-04-01 12:33:44 +0000
Commit:     Randall Stewart <rrs@FreeBSD.org>
CommitDate: 2022-04-01 12:33:44 +0000

    hystart++ may not properly exit CSS back to slowstart.
    
    In the changes to get hystart++ into cubic an inadvertent line
    was removed in the conditional to figure out if you need to exit
    hystart++ back to slowstart. The line of course is the most crucial
    one (the others are valid but not critical) i.e. is the new rtt
    less than the point where we entered hystart++. Without the line
    we end up bouncing in and out of CSS.
    
    Reported By: Reese Enghardt
    Sponsored By: Netflix Inc.
---
 sys/netinet/cc/cc_cubic.c   | 1 +
 sys/netinet/cc/cc_newreno.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c
index e7d86a25156a..0291776928d4 100644
--- a/sys/netinet/cc/cc_cubic.c
+++ b/sys/netinet/cc/cc_cubic.c
@@ -658,6 +658,7 @@ cubic_rttsample(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32_t
 	}
 	if ((cubicd->css_rttsample_count >= hystart_n_rttsamples) &&
 	    (cubicd->css_current_round_minrtt != 0xffffffff) &&
+	    (cubicd->css_current_round_minrtt < nreno->css_baseline_minrtt) &&
 	    (cubicd->css_lastround_minrtt != 0xffffffff)) {
 		/*
 		 * We were in CSS and the RTT is now less, we
diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c
index 06b53d76d8e9..90895e0f6988 100644
--- a/sys/netinet/cc/cc_newreno.c
+++ b/sys/netinet/cc/cc_newreno.c
@@ -571,6 +571,7 @@ newreno_rttsample(struct cc_var *ccv, uint32_t usec_rtt, uint32_t rxtcnt, uint32
 	}
 	if ((nreno->css_rttsample_count >= hystart_n_rttsamples) &&
 	    (nreno->css_current_round_minrtt != 0xffffffff) &&
+	    (nreno->css_current_round_minrtt < nreno->css_baseline_minrtt) &&
 	    (nreno->css_lastround_minrtt != 0xffffffff)) {
 		/*
 		 * We were in CSS and the RTT is now less, we