public inbox for mptcp@lists.linux.dev
 help / color / mirror / Atom feed
From: Gang Yan <gang.yan@linux.dev>
To: mptcp@lists.linux.dev
Cc: Gang Yan <yangang@kylinos.cn>
Subject: [PATCH mptcp-net] mptcp: sync the msk->sndbuf at accept() time
Date: Thu, 27 Nov 2025 15:04:17 +0800	[thread overview]
Message-ID: <20251127070417.53513-1-gang.yan@linux.dev> (raw)

From: Gang Yan <yangang@kylinos.cn>

After an MPTCP connection is established, the sk_sndbuf of client's msk
can be updated through 'subflow_finish_connect'. However, the newly
accepted msk on the server side has a small sk_sndbuf than
msk->first->sk_sndbuf:

'''
MPTCP: msk:00000000e55b09db, msk->sndbuf:20480, msk->first->sndbuf:2626560
'''

This means that when the server immediately sends MSG_DONTWAIT data to
the client after the connection is established, it is more likely to
encounter EAGAIN.

This patch synchronizes the sk_sndbuf by triggering its update during accept.

Fixes: 8005184fd1ca ("mptcp: refactor sndbuf auto-tuning")
Signed-off-by: Gang Yan <yangang@kylinos.cn>
---
Notes:

Hi, Matt,

I'm not sure the commit in 'Fix' tag is correct.

The 3a236aef280e (mptcp: refactor passive socket initialization) removes the
'propagate_sndbuf' in '__mptcp_finish_join' and 'mptcp_stream_accept'.
And the 8005184fd1ca adds it in '__mptcp_finish_join' but not in accept
time. So I think there exists a miss in 8005184fd1ca.

Can you help me to check the 'Fix' tag?

Thanks,
Gang
---
 net/mptcp/protocol.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index e484c6391b48..33610d638385 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -4213,6 +4213,7 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock,
 
 		mptcp_graft_subflows(newsk);
 		mptcp_rps_record_subflows(msk);
+		__mptcp_propagate_sndbuf(newsk, subflow->tcp_sock);
 
 		/* Do late cleanup for the first subflow as necessary. Also
 		 * deal with bad peers not doing a complete shutdown.
-- 
2.43.0


             reply	other threads:[~2025-11-27  7:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-27  7:04 Gang Yan [this message]
2025-11-27  8:08 ` [PATCH mptcp-net] mptcp: sync the msk->sndbuf at accept() time MPTCP CI
2025-11-27  9:33 ` Geliang Tang
  -- strict thread matches above, loose matches on Subject: below --
2025-11-28  9:44 Gang Yan
2025-11-28 10:58 ` MPTCP CI
2025-11-28 14:53 ` Paolo Abeni
2025-11-28 15:27   ` GangYan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251127070417.53513-1-gang.yan@linux.dev \
    --to=gang.yan@linux.dev \
    --cc=mptcp@lists.linux.dev \
    --cc=yangang@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox