From nobody Wed Feb 25 13:03:46 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fLZXg0cGpz6TT88 for ; Wed, 25 Feb 2026 13:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fLZXg039Cz41m0 for ; Wed, 25 Feb 2026 13:03:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772024627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UBgFVGIFeU091Q0f51jps3P6WhIrv47SMbnkQNKXbr4=; b=Tl94Lw2EVKObjt1VUfH5AiuZogKVKZFrsWEibHIs/fAMJuQf4ZHAh3j1GLLLJMsJJe0pqI J120AaygKvWra96lqe1VCVJRl5wtxKgrM7FvbF7T1+dYne0cIcwTFx0xN9PHosScj+soDN siM2zbWthAIaWpPqKWu/lmzPkJKE4yfISpuu/e22iWkZtlWWgywLi+SLApbla8GYLbfbIq kB97yJGajgHSgVnmOJ8QRYRFcanyn4PSBAlHWHah0xCBdI4dPHbAimPIfy2y90aInodpVQ yOKmLI+eJ6TbzobFrCH/UxU++/T8iHRCz/Nt5DNZhVa4Hw9D5rLfP06tJWRT2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1772024627; a=rsa-sha256; cv=none; b=koSQcO8ulGY3oUJ39bgngMkTb9uZG8vKpjV9T4WFEAZJc9UcPGn/XIc4K/BfoaGf5wYJxr Kd9QKdinRYpUBbHCueQ8OAQcSqapJugE2/eZ1bdGoAMecuSd7xpx3zVud6R//+1b9OxdFQ thhb80jdwE9QYASFDhQI8xpG24hPe4RyyGr0olPVlcbP+o9JmKrfF/FbiUcHwm3PJw5lmF HiQjNHVl4H0odqJ+SYkyTVas6r2+CVvSdnrOLIhCCSZWzxF85OYVRslCYMU5q8/wCPal+Z c9dGqDbM/H89mt/C81u0B7bleFRh8ZlIkUHPNgpNCQy31TGolo5vdtapg3LOVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1772024627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UBgFVGIFeU091Q0f51jps3P6WhIrv47SMbnkQNKXbr4=; b=YAztB3iJpCbk52xVeAoWY1QT2D93u/pDbSd4wvLka5G/miaB06RTWAz+ZhKCg8CW3BCuRu f7epdMO7lNrL2gdWWWQzlA3Fz+O0k6ZHDpdMxO7oPSZnf862Fzna9UrIpZpC1jjywzqW+Q VC9TfBnaR7Bmsmyh9+0TGKNa4fJ9a7WlN3raNlBiEZg+0Z/urUF/93BnLlwcvTGHBgjQcR w+RsoiXZgTFm9wk2LMLQDhX3Kx85d/um+Bo5+1cACg/YfqkKmbg0dgqXk7R6VkyBp5mfl5 wMQJvFf6dNmJD78Qpn39KzeZi4oqdcmnbuL8T2z91KhlTi67xhUbBqjaMAgyTQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fLZXf69tBz13K9 for ; Wed, 25 Feb 2026 13:03:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 432c4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 25 Feb 2026 13:03:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Randall Stewart Subject: git: 4e28874a6048 - main - When TCP ECN decides it wants to assure an ACK is sent it needs to do it correctly and with some limits. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rrs X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e28874a6048f3c5a72a42b5bcfcfc7e71cad8a6 Auto-Submitted: auto-generated Date: Wed, 25 Feb 2026 13:03:46 +0000 Message-Id: <699ef332.432c4.5f0d0d29@gitrepo.freebsd.org> The branch main has been updated by rrs: URL: https://cgit.FreeBSD.org/src/commit/?id=4e28874a6048f3c5a72a42b5bcfcfc7e71cad8a6 commit 4e28874a6048f3c5a72a42b5bcfcfc7e71cad8a6 Author: Randall Stewart AuthorDate: 2026-02-25 12:59:04 +0000 Commit: Randall Stewart CommitDate: 2026-02-25 13:03:33 +0000 When TCP ECN decides it wants to assure an ACK is sent it needs to do it correctly and with some limits. So in testing I have found two interesting cases where ECN is going to make it so that an ack will be sent right away. These cases need to be limited to being in the ESTABLISHED state. You don't want ECN sending ACK's when we are transitioning in front or end states. Also we don't start a delayed ack timer at the same time set the ACKNOW flag, thats just plain wrong. Reviewed by: tuexen, rscheff Differential Revision: --- sys/netinet/tcp_ecn.c | 5 ++++- sys/netinet/tcp_input.c | 7 +++++-- sys/netinet/tcp_stacks/rack.c | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_ecn.c b/sys/netinet/tcp_ecn.c index 31b9418c5fc2..fb650831289e 100644 --- a/sys/netinet/tcp_ecn.c +++ b/sys/netinet/tcp_ecn.c @@ -353,7 +353,10 @@ tcp_ecn_input_segment(struct tcpcb *tp, uint16_t thflags, int tlen, int pkts, in } if (thflags & TH_CWR) { tp->t_flags2 &= ~TF2_ECN_SND_ECE; - tp->t_flags |= TF_ACKNOW; + if ((tp->t_state == TCPS_ESTABLISHED) || + (tp->t_state == TCPS_FIN_WAIT_1) || + (tp->t_state == TCPS_FIN_WAIT_2)) + tp->t_flags |= TF_ACKNOW; } if ((iptos & IPTOS_ECN_MASK) == IPTOS_ECN_CE) tp->t_flags2 |= TF2_ECN_SND_ECE; diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index c015995ffc7a..35a9d7633fa7 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -539,9 +539,12 @@ cc_ecnpkt_handler_flags(struct tcpcb *tp, uint16_t flags, uint8_t iptos) CC_ALGO(tp)->ecnpkt_handler(&tp->t_ccv); - if (tp->t_ccv.flags & CCF_ACKNOW) { - tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); + if (((tp->t_state == TCPS_ESTABLISHED) || + (tp->t_state == TCPS_FIN_WAIT_1) || + (tp->t_state == TCPS_FIN_WAIT_2)) && + (tp->t_ccv.flags & CCF_ACKNOW)) { tp->t_flags |= TF_ACKNOW; + tp->t_ccv.flags &= ~CCF_ACKNOW; } } } diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 42c6757b4b2a..78b0026a8c5d 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -15709,6 +15709,8 @@ rack_do_compressed_ack_processing(struct tcpcb *tp, struct socket *so, struct mb tcp_packets_this_ack(tp, ae->ack), ae->codepoint)) rack_cong_signal(tp, CC_ECN, ae->ack, __LINE__); + if (tp->t_flags & TF_ACKNOW) + rack->r_wanted_output = 1; #ifdef TCP_ACCOUNTING /* Count for the specific type of ack in */ if (tp->t_flags2 & TF2_TCP_ACCOUNTING) { @@ -16566,7 +16568,8 @@ rack_do_segment_nounlock(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, tcp_packets_this_ack(tp, th->th_ack), iptos)) rack_cong_signal(tp, CC_ECN, th->th_ack, __LINE__); - + if (tp->t_flags & TF_ACKNOW) + rack->r_wanted_output = 1; /* * If echoed timestamp is later than the current time, fall back to * non RFC1323 RTT calculation. Normalize timestamp if syncookies