RE: [PATCH net-next v4 2/4] tcp: rename ECN transmit helper function

From: Chia-Yu Chang (Nokia)

Date: Sun Nov 29 2026 - 11:50:43 EST


> -----Original Message-----
> From: Eric Dumazet <edumazet@xxxxxxxxxx>
> Sent: Thursday, November 19, 2026 8:00 PM
> To: Chia-Yu Chang (Nokia) <chia-yu.chang@xxxxxxxxxxxxxxxxxxx>
> Cc: linux-kernel@xxxxxxxxxxxxxxx; kuba@xxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; pabeni@xxxxxxxxxx; davem@xxxxxxxxxxxxx; kuniyu@xxxxxxxxxx; ij@xxxxxxxxxx; ncardwell@xxxxxxxxxx; koen0607@xxxxxxxxx; g.white@xxxxxxxxxxxxx; ingemar.s.johansson@xxxxxxxxxxxx; mirja.kuehlewind@xxxxxxxxxxxx; cheshire@xxxxxxxxx; rs.ietf@xxxxxx; Jason_Livingood@xxxxxxxxxxx; vidhi_goel@xxxxxxxxx; Mike_Rudolph@xxxxxxxxxxx; Jeff_Howe@xxxxxxxxxxx; srichard@xxxxxxxxxx
> Subject: Re: [PATCH net-next v4 2/4] tcp: rename ECN transmit helper function
>
>
> 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.
>
>
>
> Le jeu. 19 nov. 2026 à 19:01, <chia-yu.chang@xxxxxxxxxxxxxxxxxxx> a écrit :
> >
> > From: Chia-Yu Chang <chia-yu.chang@xxxxxxxxxxxxxxxxxxx>
> >
> > Rename INET_ECN_xmit_ect_1_negotiation() to
> > INET_ECN_xmit_negotiation_ect(). The previous name suggests that the
> > helper always uses ECT(1), while it actually chooses the ECT codepoint
> > to be used during the ECN negotiation.
> >
> > This renaming also prepares for the introduction of a similarly named
> > helper function for established connections in the followup patch.
> >
> > Signed-off-by: Chia-Yu Chang <chia-yu.chang@xxxxxxxxxxxxxxxxxxx>
> >
> > --
> > v3:
> > - Rename helper to better reflect its behavior
> > ---
> > include/net/tcp_ecn.h | 6 +++---
> > net/ipv4/tcp_cong.c | 4 ++--
> > 2 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h index
> > 865d5c5a7718..9ca016d98972 100644
> > --- a/include/net/tcp_ecn.h
> > +++ b/include/net/tcp_ecn.h
> > @@ -33,7 +33,7 @@ enum tcp_accecn_option { };
> >
> > /* Apply either ECT(0) or ECT(1) based on TCP_CONG_ECT_1_NEGOTIATION
> > flag */
>
> While you are renaming it, please expand this comment, it is rather cryptic. Something like :
>
> /**
> * INET_ECN_xmit_negotiation_ect - set the ECT codepoint used before CA init
> * @sk: TCP socket
> *
> * Mark the socket ECN-capable for the packets sent while ECN is still being
> * negotiated (SYN, SYN-ACK), i.e. before tcp_init_congestion_control() runs.
> *
> * The codepoint is chosen by the congestion control module:
> * ECT(1) if it sets TCP_CONG_ECT_1_NEGOTIATION, ECT(0) otherwise.
> *
> * This does not decide whether ECT should be sent at all: callers only use
> * it when the module (TCP_CONG_NEEDS_ECN) or a BPF program asked for ECT
> * on these packets.
> *
> * This changes the socket TOS/tclass, not a single packet, so the codepoint
> * stays in effect until tcp_init_congestion_control() or tcp_ecn_send()
> * selects the one used for the established flow.
> */
>
> The helper added in patch 3 (INET_ECN_xmit_established_ect()) would deserve the same treatment, so that the split between the two is clear.

Yes, this will be added in the next version.

Thanks.
Chia-Yu