aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2025-01-06 20:38:34 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2025-01-06 20:38:34 +0000
commite8ec28047df5185582a95c5211ed75682fad5ec5 (patch)
treed0cebebc9c918f7a79c46f7e5c1f1c8189cca7f1
parent061727efe1e355fb2fde1b05e92718543d05bfe7 (diff)
TCP RACK: fix TCP_RACK_PACING_BETA socket option
Bring back the code, which was accidentally removed. While there, indent a comment correctly. Reviewed by: rrs CID: 1540026 Fixes: e18b97bd63a8 ("Update to bring the rack stack with all its fixes in.") MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D48340
-rw-r--r--sys/netinet/tcp_stacks/rack.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index 7baf1a626787..f590edd71d9d 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -24486,15 +24486,29 @@ rack_get_sockopt(struct tcpcb *tp, struct sockopt *sopt)
* when you exit recovery.
*/
case TCP_RACK_PACING_BETA:
+ if (strcmp(tp->t_cc->name, CCALGONAME_NEWRENO) != 0)
+ error = EINVAL;
+ else if (rack->rc_pacing_cc_set == 0)
+ optval = rack->r_ctl.rc_saved_beta.beta;
+ else {
+ /*
+ * Reach out into the CC data and report back what
+ * I have previously set. Yeah it looks hackish but
+ * we don't want to report the saved values.
+ */
+ if (tp->t_ccv.cc_data)
+ optval = ((struct newreno *)tp->t_ccv.cc_data)->beta;
+ else
+ error = EINVAL;
+ }
break;
- /*
- * Beta_ecn is the congestion control value for NewReno that influences how
- * much of a backoff happens when a ECN mark is detected. It is normally set
- * to 80 for 80% i.e. the cwnd is reduced by 20% of its previous value when
- * you exit recovery. Note that classic ECN has a beta of 50, it is only
- * ABE Ecn that uses this "less" value, but we do too with pacing :)
- */
-
+ /*
+ * Beta_ecn is the congestion control value for NewReno that influences how
+ * much of a backoff happens when a ECN mark is detected. It is normally set
+ * to 80 for 80% i.e. the cwnd is reduced by 20% of its previous value when
+ * you exit recovery. Note that classic ECN has a beta of 50, it is only
+ * ABE Ecn that uses this "less" value, but we do too with pacing :)
+ */
case TCP_RACK_PACING_BETA_ECN:
if (strcmp(tp->t_cc->name, CCALGONAME_NEWRENO) != 0)
error = EINVAL;