git: 9f6942484963 - stable/14 - tcp rack: fix sendmap app limited count tracking
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 05 Sep 2025 17:34:44 UTC
The branch stable/14 has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=9f6942484963cb9f45b141eec89c5d9f1ed5db92
commit 9f6942484963cb9f45b141eec89c5d9f1ed5db92
Author: Peter Lei <peterlei@netflix.com>
AuthorDate: 2025-07-21 07:56:03 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2025-09-05 13:28:21 +0000
tcp rack: fix sendmap app limited count tracking
rc_app_limited_cnt is an internal counter on the rack structure
that tracks the number of sendmap entries that have the
RACK_APP_LIMITED flag set. These entries gate goodput measurements.
The counter is reported in a number of blackbox logging events.
When a sendmap entry which has the RACK_APP_LIMITED flag set is
cloned, the counter was not being maintained properly.
While here, cleanup the counter check when a sendmap entry with
the flag set is freed which previously hid this issue.
Reviewed by: tuexen
Sponsored by: Netflix, Inc.
(cherry picked from commit e0838f8a2e61e73e37c1ae08eab9473daacaacb8)
---
sys/netinet/tcp_stacks/rack.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index f90b747cc2e4..e7226a5bcf87 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -3468,9 +3468,9 @@ static void
rack_free(struct tcp_rack *rack, struct rack_sendmap *rsm)
{
if (rsm->r_flags & RACK_APP_LIMITED) {
- if (rack->r_ctl.rc_app_limited_cnt > 0) {
- rack->r_ctl.rc_app_limited_cnt--;
- }
+ KASSERT((rack->r_ctl.rc_app_limited_cnt > 0),
+ ("app_cnt %u, rsm %p", rack->r_ctl.rc_app_limited_cnt, rsm));
+ rack->r_ctl.rc_app_limited_cnt--;
}
if (rsm->r_limit_type) {
/* currently there is only one limit type */
@@ -7208,6 +7208,9 @@ rack_clone_rsm(struct tcp_rack *rack, struct rack_sendmap *nrsm,
/* Push bit must go to the right edge as well */
if (rsm->r_flags & RACK_HAD_PUSH)
rsm->r_flags &= ~RACK_HAD_PUSH;
+ /* Update the count if app limited */
+ if (nrsm->r_flags & RACK_APP_LIMITED)
+ rack->r_ctl.rc_app_limited_cnt++;
/* Clone over the state of the hw_tls flag */
nrsm->r_hw_tls = rsm->r_hw_tls;
/*