[PATCH net-next v3 2/4] tcp: rename ECN transmit helper function
From: chia-yu . chang
Date: Fri Nov 13 2026 - 16:37:00 EST
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 */
-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