From: Jakub Kicinski <kuba@kernel.org>
To: chia-yu.chang@nokia-bell-labs.com
Cc: pabeni@redhat.com, edumazet@google.com, parav@nvidia.com,
linux-doc@vger.kernel.org, corbet@lwn.net, horms@kernel.org,
dsahern@kernel.org, kuniyu@google.com, bpf@vger.kernel.org,
netdev@vger.kernel.org, dave.taht@gmail.com, jhs@mojatatu.com,
stephen@networkplumber.org, xiyou.wangcong@gmail.com,
jiri@resnulli.us, davem@davemloft.net, andrew+netdev@lunn.ch,
donald.hunter@gmail.com, ast@fiberby.net, liuhangbin@gmail.com,
shuah@kernel.org, linux-kselftest@vger.kernel.org, ij@kernel.org,
ncardwell@google.com, koen.de_schepper@nokia-bell-labs.com,
g.white@cablelabs.com, ingemar.s.johansson@ericsson.com,
mirja.kuehlewind@ericsson.com, cheshire@apple.com,
rs.ietf@gmx.at, Jason_Livingood@comcast.com,
vidhi_goel@apple.com
Subject: Re: [PATCH v11 net-next 10/15] tcp: accecn: unset ECT if receive or send ACE=0 in AccECN negotiaion
Date: Tue, 27 Jan 2026 12:09:57 -0800 [thread overview]
Message-ID: <20260127120957.76e52cc5@kernel.org> (raw)
In-Reply-To: <20260123100721.42451-11-chia-yu.chang@nokia-bell-labs.com>
On Fri, 23 Jan 2026 11:07:16 +0100 chia-yu.chang@nokia-bell-labs.com
wrote:
> Based on specification:
> https://tools.ietf.org/id/draft-ietf-tcpm-accurate-ecn-28.txt
>
> Based on Section 3.1.5 of AccECN spec (RFC9768), a TCP Server in
> AccECN mode MUST NOT set ECT on any packet for the rest of the connection,
> if it has received or sent at least one valid SYN or Acceptable SYN/ACK
> with (AE,CWR,ECE) = (0,0,0) during the handshake.
>
> In addition, a host in AccECN mode that is feeding back the IP-ECN
> field on a SYN or SYN/ACK MUST feed back the IP-ECN field on the
> latest valid SYN or acceptable SYN/ACK to arrive.
FWIW this series is marked as Changes Requested in patchwork.
I don't think I did that, IDK why it's in that state :S
I see these warnings when I try to apply it:
Applying: selftests/net: packetdrill: add TCP Accurate ECN cases
.git/rebase-apply/patch:325: new blank line at EOF.
+
.git/rebase-apply/patch:1550: new blank line at EOF.
+
.git/rebase-apply/patch:1641: new blank line at EOF.
+
warning: 3 lines add whitespace errors.
Other than that the AI code review made the following comment,
I haven't investigated the expected behavior. Could you TAL?
> @@ -1103,6 +1104,8 @@ static void reqsk_timer_handler(struct timer_list *t)
> (!resend ||
> !tcp_rtx_synack(sk_listener, req) ||
> inet_rsk(req)->acked)) {
> + if (req->num_retrans > 1 && tcp_rsk(req)->accecn_ok)
> + tcp_rsk(req)->accecn_fail_mode |= TCP_ACCECN_ACE_FAIL_SEND;
Note: This correctly sets the flag on tcp_rsk(req)->accecn_fail_mode,
which will be propagated to the child socket via tcp_ecn_openreq_child().
> diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
[ ... ]
> @@ -481,6 +481,8 @@ static void tcp_ecn_openreq_child(struct sock *sk,
> tp->syn_ect_snt = treq->syn_ect_snt;
> tcp_accecn_third_ack(sk, skb, treq->syn_ect_snt);
> tp->saw_accecn_opt = treq->saw_accecn_opt;
> + if (treq->accecn_fail_mode & TCP_ACCECN_ACE_FAIL_SEND)
> + tcp_accecn_fail_mode_set(tp, TCP_ACCECN_ACE_FAIL_SEND);
This propagates TCP_ACCECN_ACE_FAIL_SEND from the request socket to the
child, but TCP_ACCECN_ACE_FAIL_RECV is not propagated here.
> @@ -749,16 +751,32 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
> */
> if (!tcp_oow_rate_limited(sock_net(sk), skb,
> LINUX_MIB_TCPACKSKIPPEDSYNRECV,
> - &tcp_rsk(req)->last_oow_ack_time) &&
> -
> - !tcp_rtx_synack(sk, req)) {
> - unsigned long expires = jiffies;
> -
> - expires += tcp_reqsk_timeout(req);
> - if (!fastopen)
> - mod_timer_pending(&req->rsk_timer, expires);
> - else
> - req->rsk_timer.expires = expires;
> + &tcp_rsk(req)->last_oow_ack_time)) {
> + if (tcp_rsk(req)->accecn_ok) {
> + u8 ect_rcv = TCP_SKB_CB(skb)->ip_dsfield &
> + INET_ECN_MASK;
> +
> + tcp_rsk(req)->syn_ect_rcv = ect_rcv;
> + if (tcp_accecn_ace(tcp_hdr(skb)) == 0x0) {
> + u8 fail_mode = TCP_ACCECN_ACE_FAIL_RECV;
> +
> + tcp_accecn_fail_mode_set(tcp_sk(sk),
> + fail_mode);
Should this be setting the flag on the request socket instead of the
listener socket? Here tcp_sk(sk) is the listener, but reqsk_timer_handler()
uses tcp_rsk(req)->accecn_fail_mode for the same purpose. The flag set
on the listener socket will not be propagated to the child socket, so
the child may incorrectly set ECT on outgoing packets even after receiving
a SYN with ACE=0.
For consistency with reqsk_timer_handler() and to ensure the flag reaches
the child socket, this might need to be:
tcp_rsk(req)->accecn_fail_mode |= fail_mode;
> + }
> + }
> + if (!tcp_rtx_synack(sk, req)) {
> + unsigned long expires = jiffies;
> +
> + tcp_accecn_ace_fail_send_set_retrans(req,
> + tcp_sk(sk));
Similar question here: tcp_accecn_ace_fail_send_set_retrans() sets the
flag on tcp_sk(sk) (the listener), while reqsk_timer_handler() sets it
on tcp_rsk(req). Is this intentional?
next prev parent reply other threads:[~2026-01-27 20:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 10:07 [PATCH v11 net-next 00/15] AccECN protocol case handling series chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 01/15] tcp: try to avoid safer when ACKs are thinned chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 02/15] gro: flushing when CWR is set negatively affects AccECN chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 03/15] selftests/net: gro: add self-test for TCP CWR flag chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 04/15] tcp: ECT_1_NEGOTIATION and NEEDS_ACCECN identifiers chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 05/15] tcp: disable RFC3168 fallback identifier for CC modules chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 06/15] tcp: accecn: handle unexpected AccECN negotiation feedback chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 07/15] tcp: accecn: retransmit downgraded SYN in AccECN negotiation chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 08/15] tcp: add TCP_SYNACK_RETRANS synack_type chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 09/15] tcp: accecn: retransmit SYN/ACK without AccECN option or non-AccECN SYN/ACK chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 10/15] tcp: accecn: unset ECT if receive or send ACE=0 in AccECN negotiaion chia-yu.chang
2026-01-27 20:09 ` Jakub Kicinski [this message]
2026-01-28 7:44 ` Paolo Abeni
2026-01-23 10:07 ` [PATCH v11 net-next 11/15] tcp: accecn: fallback outgoing half link to non-AccECN chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 12/15] tcp: accecn: detect loss ACK w/ AccECN option and add TCP_ACCECN_OPTION_PERSIST chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 13/15] tcp: accecn: add tcpi_ecn_mode and tcpi_option2 in tcp_info chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 14/15] tcp: accecn: enable AccECN chia-yu.chang
2026-01-23 10:07 ` [PATCH v11 net-next 15/15] selftests/net: packetdrill: add TCP Accurate ECN cases chia-yu.chang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260127120957.76e52cc5@kernel.org \
--to=kuba@kernel.org \
--cc=Jason_Livingood@comcast.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@fiberby.net \
--cc=bpf@vger.kernel.org \
--cc=cheshire@apple.com \
--cc=chia-yu.chang@nokia-bell-labs.com \
--cc=corbet@lwn.net \
--cc=dave.taht@gmail.com \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=g.white@cablelabs.com \
--cc=horms@kernel.org \
--cc=ij@kernel.org \
--cc=ingemar.s.johansson@ericsson.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=koen.de_schepper@nokia-bell-labs.com \
--cc=kuniyu@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=liuhangbin@gmail.com \
--cc=mirja.kuehlewind@ericsson.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=parav@nvidia.com \
--cc=rs.ietf@gmx.at \
--cc=shuah@kernel.org \
--cc=stephen@networkplumber.org \
--cc=vidhi_goel@apple.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox