public inbox for linux-kselftest@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] mptcp: sync the msk->sndbuf at accept() time
@ 2026-04-20 16:19 Matthieu Baerts (NGI0)
  2026-04-20 16:19 ` [PATCH net 2/2] selftests: mptcp: add a check for sndbuf of S/C Matthieu Baerts (NGI0)
  2026-04-23 11:30 ` [PATCH net 0/2] mptcp: sync the msk->sndbuf at accept() time patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-04-20 16:19 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), Gang Yan,
	stable, Shuah Khan, linux-kselftest

On passive MPTCP connections, the MPTCP socket send buffer doesn't have
the expected size at accept() time.

Patch 1 fixes the regression introduced in v6.7, while the following one
validates the fix in the selftests.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Gang Yan (2):
      mptcp: sync the msk->sndbuf at accept() time
      selftests: mptcp: add a check for sndbuf of S/C

 net/mptcp/protocol.c                      |  2 +-
 tools/testing/selftests/net/mptcp/diag.sh | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)
---
base-commit: 0cf004ffb61cd32d140531c3a84afe975f9fc7ea
change-id: 20260420-net-mptcp-sync-sndbuf-accept-5079a6f9c407

Best regards,
--  
Matthieu Baerts (NGI0) <matttbe@kernel.org>


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

* [PATCH net 2/2] selftests: mptcp: add a check for sndbuf of S/C
  2026-04-20 16:19 [PATCH net 0/2] mptcp: sync the msk->sndbuf at accept() time Matthieu Baerts (NGI0)
@ 2026-04-20 16:19 ` Matthieu Baerts (NGI0)
  2026-04-23 11:30 ` [PATCH net 0/2] mptcp: sync the msk->sndbuf at accept() time patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-04-20 16:19 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), Gang Yan,
	Shuah Khan, linux-kselftest

From: Gang Yan <yangang@kylinos.cn>

Add a new chk_sndbuf() helper to diag.sh that extracts the sndbuf
(the 'tb' field from 'ss -m' skmem output) for both server and
client MPTCP sockets, and verifies they are equal.

Without the previous patch, it will fail:

'''
07 ....chk sndbuf server/client    [FAIL] sndbuf S=20480 != C=2630656
'''

Signed-off-by: Gang Yan <yangang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
To: Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org
---
 tools/testing/selftests/net/mptcp/diag.sh | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/selftests/net/mptcp/diag.sh
index d847ff1737c3..27cbda68144e 100755
--- a/tools/testing/selftests/net/mptcp/diag.sh
+++ b/tools/testing/selftests/net/mptcp/diag.sh
@@ -322,6 +322,33 @@ wait_connected()
 	done
 }
 
+chk_sndbuf()
+{
+	local server_sndbuf client_sndbuf msg
+	local port=${1}
+
+	msg="....chk sndbuf server/client"
+	server_sndbuf=$(ss -N "${ns}" -inmHM "sport" "${port}" | \
+			sed -n 's/.*tb\([0-9]\+\).*/\1/p')
+	client_sndbuf=$(ss -N "${ns}" -inmHM "dport" "${port}" | \
+			sed -n 's/.*tb\([0-9]\+\).*/\1/p')
+
+	mptcp_lib_print_title "${msg}"
+	if [ -z "${server_sndbuf}" ] || [ -z "${client_sndbuf}" ]; then
+		mptcp_lib_pr_fail "sndbuf S=${server_sndbuf} C=${client_sndbuf}"
+		mptcp_lib_result_fail "${msg}"
+		ret=${KSFT_FAIL}
+	elif [ "${server_sndbuf}" != "${client_sndbuf}" ]; then
+		mptcp_lib_pr_fail "sndbuf S=${server_sndbuf} != C=${client_sndbuf}"
+		mptcp_lib_result_fail "${msg}"
+		ret=${KSFT_FAIL}
+	else
+		mptcp_lib_pr_ok
+		mptcp_lib_result_pass "${msg}"
+	fi
+}
+
+
 trap cleanup EXIT
 mptcp_lib_ns_init ns
 
@@ -341,6 +368,7 @@ echo "b" | \
 				127.0.0.1 >/dev/null &
 wait_connected $ns 10000
 chk_msk_nr 2 "after MPC handshake"
+chk_sndbuf 10000
 chk_last_time_info 10000
 chk_msk_remote_key_nr 2 "....chk remote_key"
 chk_msk_fallback_nr 0 "....chk no fallback"

-- 
2.53.0


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

* Re: [PATCH net 0/2] mptcp: sync the msk->sndbuf at accept() time
  2026-04-20 16:19 [PATCH net 0/2] mptcp: sync the msk->sndbuf at accept() time Matthieu Baerts (NGI0)
  2026-04-20 16:19 ` [PATCH net 2/2] selftests: mptcp: add a check for sndbuf of S/C Matthieu Baerts (NGI0)
@ 2026-04-23 11:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-04-23 11:30 UTC (permalink / raw)
  To: Matthieu Baerts
  Cc: martineau, geliang, davem, edumazet, kuba, pabeni, horms, netdev,
	mptcp, linux-kernel, yangang, stable, shuah, linux-kselftest

Hello:

This series was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Mon, 20 Apr 2026 18:19:22 +0200 you wrote:
> On passive MPTCP connections, the MPTCP socket send buffer doesn't have
> the expected size at accept() time.
> 
> Patch 1 fixes the regression introduced in v6.7, while the following one
> validates the fix in the selftests.
> 
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> 
> [...]

Here is the summary with links:
  - [net,1/2] mptcp: sync the msk->sndbuf at accept() time
    https://git.kernel.org/netdev/net/c/fcf04b143346
  - [net,2/2] selftests: mptcp: add a check for sndbuf of S/C
    https://git.kernel.org/netdev/net/c/d0576eb8508e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2026-04-23 11:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 16:19 [PATCH net 0/2] mptcp: sync the msk->sndbuf at accept() time Matthieu Baerts (NGI0)
2026-04-20 16:19 ` [PATCH net 2/2] selftests: mptcp: add a check for sndbuf of S/C Matthieu Baerts (NGI0)
2026-04-23 11:30 ` [PATCH net 0/2] mptcp: sync the msk->sndbuf at accept() time patchwork-bot+netdevbpf

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