The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/4] TCP Prague preparation series
@ 2026-11-13 12:56 chia-yu.chang
  2026-11-13 12:56 ` [PATCH net-next v3 1/4] tcp: export CE count in rate_sample chia-yu.chang
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: chia-yu.chang @ 2026-11-13 12:56 UTC (permalink / raw)
  To: linux-kernel, kuba, netdev, pabeni, davem, edumazet, kuniyu, ij,
	ncardwell, koen0607, g.white, ingemar.s.johansson,
	mirja.kuehlewind, cheshire, rs.ietf, Jason_Livingood, vidhi_goel,
	Mike_Rudolph, Jeff_Howe, srichard
  Cc: Chia-Yu Chang

From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

Hello,

Please find the v3 TCP Prague preparation series, and TCP Prague will
be submitted after this series.

This patch includes the following additions:
(1) Add ece_delta to rate_sample;
(2) Rename existing rename ECN transmit helper function;
(3) Add TCP_ECN_SEND_ECT_1 to use ECT_1 after negotiation;
(4) Add MSS ceiling callback for congestion control to limit MSS.

Best regards,
Chia-Yu

---
Chia-Yu Chang (3):
  tcp: rename ECN transmit helper function
  tcp: add TCP_ECN_SEND_ECT_1 flag for congestion control
  tcp: add MSS ceiling callback for congestion control

Ilpo Järvinen (1):
  tcp: export CE count in rate_sample

 include/net/tcp.h     |  6 ++++++
 include/net/tcp_ecn.h | 12 +++++++++---
 net/ipv4/tcp_cong.c   |  8 +++++---
 net/ipv4/tcp_input.c  | 40 +++++++++++++++++++---------------------
 net/ipv4/tcp_output.c | 18 +++++++++++++++++-
 5 files changed, 56 insertions(+), 28 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net-next v3 1/4] tcp: export CE count in rate_sample
  2026-11-13 12:56 [PATCH net-next v3 0/4] TCP Prague preparation series chia-yu.chang
@ 2026-11-13 12:56 ` chia-yu.chang
  2026-11-13 12:56 ` [PATCH net-next v3 2/4] tcp: rename ECN transmit helper function chia-yu.chang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: chia-yu.chang @ 2026-11-13 12:56 UTC (permalink / raw)
  To: linux-kernel, kuba, netdev, pabeni, davem, edumazet, kuniyu, ij,
	ncardwell, koen0607, g.white, ingemar.s.johansson,
	mirja.kuehlewind, cheshire, rs.ietf, Jason_Livingood, vidhi_goel,
	Mike_Rudolph, Jeff_Howe, srichard
  Cc: Olivier Tilmans, Chia-Yu Chang

From: Ilpo Järvinen <ij@kernel.org>

Store the number of newly ACKed/SACKed CE-marked packets in rate_sample.
This will be used by upcoming congestion control algorithms, e.g.,
TCP Prague, that need access to AccECN-derived congestion info.

For RFC3168 ECN mode, acked_sacked_ce equals delivered when FLAG_ECE
is present. For AccECN mode, it carries the derived CE-marked packets
from AccECN options or ACE field based on RFC9768.

Signed-off-by: Ilpo Järvinen <ij@kernel.org>
Co-developed-by: Olivier Tilmans <olivier.tilmans@nokia.com>
Signed-off-by: Olivier Tilmans <olivier.tilmans@nokia.com>
Co-developed-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>
Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

--
v3:
- Improve commit message
- Rename ece_delta to acked_sacked_ce
- Remove redundant rate_sample initializer
---
 include/net/tcp.h    |  1 +
 net/ipv4/tcp_input.c | 40 +++++++++++++++++++---------------------
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 25d11fab1b03..4b1159e6c125 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1353,6 +1353,7 @@ struct rate_sample {
 	long rtt_us;		/* RTT of last (S)ACKed packet (or -1) */
 	int  losses;		/* number of packets marked lost upon ACK */
 	u32  acked_sacked;	/* number of packets newly (S)ACKed upon ACK */
+	u32  acked_sacked_ce;	/* number of packets ECE-marked upon ACK */
 	u32  prior_in_flight;	/* in flight before this ACK */
 	u32  last_end_seq;	/* end_seq of most recently ACKed packet */
 	bool is_app_limited;	/* is sample from packet with bubble in pipe? */
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index fe21d30e3094..92f5a011198f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -616,9 +616,10 @@ static u32 __tcp_accecn_process(struct sock *sk, const struct sk_buff *skb,
 	return safe_delta;
 }
 
-static u32 tcp_accecn_process(struct sock *sk, const struct sk_buff *skb,
-			      u32 delivered_pkts, u32 delivered_bytes,
-			      u64 prior_bytes_acked, int *flag)
+static void tcp_accecn_process(struct sock *sk, struct rate_sample *rs,
+			       const struct sk_buff *skb, u32 delivered_pkts,
+			       u32 delivered_bytes, u64 prior_bytes_acked,
+			       int *flag)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
 	u32 delta;
@@ -628,11 +629,11 @@ static u32 tcp_accecn_process(struct sock *sk, const struct sk_buff *skb,
 	if (delta > 0) {
 		tcp_count_delivered_ce(tp, delta);
 		*flag |= FLAG_ECE;
+		rs->acked_sacked_ce = delta;
 		/* Recalculate header predictor */
 		if (tp->pred_flags)
 			tcp_fast_path_on(tp);
 	}
-	return delta;
 }
 
 /* Buffer size and advertised window tuning.
@@ -4248,8 +4249,8 @@ static void tcp_xmit_recovery(struct sock *sk, int rexmit)
 }
 
 /* Returns the number of packets newly acked or sacked by the current ACK */
-static u32 tcp_newly_delivered(struct sock *sk, u32 prior_delivered,
-			       u32 ecn_count, int flag)
+static u32 tcp_newly_delivered(struct sock *sk, struct rate_sample *rs,
+			       u32 prior_delivered, int flag)
 {
 	const struct net *net = sock_net(sk);
 	struct tcp_sock *tp = tcp_sk(sk);
@@ -4260,8 +4261,9 @@ static u32 tcp_newly_delivered(struct sock *sk, u32 prior_delivered,
 
 	if (flag & FLAG_ECE) {
 		if (tcp_ecn_mode_rfc3168(tp))
-			ecn_count = delivered;
-		NET_ADD_STATS(net, LINUX_MIB_TCPDELIVEREDCE, ecn_count);
+			rs->acked_sacked_ce = delivered;
+		NET_ADD_STATS(net, LINUX_MIB_TCPDELIVEREDCE,
+			      rs->acked_sacked_ce);
 	}
 
 	return delivered;
@@ -4327,7 +4329,6 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 	u32 delivered = tp->delivered;
 	u32 lost = tp->lost;
 	int rexmit = REXMIT_NONE; /* Flag to (re)transmit to recover losses */
-	u32 ecn_count = 0;	  /* Did we receive ECE/an AccECN ACE update? */
 	u32 prior_fack;
 
 	sack_state.first_sackt = 0;
@@ -4441,10 +4442,9 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 	tcp_rack_update_reo_wnd(sk, &rs);
 
 	if (tcp_ecn_mode_accecn(tp))
-		ecn_count = tcp_accecn_process(sk, skb,
-					       tp->delivered - delivered,
-					       sack_state.delivered_bytes,
-					       prior_bytes_acked, &flag);
+		tcp_accecn_process(sk, &rs, skb, tp->delivered - delivered,
+				   sack_state.delivered_bytes,
+				   prior_bytes_acked, &flag);
 
 	tcp_in_ack_event(sk, flag);
 
@@ -4470,7 +4470,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 	if ((flag & FLAG_FORWARD_PROGRESS) || !(flag & FLAG_NOT_DUP))
 		sk_dst_confirm(sk);
 
-	delivered = tcp_newly_delivered(sk, delivered, ecn_count, flag);
+	delivered = tcp_newly_delivered(sk, &rs, delivered, flag);
 
 	lost = tp->lost - lost;			/* freshly marked lost */
 	rs.is_ack_delayed = !!(flag & FLAG_ACK_MAYBE_DELAYED);
@@ -4481,17 +4481,15 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 
 no_queue:
 	if (tcp_ecn_mode_accecn(tp))
-		ecn_count = tcp_accecn_process(sk, skb,
-					       tp->delivered - delivered,
-					       sack_state.delivered_bytes,
-					       prior_bytes_acked, &flag);
-
+		tcp_accecn_process(sk, &rs, skb, tp->delivered - delivered,
+				   sack_state.delivered_bytes,
+				   prior_bytes_acked, &flag);
 	tcp_in_ack_event(sk, flag);
 	/* If data was DSACKed, see if we can undo a cwnd reduction. */
 	if (flag & FLAG_DSACKING_ACK) {
 		tcp_fastretrans_alert(sk, prior_snd_una, num_dupack, &flag,
 				      &rexmit);
-		tcp_newly_delivered(sk, delivered, ecn_count, flag);
+		tcp_newly_delivered(sk, &rs, delivered, flag);
 	}
 	/* If this ack opens up a zero window, clear backoff.  It was
 	 * being used to time the probes, and is probably far higher than
@@ -4518,7 +4516,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 						&sack_state);
 		tcp_fastretrans_alert(sk, prior_snd_una, num_dupack, &flag,
 				      &rexmit);
-		tcp_newly_delivered(sk, delivered, ecn_count, flag);
+		tcp_newly_delivered(sk, &rs, delivered, flag);
 		tcp_xmit_recovery(sk, rexmit);
 	}
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next v3 2/4] tcp: rename ECN transmit helper function
  2026-11-13 12:56 [PATCH net-next v3 0/4] TCP Prague preparation series chia-yu.chang
  2026-11-13 12:56 ` [PATCH net-next v3 1/4] tcp: export CE count in rate_sample chia-yu.chang
