[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <dc03363a-36d0-4a56-9247-baa75d516620@redhat.com>
Date: Mon, 14 Jul 2025 15:10:45 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: chia-yu.chang@...ia-bell-labs.com, edumazet@...gle.com,
linux-doc@...r.kernel.org, corbet@....net, horms@...nel.org,
dsahern@...nel.org, kuniyu@...zon.com, bpf@...r.kernel.org,
netdev@...r.kernel.org, dave.taht@...il.com, jhs@...atatu.com,
kuba@...nel.org, stephen@...workplumber.org, xiyou.wangcong@...il.com,
jiri@...nulli.us, davem@...emloft.net, andrew+netdev@...n.ch,
donald.hunter@...il.com, ast@...erby.net, liuhangbin@...il.com,
shuah@...nel.org, linux-kselftest@...r.kernel.org, ij@...nel.org,
ncardwell@...gle.com, koen.de_schepper@...ia-bell-labs.com,
g.white@...lelabs.com, ingemar.s.johansson@...csson.com,
mirja.kuehlewind@...csson.com, cheshire@...le.com, rs.ietf@....at,
Jason_Livingood@...cast.com, vidhi_goel@...le.com
Cc: Olivier Tilmans <olivier.tilmans@...ia.com>
Subject: Re: [PATCH v12 net-next 06/15] tcp: accecn: AccECN negotiation
On 7/4/25 10:53 AM, chia-yu.chang@...ia-bell-labs.com wrote:
> @@ -375,7 +379,8 @@ struct tcp_sock {
> u8 compressed_ack;
> u8 dup_ack_counter:2,
> tlp_retrans:1, /* TLP is a retransmission */
> - unused:5;
> + syn_ect_snt:2, /* AccECN ECT memory, only */
> + syn_ect_rcv:2; /* ... needed durign 3WHS + first seqno */
Minor nit: typo above: durign -> during
> +/* Infer the ECT value our SYN arrived with from the echoed ACE field */
> +static inline int tcp_accecn_extract_syn_ect(u8 ace)
> {
> - tp->received_ce = 0;
> - tp->received_ce_pending = 0;
> + /* Below is an excerpt from Tables 2 of the AccECN spec:
> + * +================================+========================+
> + * | Echoed ACE field | Received ECT values of |
> + * | AE CWR ECE | our SYN arrived with |
> + * +================================+========================+
> + * | 0 1 0 | Not-ECT |
> + * | 0 1 1 | ECT(1) |
> + * | 1 0 0 | ECT(0) |
> + * | 1 1 0 | CE |
> + * +================================+========================+
> + */
> + if (ace & 0x1)
> + return INET_ECN_ECT_1;
> + if (!(ace & 0x2))
> + return INET_ECN_ECT_0;
> + if (ace & 0x4)
> + return INET_ECN_CE;
> + return INET_ECN_NOT_ECT;
Nit: implementing the above with a static array lookup would probably
make the code simpler/more clear
> +/* Used to form the ACE flags for SYN/ACK */
> +static inline u16 tcp_accecn_reflector_flags(u8 ect)
> +{
> + /* TCP ACE flags of SYN/ACK are set based on IP-ECN codepoint received
> + * from SYN. Below is an excerpt from Table 2 of the AccECN spec:
> + * +====================+====================================+
> + * | IP-ECN codepoint | Respective ACE falgs on SYN/ACK |
> + * | received on SYN | AE CWR ECE |
> + * +====================+====================================+
> + * | Not-ECT | 0 1 0 |
> + * | ECT(1) | 0 1 1 |
> + * | ECT(0) | 1 0 0 |
> + * | CE | 1 1 0 |
> + * +====================+====================================+
> + */
> + u32 flags = ect + 2;
> +
> + if (ect == 3)
> + flags++;
> + return FIELD_PREP(TCPHDR_ACE, flags);
Same here.
> +}
>
> - wire_ace = tp->received_ce + TCP_ACCECN_CEP_INIT_OFFSET;
> - th->ece = !!(wire_ace & 0x1);
> - th->cwr = !!(wire_ace & 0x2);
> - th->ae = !!(wire_ace & 0x4);
> +/* AccECN specificaiton, 3.1.2: If a TCP server that implements AccECN
Minor nit: typo above: specificaiton -> specification
Otherwise LGTM,
Acked-by: Paolo Abeni <pabeni@...hat.com>
Powered by blists - more mailing lists