Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Feb 2025 17:59:57 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f9e4eb3e8efc - stable/14 - tcp: fix the initial CWND when a SYN retransmission happened
Message-ID:  <202502051759.515HxvH6062538@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by tuexen:

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

commit f9e4eb3e8efc5a3c7b3c07ba7c894365570c46b9
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2024-11-05 08:52:42 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2025-02-05 07:14:14 +0000

    tcp: fix the initial CWND when a SYN retransmission happened
    
    According to RFC 3390 the CWND should be set to one MSS if the
    SYN or SYN-ACK has been retransmitted. This is handled in the
    code by setting CWND to 1 and cc_conn_init() translates this
    to MSS. Unfortunately, cc_cong_signal() was overwriting the
    special value of 1 in case of a lost SYN, and therefore the
    initial CWND was not as it was supposed to be.
    Fix this by not overwriting the special value of 1.
    
    Reviewed by:            cc, rscheff
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D47439
    
    (cherry picked from commit 625835c8b5e897e54a1a023788a3a9c3b16631c9)
---
 sys/netinet/tcp_timer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c
index ad407d5c111a..65a9fbc84ff7 100644
--- a/sys/netinet/tcp_timer.c
+++ b/sys/netinet/tcp_timer.c
@@ -800,7 +800,9 @@ tcp_timer_rexmt(struct tcpcb *tp)
 	 */
 	tp->t_rtttime = 0;
 
-	cc_cong_signal(tp, NULL, CC_RTO);
+	/* Do not overwrite the snd_cwnd on SYN retransmissions. */
+	if (tp->t_state != TCPS_SYN_SENT)
+		cc_cong_signal(tp, NULL, CC_RTO);
 	NET_EPOCH_ENTER(et);
 	rv = tcp_output_locked(tp);
 	NET_EPOCH_EXIT(et);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502051759.515HxvH6062538>