git: 6c31df0a2faa - stable/14 - tcp: save progress timeout cause in connection end status

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Fri, 31 Oct 2025 19:10:59 UTC
The branch stable/14 has been updated by tuexen:

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

commit 6c31df0a2faad343ae3b0f004ad2c3b55f6eccdd
Author:     Peter Lei <peterlei@netflix.com>
AuthorDate: 2025-10-24 19:47:12 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2025-10-31 14:10:25 +0000

    tcp: save progress timeout cause in connection end status
    
    TCP stats are currently incremented for the persist and progress
    timeout conditions, but only the persist cause was saved in the
    connection end info status, which in turn is logged in the
    blackbox "connection end" event.
    
    Reviewed by:    tuexen
    Sponsored by:   Netflix, Inc.
    
    (cherry picked from commit 1a61a673a3700c0ebdb0c5847b5923d0e3641f89)
---
 sys/netinet/tcp_timer.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index 65a9fbc84ff7..1c687e94bb4a 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -515,9 +515,12 @@ tcp_timer_persist(struct tcpcb *tp)
 	if (progdrop || (tp->t_rxtshift >= V_tcp_retries &&
 	    (ticks - tp->t_rcvtime >= tcp_maxpersistidle ||
 	     ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff))) {
-		if (!progdrop)
+		if (progdrop) {
+			tcp_log_end_status(tp, TCP_EI_STATUS_PROGRESS);
+		} else {
 			TCPSTAT_INC(tcps_persistdrop);
-		tcp_log_end_status(tp, TCP_EI_STATUS_PERSIST_MAX);
+			tcp_log_end_status(tp, TCP_EI_STATUS_PERSIST_MAX);
+		}
 		goto dropit;
 	}
 	/*