All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-net v3] mptcp: update window_clamp on subflows when SO_RCVBUF is set
@ 2026-05-06  9:43 Gang Yan
  2026-05-06 11:19 ` MPTCP CI
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Gang Yan @ 2026-05-06  9:43 UTC (permalink / raw)
  To: MPTCP Linux; +Cc: Gang Yan

From: Gang Yan <yangang@kylinos.cn>

Add __mptcp_subflow_set_rcvbuf() helper that calls the tcp_set_rcvbuf
to update window_clamp, in addition to writing sk_rcvbuf. Use it in
both mptcp_sol_socket_sync_intval() (setsockopt path) and
sync_socket_options() (new subflow creation path).

Fixes: a2cbb1603943 ("tcp: Update window clamping condition")
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/619
Signed-off-by: Gang Yan <yangang@kylinos.cn>
---
Changelog:
v3:
  - Remove the special symbols.
v2:
  - Optimize the commit msg.
  Link: https://patchwork.kernel.org/project/mptcp/patch/20260416122945.324166-1-gang.yan@linux.dev/
v1:
  Link: https://patchwork.kernel.org/project/mptcp/patch/20260416122945.324166-1-gang.yan@linux.dev/
---
 net/mptcp/sockopt.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
index 1cf608e7357b..1544e3563852 100644
--- a/net/mptcp/sockopt.c
+++ b/net/mptcp/sockopt.c
@@ -67,6 +67,12 @@ static int mptcp_get_int_option(struct mptcp_sock *msk, sockptr_t optval,
 	return 0;
 }
 
+static inline 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, in
 		case 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)) {

---
base-commit: aa15c271d79edde595fb6f4eedb52fbc16325a83
change-id: 20260506-window_clamp-8a8d2fbf38e9

Best regards,
-- 
Gang Yan <yangang@kylinos.cn>


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

end of thread, other threads:[~2026-05-08 10:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-06  9:43 [PATCH mptcp-net v3] mptcp: update window_clamp on subflows when SO_RCVBUF is set Gang Yan
2026-05-06 11:19 ` MPTCP CI
2026-05-08  9:24 ` Matthieu Baerts
2026-05-08 10:54 ` Matthieu Baerts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.