git: 1adab814e813 - main - tcp: use tcp_fixed_maxseg instead of tcp_maxseg in cc modules

From: Richard Scheffenegger <rscheff_at_FreeBSD.org>
Date: Thu, 08 Feb 2024 17:39:19 UTC
The branch main has been updated by rscheff:

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

commit 1adab814e8136ec26e8efbdb40e671d943d7fbf0
Author:     Richard Scheffenegger <rscheff@FreeBSD.org>
AuthorDate: 2024-02-08 16:56:29 +0000
Commit:     Richard Scheffenegger <rscheff@FreeBSD.org>
CommitDate: 2024-02-08 17:36:59 +0000

    tcp: use tcp_fixed_maxseg instead of tcp_maxseg in cc modules
    
    tcp_fixed_maxseg() is the streamlined calculation of typical
    tcp options and more suitable for heavy use in the congestion
    control modules on every received packet.
    
    No external functional change.
    
    Reviewed By:           tuexen, #transport
    Sponsored by:          NetApp, Inc.
    Differential Revision: https://reviews.freebsd.org/D43779
---
 sys/netinet/cc/cc.c       | 2 +-
 sys/netinet/cc/cc_cubic.c | 2 +-
 sys/netinet/cc/cc_dctcp.c | 2 +-
 sys/netinet/cc/cc_htcp.c  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c
index ea8cb904c7aa..ff25b8368cc4 100644
--- a/sys/netinet/cc/cc.c
+++ b/sys/netinet/cc/cc.c
@@ -440,7 +440,7 @@ newreno_cc_after_idle(struct cc_var *ccv)
 	 * maximum of the former ssthresh or 3/4 of the old cwnd, to
 	 * not exit slow-start prematurely.
 	 */
-	rw = tcp_compute_initwnd(tcp_maxseg(ccv->ccvc.tcp));
+	rw = tcp_compute_initwnd(tcp_fixed_maxseg(ccv->ccvc.tcp));
 
 	CCV(ccv, snd_ssthresh) = max(CCV(ccv, snd_ssthresh),
 	    CCV(ccv, snd_cwnd)-(CCV(ccv, snd_cwnd)>>2));
diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c
index 7a357e39182e..3f7ba630db5d 100644
--- a/sys/netinet/cc/cc_cubic.c
+++ b/sys/netinet/cc/cc_cubic.c
@@ -423,7 +423,7 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type)
 	u_int mss;
 
 	cubic_data = ccv->cc_data;
-	mss = tcp_maxseg(ccv->ccvc.tcp);
+	mss = tcp_fixed_maxseg(ccv->ccvc.tcp);
 
 	switch (type) {
 	case CC_NDUPACK:
diff --git a/sys/netinet/cc/cc_dctcp.c b/sys/netinet/cc/cc_dctcp.c
index 8084439aafaa..efb8913ec36c 100644
--- a/sys/netinet/cc/cc_dctcp.c
+++ b/sys/netinet/cc/cc_dctcp.c
@@ -245,7 +245,7 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type)
 	if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) {
 		dctcp_data = ccv->cc_data;
 		cwin = CCV(ccv, snd_cwnd);
-		mss = tcp_maxseg(ccv->ccvc.tcp);
+		mss = tcp_fixed_maxseg(ccv->ccvc.tcp);
 
 		switch (type) {
 		case CC_NDUPACK:
diff --git a/sys/netinet/cc/cc_htcp.c b/sys/netinet/cc/cc_htcp.c
index d31720d0099f..c9304fcfc8e5 100644
--- a/sys/netinet/cc/cc_htcp.c
+++ b/sys/netinet/cc/cc_htcp.c
@@ -284,7 +284,7 @@ htcp_cong_signal(struct cc_var *ccv, uint32_t type)
 	u_int mss;
 
 	htcp_data = ccv->cc_data;
-	mss = tcp_maxseg(ccv->ccvc.tcp);
+	mss = tcp_fixed_maxseg(ccv->ccvc.tcp);
 
 	switch (type) {
 	case CC_NDUPACK: