git: 7df0ef5f48e1 - main - tcp rack: fix sending

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Fri, 05 Apr 2024 15:50:45 UTC
The branch main has been updated by tuexen:

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

commit 7df0ef5f48e1c67b3f1df7c7964bfa59bc56f4e4
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2024-04-05 15:47:03 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2024-04-05 15:47:03 +0000

    tcp rack: fix sending
    
    In rack_output(), idle is used as a boolean variable. So don't use it
    as an int and don't clear it afterwards.
    This avoids setting idle to false, when it is not intended.
    
    Reported by:            olivier
    Reviewed by:            rrs, rscheff
    MFC after:              3 days
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D44610
---
 sys/netinet/tcp_stacks/rack.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index f89fd46f2a85..ea52eb0a92cd 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -21283,7 +21283,8 @@ rack_output(struct tcpcb *tp)
 	unsigned ipsec_optlen = 0;
 
 #endif
-	int32_t idle, sendalot, tot_idle;
+	int32_t idle, sendalot;
+	uint32_t tot_idle;
 	int32_t sub_from_prr = 0;
 	volatile int32_t sack_rxmit;
 	struct rack_sendmap *rsm = NULL;
@@ -21525,8 +21526,8 @@ rack_output(struct tcpcb *tp)
 	if ((tp->snd_una == tp->snd_max) &&
 	    rack->r_ctl.rc_went_idle_time &&
 	    (cts > rack->r_ctl.rc_went_idle_time)) {
-		tot_idle = idle = (cts - rack->r_ctl.rc_went_idle_time);
-		if (idle > (uint64_t)rack_min_probertt_hold) {
+		tot_idle = (cts - rack->r_ctl.rc_went_idle_time);
+		if (tot_idle > rack_min_probertt_hold) {
 			/* Count as a probe rtt */
 			if (rack->in_probe_rtt == 0) {
 				rack->r_ctl.rc_lower_rtt_us_cts = cts;
@@ -21537,7 +21538,6 @@ rack_output(struct tcpcb *tp)
 				rack_exit_probertt(rack, cts);
 			}
 		}
-		idle = 0;
 	}
 	if(rack->policer_detect_on) {
 		/*