git: a8d2bccb87d0 - main - tcp cc: use tcp_compute_pipe() for pipe in xx_post_recovery() directly

From: Cheng Cui <cc_at_FreeBSD.org>
Date: Mon, 17 Mar 2025 13:01:53 UTC
The branch main has been updated by cc:

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

commit a8d2bccb87d0738c91f7e6a080375ae276e4c7d5
Author:     Cheng Cui <cc@FreeBSD.org>
AuthorDate: 2025-03-05 16:35:20 +0000
Commit:     Cheng Cui <cc@FreeBSD.org>
CommitDate: 2025-03-17 13:00:50 +0000

    tcp cc: use tcp_compute_pipe() for pipe in xx_post_recovery() directly
    
    This follows up with commit 67787d200488, and obsoletes the non-default
    pipe calculation from commit 46f584823798 nearly 25 years ago.
    
    Reviewed by: rscheff
    Differential Revision: https://reviews.freebsd.org/D49247
---
 sys/netinet/cc/cc.c       | 7 +------
 sys/netinet/cc/cc_cubic.c | 8 +-------
 sys/netinet/cc/cc_htcp.c  | 8 +-------
 3 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c
index a34eefcf0066..d85ad4e9f4fd 100644
--- a/sys/netinet/cc/cc.c
+++ b/sys/netinet/cc/cc.c
@@ -401,13 +401,8 @@ newreno_cc_post_recovery(struct cc_var *ccv)
 		 * approximately snd_ssthresh outstanding data. But in case we
 		 * would be inclined to send a burst, better to do it via the
 		 * slow start mechanism.
-		 *
-		 * XXXLAS: Find a way to do this without needing curack
 		 */
-		if (V_tcp_do_newsack)
-			pipe = tcp_compute_pipe(ccv->tp);
-		else
-			pipe = CCV(ccv, snd_max) - ccv->curack;
+		pipe = tcp_compute_pipe(ccv->tp);
 		if (pipe < CCV(ccv, snd_ssthresh))
 			/*
 			 * Ensure that cwnd does not collapse to 1 MSS under
diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c
index 82b0d9b7fa99..a2e72130fa88 100644
--- a/sys/netinet/cc/cc_cubic.c
+++ b/sys/netinet/cc/cc_cubic.c
@@ -530,14 +530,8 @@ cubic_post_recovery(struct cc_var *ccv)
 		 * If inflight data is less than ssthresh, set cwnd
 		 * conservatively to avoid a burst of data, as suggested in
 		 * the NewReno RFC. Otherwise, use the CUBIC method.
-		 *
-		 * XXXLAS: Find a way to do this without needing curack
 		 */
-		if (V_tcp_do_newsack)
-			pipe = tcp_compute_pipe(ccv->tp);
-		else
-			pipe = CCV(ccv, snd_max) - ccv->curack;
-
+		pipe = tcp_compute_pipe(ccv->tp);
 		if (pipe < CCV(ccv, snd_ssthresh))
 			/*
 			 * Ensure that cwnd does not collapse to 1 MSS under
diff --git a/sys/netinet/cc/cc_htcp.c b/sys/netinet/cc/cc_htcp.c
index ab6165f2e720..569495144d50 100644
--- a/sys/netinet/cc/cc_htcp.c
+++ b/sys/netinet/cc/cc_htcp.c
@@ -375,14 +375,8 @@ htcp_post_recovery(struct cc_var *ccv)
 		 * If inflight data is less than ssthresh, set cwnd
 		 * conservatively to avoid a burst of data, as suggested in the
 		 * NewReno RFC. Otherwise, use the HTCP method.
-		 *
-		 * XXXLAS: Find a way to do this without needing curack
 		 */
-		if (V_tcp_do_newsack)
-			pipe = tcp_compute_pipe(ccv->tp);
-		else
-			pipe = CCV(ccv, snd_max) - ccv->curack;
-
+		pipe = tcp_compute_pipe(ccv->tp);
 		if (pipe < CCV(ccv, snd_ssthresh))
 			/*
 			 * Ensure that cwnd down not collape to 1 MSS under