FAILED: patch "[PATCH] mptcp: update window_clamp on subflows when SO_RCVBUF is set" failed to apply to 6.6-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x 3a543ae0e2092d5c2085d5f21f7a7dbafdffea3c
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026052820-labored-unhinge-12d3@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3a543ae0e2092d5c2085d5f21f7a7dbafdffea3c Mon Sep 17 00:00:00 2001
From: Gang Yan <[email protected]>
Date: Fri, 15 May 2026 06:27:36 +0200
Subject: [PATCH] mptcp: update window_clamp on subflows when SO_RCVBUF is set
Add __mptcp_subflow_set_rcvbuf() helper to write the subflow sk_rcvbuf, but also to call the recently added tcp_set_rcvbuf() helper to update window_clamp. This is needed because the window clap is updated when scaling_ratio changes, in tcp_measure_rcv_mss(). Until scaling_ratio changes, the subflow is stuck with the old window clamp which may be based on a small initial buffer.
Use this new helper in both mptcp_sol_socket_sync_intval() (setsockopt path) and sync_socket_options() (new subflow creation path).
Note that this patch depends on commit b025461303d8 ("tcp: update window_clamp when SO_RCVBUF is set"): it fixes the issue on TCP side, but the same fix is needed on MPTCP side as well.
net/mptcp/sockopt.c +8 -2
@@ -67,6 +67,12 @@ static int mptcp_get_int_option(struct mptcp_sock *msk, sockptr_t optval,return 0 ; } +static void __mptcp_subflow_set_rcvbuf (struct sock *ssk,int val) +{ +WRITE_ONCE (ssk->sk_rcvbuf, val); +tcp_set_rcvbuf (ssk, val); +} +static void mptcp_sol_socket_sync_intval (struct mptcp_sock *msk,int optname,int val) {struct mptcp_subflow_context *subflow;
@@ -100,7 +106,7 @@ static void mptcp_sol_socket_sync_intval(struct mptcp_sock *msk, int optname, incase SO_RCVBUF :case SO_RCVBUFFORCE : ssk->sk_userlocks |=SOCK_RCVBUF_LOCK ; -WRITE_ONCE (ssk->sk_rcvbuf, sk->sk_rcvbuf); +__mptcp_subflow_set_rcvbuf (ssk, sk->sk_rcvbuf);break ;case SO_MARK :if (READ_ONCE (ssk->sk_mark) != sk->sk_mark) {
@@ -1560,7 +1566,7 @@ static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk)mptcp_subflow_ctx (ssk)->cached_sndbuf = sk->sk_sndbuf; }if (sk->sk_userlocks &SOCK_RCVBUF_LOCK ) -WRITE_ONCE (ssk->sk_rcvbuf, sk->sk_rcvbuf); +__mptcp_subflow_set_rcvbuf (ssk, sk->sk_rcvbuf); }if (sock_flag (sk,SOCK_LINGER )) {
Sasha Levin
maintainerPATCH 1/1 mptcp: update window_clamp on subflows when SO_RCVBUF is set
From: Gang Yan <[email protected]>
[ Upstream commit 3a543ae0e2092d5c2085d5f21f7a7dbafdffea3c ]
Add __mptcp_subflow_set_rcvbuf() helper to write the subflow sk_rcvbuf, but also to call the recently added tcp_set_rcvbuf() helper to update window_clamp. This is needed because the window clap is updated when scaling_ratio changes, in tcp_measure_rcv_mss(). Until scaling_ratio changes, the subflow is stuck with the old window clamp which may be based on a small initial buffer.
Use this new helper in both mptcp_sol_socket_sync_intval() (setsockopt path) and sync_socket_options() (new subflow creation path).
Note that this patch depends on commit b025461303d8 ("tcp: update window_clamp when SO_RCVBUF is set"): it fixes the issue on TCP side, but the same fix is needed on MPTCP side as well.
--- net/mptcp/sockopt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
net/mptcp/sockopt.c +8 -2
@@ -67,6 +67,12 @@ static int mptcp_get_int_option(struct mptcp_sock *msk, sockptr_t optval,return 0 ; } +static void __mptcp_subflow_set_rcvbuf (struct sock *ssk,int val) +{ +WRITE_ONCE (ssk->sk_rcvbuf, val); +tcp_set_window_clamp (ssk,tcp_win_from_space (ssk, val)); +} +static void mptcp_sol_socket_sync_intval (struct mptcp_sock *msk,int optname,int val) {struct mptcp_subflow_context *subflow;
@@ -100,7 +106,7 @@ static void mptcp_sol_socket_sync_intval(struct mptcp_sock *msk, int optname, incase SO_RCVBUF :case SO_RCVBUFFORCE : ssk->sk_userlocks |=SOCK_RCVBUF_LOCK ; -WRITE_ONCE (ssk->sk_rcvbuf, sk->sk_rcvbuf); +__mptcp_subflow_set_rcvbuf (ssk, sk->sk_rcvbuf);break ;case SO_MARK :if (READ_ONCE (ssk->sk_mark) != sk->sk_mark) {
@@ -1491,7 +1497,7 @@ static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk)mptcp_subflow_ctx (ssk)->cached_sndbuf = sk->sk_sndbuf; }if (sk->sk_userlocks &SOCK_RCVBUF_LOCK ) -WRITE_ONCE (ssk->sk_rcvbuf, sk->sk_rcvbuf); +__mptcp_subflow_set_rcvbuf (ssk, sk->sk_rcvbuf); }if (sock_flag (sk,SOCK_LINGER )) {
Signature · 1 line
2.53.0
Matthieu Baerts
maintainerRe: [PATCH 6.6.y] mptcp: update window_clamp on subflows when SO_RCVBUF is set
Hi Sasha,
Quoted 11 lines · Sasha Levin
From: Gang Yan <[email protected]>
[ Upstream commit
3a543ae0e2092d5c2085d5f21f7a7dbafdffea3c]Add
__mptcp_subflow_set_rcvbuf()helper to write the subflowsk_rcvbuf, but also to call the recently addedtcp_set_rcvbuf()helper to updatewindow_clamp. This is needed because the window clap is updated whenscaling_ratiochanges, intcp_measure_rcv_mss(). Untilscaling_ratiochanges, the subflow is stuck with the old window clamp which may be based on a small initial buffer.
Quoted 6 lines
Use this new helper in both
mptcp_sol_socket_sync_intval()(setsockopt path) andsync_socket_options()(new subflow creation path).Note that this patch depends on commit
b025461303d8("tcp: updatewindow_clampwhenSO_RCVBUFis set"): it fixes the issue on TCP side, but the same fix is needed on MPTCP side as well.
See my message on the same patch for v7.0: b025461303d8 should be backported first, but if not, better not to backport this patch.
Cheers,
Matt
Signature · 1 line
Sponsored by the NGI0 Core fund.