@ 2026-11-13 12:56 ` chia-yu.chang
  2026-11-13 12:56 ` [PATCH net-next v3 3/4] tcp: add TCP_ECN_SEND_ECT_1 flag for congestion control chia-yu.chang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: chia-yu.chang @ 2026-11-13 12:56 UTC (permalink / raw)
  To: linux-kernel, kuba, netdev, pabeni, davem, edumazet, kuniyu, ij,
	ncardwell, koen0607, g.white, ingemar.s.johansson,
	mirja.kuehlewind, cheshire, rs.ietf, Jason_Livingood, vidhi_goel,
	Mike_Rudolph, Jeff_Howe, srichard
  Cc: Chia-Yu Chang

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 */
-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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next v3 3/4] tcp: add TCP_ECN_SEND_ECT_1 flag for congestion control
  2026-11-13 12:56 [PATCH net-next v3 0/4] TCP Prague preparation series chia-yu.chang
  2026-11-13 12:56 ` [PATCH net-next v3 1/4] tcp: export CE count in rate_sample chia-yu.chang
  2026-11-13 12:56 ` [PATCH net-next v3 2/4] tcp: rename ECN transmit helper function chia-yu.chang
@ 2026-11-13 12:56 ` chia-yu.chang
  2026-11-13 12:56 ` [PATCH net-next v3 4/4] tcp: add MSS ceiling callback " chia-yu.chang
  2026-11-18  2:05 ` [PATCH net-next v3 0/4] TCP Prague preparation series Jakub Kicinski
  4 siblings, 0 replies; 6+ messages in thread
From: chia-yu.chang @ 2026-11-13 12:56 UTC (permalink / raw)
  To: linux-kernel, kuba, netdev, pabeni, davem, edumazet, kuniyu, ij,
	ncardwell, koen0607, g.white, ingemar.s.johansson,
	mirja.kuehlewind, cheshire, rs.ietf, Jason_Livingood, vidhi_goel,
	Mike_Rudolph, Jeff_Howe, srichard
  Cc: Chia-Yu Chang

From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

This patch introduces the new TCP_ECN_SEND_ECT_1 bit, which enables
a congestion control module to control whether the connection
transmits using ECT(1) (if the bit is set) or ECT(0) (otherwise),
when congestion control is initialized after ECN negotiation.

A congestion control module, such as the upcoming TCP Prague
using L4S ECN, can set this new TCP_ECN_SEND_ECT_1 bit if it
wants to send the ECT(1) code point in outgoing IP headers.

Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

--
v3:
- Update commit message
- Update flag name and helper function name to eliminate confusion
---
 include/net/tcp.h     | 1 +
 include/net/tcp_ecn.h | 6 ++++++
 net/ipv4/tcp_cong.c   | 4 +++-
 net/ipv4/tcp_output.c | 2 +-
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 4b1159e6c125..0242fd6bbb07 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -428,6 +428,7 @@ static inline void tcp_dec_quickack_mode(struct sock *sk)
 #define	TCP_ECN_DEMAND_CWR	BIT(2)
 #define	TCP_ECN_SEEN		BIT(3)
 #define	TCP_ECN_MODE_ACCECN	BIT(4)
+#define	TCP_ECN_SEND_ECT_1	BIT(5)
 
 #define	TCP_ECN_DISABLED	0
 #define	TCP_ECN_MODE_PENDING	(TCP_ECN_MODE_RFC3168 | TCP_ECN_MODE_ACCECN)
diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h
index 9ca016d98972..ff402cdb988d 100644
--- a/include/net/tcp_ecn.h
+++ b/include/net/tcp_ecn.h
@@ -38,6 +38,12 @@ static inline void INET_ECN_xmit_negotiation_ect(struct sock *sk)
 	__INET_ECN_xmit(sk, tcp_ca_ect_1_negotiation(sk));
 }
 
+/* Apply either ECT(0) or ECT(1) based on TCP_ECN_SEND_ECT_1 flag */
+static inline void INET_ECN_xmit_established_ect(struct sock *sk)
+{
+	__INET_ECN_xmit(sk, tcp_sk(sk)->ecn_flags & TCP_ECN_SEND_ECT_1);
+}
+
 static inline void tcp_ecn_queue_cwr(struct tcp_sock *tp)
 {
 	/* Do not set CWR if in AccECN mode! */
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index 3331679c81d7..43b0634f7673 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -240,7 +240,9 @@ void tcp_init_congestion_control(struct sock *sk)
 	tcp_sk(sk)->prior_ssthresh = 0;
 	if (icsk->icsk_ca_ops->init)
 		icsk->icsk_ca_ops->init(sk);
-	if (tcp_ca_needs_ecn(sk))
+	if (tcp_ca_needs_accecn(sk))
+		INET_ECN_xmit_established_ect(sk);
+	else if (tcp_ca_needs_ecn(sk))
 		INET_ECN_xmit(sk);
 	else
 		INET_ECN_dontxmit(sk);
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 08d0d4a639fe..7b694479095e 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -350,7 +350,7 @@ static void tcp_ecn_send(struct sock *sk, struct sk_buff *skb,
 	if (tcp_ecn_mode_accecn(tp)) {
 		if (!tcp_accecn_ace_fail_recv(tp) &&
 		    !tcp_accecn_ace_fail_send(tp))
-			INET_ECN_xmit(sk);
+			INET_ECN_xmit_established_ect(sk);
 		else
 			INET_ECN_dontxmit(sk);
 		tcp_accecn_set_ace(tp, skb, th);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next v3 4/4] tcp: add MSS ceiling callback for congestion control
  2026-11-13 12:56 [PATCH net-next v3 0/4] TCP Prague preparation series chia-yu.chang
                   ` (2 preceding siblings ...)
  2026-11-13 12:56 ` [PATCH net-next v3 3/4] tcp: add TCP_ECN_SEND_ECT_1 flag for congestion control chia-yu.chang
@ 2026-11-13 12:56 ` chia-yu.chang
  2026-11-18  2:05 ` [PATCH net-next v3 0/4] TCP Prague preparation series Jakub Kicinski
  4 siblings, 0 replies; 6+ messages in thread
From: chia-yu.chang @ 2026-11-13 12:56 UTC (permalink / raw)
  To: linux-kernel, kuba, netdev, pabeni, davem, edumazet, kuniyu, ij,
	ncardwell, koen0607, g.white, ingemar.s.johansson,
	mirja.kuehlewind, cheshire, rs.ietf, Jason_Livingood, vidhi_goel,
	Mike_Rudolph, Jeff_Howe, srichard
  Cc: Chia-Yu Chang

From: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

Allow congestion control modules to provide an optional MSS ceiling
through the new mss_ceiling() callback. The TCP stack derives MSS
from PMTU discovery and existing MSS constraints, while the congestion
control may further reduce the effective MSS when needed. The ceiling
is applied during MSS calculation and remains subject to existing PMTU
updates.

Also, tcp_update_mss() is added to allow congestion control modules to
request immediate MSS recomputation after changing their MSS ceiling.
This will be used by upcoming congestion controls, e.g., TCP Prague, that
perform fine-grained rate control at very low rates, e.g., below 1Mbps,
and benefit from reducing the effective MSS while still preserving normal
PMTU handling.

Signed-off-by: Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>

--
v3:
- Replace mss_cache_set_by_cca with mss_ceiling() callback
- Add tcp_update_mss() helper for immediate MSS recomputation
---
 include/net/tcp.h     |  4 ++++
 net/ipv4/tcp_output.c | 16 ++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 0242fd6bbb07..9d398ae09015 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -858,6 +858,7 @@ static inline void tcp_clear_xmit_timers(struct sock *sk)
 
 unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu);
 unsigned int tcp_current_mss(struct sock *sk);
+unsigned int tcp_update_mss(struct sock *sk);
 u32 tcp_clamp_probe0_to_user_timeout(const struct sock *sk, u32 when);
 
 u32 tcp_tso_autosize(const struct sock *sk, unsigned int mss_now,
@@ -1417,6 +1418,9 @@ struct tcp_congestion_ops {
 	/* returns the multiplier used in tcp_sndbuf_expand (optional) */
 	u32 (*sndbuf_expand)(struct sock *sk);
 
+	/* returns the MSS upper bound (optional) */
+	u32 (*mss_ceiling)(struct sock *sk);
+
 /* control/slow paths put last */
 	/* get info for inet_diag (optional) */
 	size_t (*get_info)(struct sock *sk, u32 ext, int *attr,
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 7b694479095e..f70dddd7283b 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2062,6 +2062,10 @@ static inline int __tcp_mtu_to_mss(struct sock *sk, int pmtu)
 
 	mss_now -= psp_sk_overhead(sk);
 
+	/* Apply MSS ceiling from congestion control module, if any */
+	if (icsk->icsk_ca_ops->mss_ceiling)
+		mss_now = min_t(u32, mss_now, icsk->icsk_ca_ops->mss_ceiling(sk));
+
 	/* Clamp it (mss_clamp does not include tcp options) */
 	if (mss_now > tp->rx_opt.mss_clamp)
 		mss_now = tp->rx_opt.mss_clamp;
@@ -2082,6 +2086,7 @@ int tcp_mtu_to_mss(struct sock *sk, int pmtu)
 	return __tcp_mtu_to_mss(sk, pmtu) -
 	       (tcp_sk(sk)->tcp_header_len - sizeof(struct tcphdr));
 }
+EXPORT_SYMBOL(tcp_mtu_to_mss);
 
 /* Inverse of above */
 int tcp_mss_to_mtu(struct sock *sk, int mss)
@@ -2190,6 +2195,17 @@ unsigned int tcp_current_mss(struct sock *sk)
 	return mss_now;
 }
 
+unsigned int tcp_update_mss(struct sock *sk)
+{
+	struct dst_entry *dst = __sk_dst_get(sk);
+	struct tcp_sock *tp = tcp_sk(sk);
+
+	if (!dst)
+		return tp->mss_cache;
+	return tcp_sync_mss(sk, dst_mtu(dst));
+}
+EXPORT_SYMBOL_GPL(tcp_update_mss);
+
 /* RFC2861, slow part. Adjust cwnd, after it was not full during one rto.
  * As additional protections, we do not touch cwnd in retransmission phases,
  * and if application hit its sndbuf limit recently.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v3 0/4] TCP Prague preparation series
  2026-11-13 12:56 [PATCH net-next v3 0/4] TCP Prague preparation series chia-yu.chang
                   ` (3 preceding siblings ...)
  2026-11-13 12:56 ` [PATCH net-next v3 4/4] tcp: add MSS ceiling callback " chia-yu.chang
@ 2026-11-18  2:05 ` Jakub Kicinski
  4 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2026-11-18  2:05 UTC (permalink / raw)
  To: chia-yu.chang
  Cc: linux-kernel, netdev, pabeni, davem, edumazet, kuniyu, ij,
	ncardwell, koen0607, g.white, ingemar.s.johansson,
	mirja.kuehlewind, cheshire, rs.ietf, Jason_Livingood, vidhi_goel,
	Mike_Rudolph, Jeff_Howe, srichard

On Fri, 13 Nov 2026 13:56:24 +0100 chia-yu.chang@nokia-bell-labs.com
wrote:
> Please find the v3 TCP Prague preparation series, and TCP Prague will
> be submitted after this series.

This series does not apply. Please rebase & repost.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-18  2:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13 12:56 [PATCH net-next v3 0/4] TCP Prague preparation series chia-yu.chang
2026-11-13 12:56 ` [PATCH net-next v3 1/4] tcp: export CE count in rate_sample chia-yu.chang
2026-11-13 12:56 ` [PATCH net-next v3 2/4] tcp: rename ECN transmit helper function chia-yu.chang
2026-11-13 12:56 ` [PATCH net-next v3 3/4] tcp: add TCP_ECN_SEND_ECT_1 flag for congestion control chia-yu.chang
2026-11-13 12:56 ` [PATCH net-next v3 4/4] tcp: add MSS ceiling callback " chia-yu.chang
2026-11-18  2:05 ` [PATCH net-next v3 0/4] TCP Prague preparation series Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox