From: Paolo Abeni <pabeni@redhat.com>
To: "Chia-Yu Chang (Nokia)" <chia-yu.chang@nokia-bell-labs.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [v13,net-next,09/15] tcp: accecn: retransmit SYN/ACK without AccECN option or non-AccECN SYN/ACK
Date: Tue, 3 Feb 2026 15:06:44 +0100 [thread overview]
Message-ID: <bce76f46-26cc-4297-952f-4adcdac90c94@redhat.com> (raw)
In-Reply-To: <AS8PR07MB797366B9A7E163A7B88C13C1A39BA@AS8PR07MB7973.eurprd07.prod.outlook.com>
On 2/3/26 2:56 PM, Chia-Yu Chang (Nokia) wrote:
>> -----Original Message-----
>> From: Paolo Abeni <pabeni@redhat.com>
>> Sent: Tuesday, February 3, 2026 1:36 PM
>> To: Chia-Yu Chang (Nokia) <chia-yu.chang@nokia-bell-labs.com>
>> Subject: Re: [v13,net-next,09/15] tcp: accecn: retransmit SYN/ACK without AccECN option or non-AccECN SYN/ACK
>>
>>
>> CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
>>
>>
>>
>> This is an AI-generated review of your patch. The human sending this email has considered the AI review valid, or at least plausible.
>>
>> For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
>> ---
>> tcp: accecn: retransmit SYN/ACK without AccECN option or non-AccECN SYN/ACK
>>
>> For Accurate ECN, the first SYN/ACK sent by the TCP server shall set the ACE flag (Table 1 of RFC9768) and the AccECN option to complete the capability negotiation. However, if the TCP server needs to retransmit such a SYN/ACK (for example, because it did not receive an ACK acknowledging its SYN/ACK, or received a second SYN requesting AccECN support), the TCP server retransmits the SYN/ACK without the AccECN option. This is because the SYN/ACK may be lost due to congestion, or a middlebox may block the AccECN option. Furthermore, if this retransmission also times out, to expedite connection establishment, the TCP server should retransmit the SYN/ACK with (AE,CWR,ECE) = (0,0,0) and without the AccECN option, while maintaining AccECN feedback mode.
>>
>> This complies with Section 3.2.3.2.2 of the AccECN spec RFC9768.
>>
>> This commit fixes a bug but lacks a Fixes: tag. Consider adding:
>>
>> Fixes: b40671b5ee58 ("tcp: accecn: AccECN option failure handling")
>>
>>> diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h index
>>> a709fb1756eb..796c613b5ef3 100644
>>> --- a/include/net/tcp_ecn.h
>>> +++ b/include/net/tcp_ecn.h
>>> @@ -649,12 +649,22 @@ static inline void tcp_ecn_clear_syn(struct sock
>>> *sk, struct sk_buff *skb) }
>>>
>>> static inline void
>>> -tcp_ecn_make_synack(const struct request_sock *req, struct tcphdr
>>> *th)
>>> +tcp_ecn_make_synack(const struct request_sock *req, struct tcphdr *th,
>>> + enum tcp_synack_type synack_type)
>>> {
>>> - if (tcp_rsk(req)->accecn_ok)
>>> - tcp_accecn_echo_syn_ect(th, tcp_rsk(req)->syn_ect_rcv);
>>> - else if (inet_rsk(req)->ecn_ok)
>>> - th->ece = 1;
>>> + /* Accurate ECN shall retransmit SYN/ACK with ACE=0 if the
>>> + * previously retransmitted SYN/ACK also times out.
>>> + */
>>> + if (!req->num_timeout || synack_type != TCP_SYNACK_RETRANS) {
>> ^^^^^^^^^^^^^^^^
>>
>> Does this condition match the intended behavior described in the commit message and code comment?
>>
>> The commit message states the TCP server should first "retransmit the SYN/ACK without the AccECN option" and then "if this retransmission also times out, to expedite connection establishment, the TCP server should retransmit the SYN/ACK with (AE,CWR,ECE) = (0,0,0)."
>>
>> The code comment states "retransmit SYN/ACK with ACE=0 if the previously retransmitted SYN/ACK also times out."
>>
>> Both describe a two-step process:
>> 1. First retransmission (num_timeout=1): without AccECN option, but WITH
>> ACE flags
>> 2. Second retransmission (num_timeout=2): without AccECN option AND with
>> ACE=(0,0,0)
>>
>> However, the condition `!req->num_timeout` evaluates to false when num_timeout >= 1, causing ACE flags to be cleared on the FIRST retransmission, not the second:
>>
>> - First retransmission (num_timeout=1): !1 is false, so we skip the if
>> block and clear ACE flags to (0,0,0) in the else if
>> - Second retransmission (num_timeout=2): !2 is false, same behavior
>>
>> Should the condition be `req->num_timeout < 2` instead to match RFC9768 Section 3.2.3.2.2's requirement that ACE flags are only cleared after the previously retransmitted SYN/ACK times out?
>>
> Hi Paolo,
>
> This is correct because the increment of num_timeout is done after this block.
>
> There are 2 places doing the retransmissnios:
> 1. In tcp_timer.c, you can see that the retrnamission is done via "tcp_rtx_synack(sk, req)" and the counter increase via "req->num_timeout++".
>
> 2. In inet_connection_sock.c, the retrnamission is done via "tcp_rtx_synack(sk_listener, req)", and the counter increases via "if (req->num_timeout++ == 0)"
Ok, I suspected I got lost (and the AI with me). No need to resubmit, I
think we are better of merging as-is.
Thanks,
Paolo
next prev parent reply other threads:[~2026-02-03 14:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-31 22:25 [PATCH v13 net-next 00/15] AccECN protocol case handling series chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 01/15] tcp: try to avoid safer when ACKs are thinned chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 02/15] gro: flushing when CWR is set negatively affects AccECN chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 03/15] selftests/net: gro: add self-test for TCP CWR flag chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 04/15] tcp: ECT_1_NEGOTIATION and NEEDS_ACCECN identifiers chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 05/15] tcp: disable RFC3168 fallback identifier for CC modules chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 06/15] tcp: accecn: handle unexpected AccECN negotiation feedback chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 07/15] tcp: accecn: retransmit downgraded SYN in AccECN negotiation chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 08/15] tcp: add TCP_SYNACK_RETRANS synack_type chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 09/15] tcp: accecn: retransmit SYN/ACK without AccECN option or non-AccECN SYN/ACK chia-yu.chang
[not found] ` <20260203123556.223388-1-pabeni@redhat.com>
[not found] ` <AS8PR07MB797366B9A7E163A7B88C13C1A39BA@AS8PR07MB7973.eurprd07.prod.outlook.com>
2026-02-03 14:06 ` Paolo Abeni [this message]
2026-01-31 22:25 ` [PATCH v13 net-next 10/15] tcp: accecn: unset ECT if receive or send ACE=0 in AccECN negotiaion chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 11/15] tcp: accecn: fallback outgoing half link to non-AccECN chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 12/15] tcp: accecn: detect loss ACK w/ AccECN option and add TCP_ACCECN_OPTION_PERSIST chia-yu.chang
2026-02-01 10:24 ` Eric Dumazet
2026-01-31 22:25 ` [PATCH v13 net-next 13/15] tcp: accecn: add tcpi_ecn_mode and tcpi_option2 in tcp_info chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 14/15] tcp: accecn: enable AccECN chia-yu.chang
2026-01-31 22:25 ` [PATCH v13 net-next 15/15] selftests/net: packetdrill: add TCP Accurate ECN cases chia-yu.chang
2026-02-01 10:26 ` Eric Dumazet
2026-02-03 12:50 ` [PATCH v13 net-next 00/15] AccECN protocol case handling series Paolo Abeni
2026-02-03 14:02 ` Chia-Yu Chang (Nokia)
2026-02-03 14:20 ` patchwork-bot+netdevbpf
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=bce76f46-26cc-4297-952f-4adcdac90c94@redhat.com \
--to=pabeni@redhat.com \
--cc=chia-yu.chang@nokia-bell-labs.com \
--cc=netdev@vger.kernel.org \
/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