Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Eric Dumazet
Thu, 19 Nov 2026 18:59
Re: [PATCH net-next v4 2/4] tcp: rename ECN transmit helper function
Author: Eric Dumazet
Date: Thu, 19 Nov 2026 18:59
Date: Thu, 19 Nov 2026 18:59
115 lines
13293 bytes
13293 bytes
Le jeu. 19 nov. 2026 ร 19:01, <chia-yu.chang@nokia-bell-labs.com> a รฉcrit :
>
> From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
>
> 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@nokia-bell-labs.com>
>
> --
> 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.
> -static inline void INET_ECN_xmit_ect_1_negotiation(struct sock *sk)
> +static inline void INET_ECN_xmit_negotiation_ect(struct sock *sk)
> {
> __INET_ECN_xmit(sk, tcp_ca_ect_1_negotiation(sk));
> }
> @@ -583,7 +583,7 @@ static inline void tcp_ecn_send_synack(struct sock *sk, struct sk_buff *skb)
> TCP_SKB_CB(skb)->tcp_flags &= ~TCPHDR_ECE;
> else if (tcp_ca_needs_ecn(sk) ||
> tcp_bpf_ca_needs_ecn(sk))
> - INET_ECN_xmit_ect_1_negotiation(sk);
> + INET_ECN_xmit_negotiation_ect(sk);
>
> if (tp->ecn_flags & TCP_ECN_MODE_ACCECN) {
> TCP_SKB_CB(skb)->tcp_flags &= ~TCPHDR_ACE;
> @@ -618,7 +618,7 @@ static inline void tcp_ecn_send_syn(struct sock *sk, struct sk_buff *skb)
>
> if (use_ecn) {
> if (tcp_ca_needs_ecn(sk) || bpf_needs_ecn)
> - INET_ECN_xmit_ect_1_negotiation(sk);
> + INET_ECN_xmit_negotiation_ect(sk);
>
> TCP_SKB_CB(skb)->tcp_flags |= TCPHDR_ECE | TCPHDR_CWR;
> if (use_accecn) {
> diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
> index e3f462f161dd..3331679c81d7 100644
> --- a/net/ipv4/tcp_cong.c
> +++ b/net/ipv4/tcp_cong.c
> @@ -228,7 +228,7 @@ void tcp_assign_congestion_control(struct sock *sk)
>
> memset(icsk->icsk_ca_priv, 0, sizeof(icsk->icsk_ca_priv));
> if (ca->flags & TCP_CONG_NEEDS_ECN)
> - INET_ECN_xmit_ect_1_negotiation(sk);
> + INET_ECN_xmit_negotiation_ect(sk);
> else
> INET_ECN_dontxmit(sk);
> }
> @@ -258,7 +258,7 @@ static void tcp_reinit_congestion_control(struct sock *sk,
> memset(icsk->icsk_ca_priv, 0, sizeof(icsk->icsk_ca_priv));
>
> if (ca->flags & TCP_CONG_NEEDS_ECN)
> - INET_ECN_xmit_ect_1_negotiation(sk);
> + INET_ECN_xmit_negotiation_ect(sk);
> else
> INET_ECN_dontxmit(sk);
>
> --
> 2.34.1
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads