linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/5] mptcp: handle late ADD_ADDR + selftests skip
@ 2025-10-20 20:53 Matthieu Baerts (NGI0)
  2025-10-20 20:53 ` [PATCH net 1/5] mptcp: pm: in-kernel: C-flag: handle late ADD_ADDR Matthieu Baerts (NGI0)
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-10-20 20:53 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
  Cc: netdev, mptcp, linux-kernel, linux-kselftest,
	Matthieu Baerts (NGI0), stable

Here are a few independent fixes related to MPTCP and its selftests:

- Patch 1: correctly handle ADD_ADDR being received after the switch to
  'fully-established'. A fix for another recent fix backported up to
  v5.14.

- Patches 2-5: properly mark some MPTCP Join subtests as 'skipped' if
  the tested kernel doesn't support the feature being validated. Some
  fixes for up to v5.13, v5.18, v6.11 and v6.18-rc1 respectively.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Matthieu Baerts (NGI0) (5):
      mptcp: pm: in-kernel: C-flag: handle late ADD_ADDR
      selftests: mptcp: join: mark 'flush re-add' as skipped if not supported
      selftests: mptcp: join: mark implicit tests as skipped if not supported
      selftests: mptcp: join: mark 'delete re-add signal' as skipped if not supported
      selftests: mptcp: join: mark laminar tests as skipped if not supported

 net/mptcp/pm_kernel.c                           |  6 ++++++
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 18 +++++++++---------
 2 files changed, 15 insertions(+), 9 deletions(-)
---
base-commit: ffff5c8fc2af2218a3332b3d5b97654599d50cde
change-id: 20251020-net-mptcp-c-flag-late-add-addr-1d954e7b63d2

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


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

* [PATCH net 1/5] mptcp: pm: in-kernel: C-flag: handle late ADD_ADDR
  2025-10-20 20:53 [PATCH net 0/5] mptcp: handle late ADD_ADDR + selftests skip Matthieu Baerts (NGI0)
@ 2025-10-20 20:53 ` Matthieu Baerts (NGI0)
  2025-10-20 20:53 ` [PATCH net 2/5] selftests: mptcp: join: mark 'flush re-add' as skipped if not supported Matthieu Baerts (NGI0)
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-10-20 20:53 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
  Cc: netdev, mptcp, linux-kernel, linux-kselftest,
	Matthieu Baerts (NGI0), stable

The special C-flag case expects the ADD_ADDR to be received when
switching to 'fully-established'. But for various reasons, the ADD_ADDR
could be sent after the "4th ACK", and the special case doesn't work.

On NIPA, the new test validating this special case for the C-flag failed
a few times, e.g.

  102 default limits, server deny join id 0
        syn rx                 [FAIL] got 0 JOIN[s] syn rx expected 2

  Server ns stats
  (...)
  MPTcpExtAddAddrTx  1
  MPTcpExtEchoAdd    1

  Client ns stats
  (...)
  MPTcpExtAddAddr    1
  MPTcpExtEchoAddTx  1

        synack rx              [FAIL] got 0 JOIN[s] synack rx expected 2
        ack rx                 [FAIL] got 0 JOIN[s] ack rx expected 2
        join Rx                [FAIL] see above
        syn tx                 [FAIL] got 0 JOIN[s] syn tx expected 2
        join Tx                [FAIL] see above

I had a suspicion about what the issue could be: the ADD_ADDR might have
been received after the switch to the 'fully-established' state. The
issue was not easy to reproduce. The packet capture shown that the
ADD_ADDR can indeed be sent with a delay, and the client would not try
to establish subflows to it as expected.

A simple fix is not to mark the endpoints as 'used' in the C-flag case,
when looking at creating subflows to the remote initial IP address and
port. In this case, there is no need to try.

Note: newly added fullmesh endpoints will still continue to be used as
expected, thanks to the conditions behind mptcp_pm_add_addr_c_flag_case.

Fixes: 4b1ff850e0c1 ("mptcp: pm: in-kernel: usable client side with C-flag")
Cc: stable@vger.kernel.org
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/pm_kernel.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
index e0f44dc232aa..2ae95476dba3 100644
--- a/net/mptcp/pm_kernel.c
+++ b/net/mptcp/pm_kernel.c
@@ -370,6 +370,10 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
 	}
 
 subflow:
+	/* No need to try establishing subflows to remote id0 if not allowed */
+	if (mptcp_pm_add_addr_c_flag_case(msk))
+		goto exit;
+
 	/* check if should create a new subflow */
 	while (msk->pm.local_addr_used < endp_subflow_max &&
 	       msk->pm.extra_subflows < limit_extra_subflows) {
@@ -401,6 +405,8 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
 			__mptcp_subflow_connect(sk, &local, &addrs[i]);
 		spin_lock_bh(&msk->pm.lock);
 	}
+
+exit:
 	mptcp_pm_nl_check_work_pending(msk);
 }
 

-- 
2.51.0


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

* [PATCH net 2/5] selftests: mptcp: join: mark 'flush re-add' as skipped if not supported
  2025-10-20 20:53 [PATCH net 0/5] mptcp: handle late ADD_ADDR + selftests skip Matthieu Baerts (NGI0)
  2025-10-20 20:53 ` [PATCH net 1/5] mptcp: pm: in-kernel: C-flag: handle late ADD_ADDR Matthieu Baerts (NGI0)
@ 2025-10-20 20:53 ` Matthieu Baerts (NGI0)
  2025-10-20 20:53 ` [PATCH net 3/5] selftests: mptcp: join: mark implicit tests " Matthieu Baerts (NGI0)
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-10-20 20:53 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
  Cc: netdev, mptcp, linux-kernel, linux-kselftest,
	Matthieu Baerts (NGI0), stable

The call to 'continue_if' was missing: it properly marks a subtest as
'skipped' if the attached condition is not valid.

Without that, the test is wrongly marked as passed on older kernels.

Fixes: e06959e9eebd ("selftests: mptcp: join: test for flush/re-add endpoints")
Cc: stable@vger.kernel.org
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index c90d8e8b95cb..deba21ca5a97 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -4115,7 +4115,7 @@ endpoint_tests()
 
 	# flush and re-add
 	if reset_with_tcp_filter "flush re-add" ns2 10.0.3.2 REJECT OUTPUT &&
-	   mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
+	   continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
 		pm_nl_set_limits $ns1 0 2
 		pm_nl_set_limits $ns2 1 2
 		# broadcast IP: no packet for this address will be received on ns1

-- 
2.51.0


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

* [PATCH net 3/5] selftests: mptcp: join: mark implicit tests as skipped if not supported
  2025-10-20 20:53 [PATCH net 0/5] mptcp: handle late ADD_ADDR + selftests skip Matthieu Baerts (NGI0)
  2025-10-20 20:53 ` [PATCH net 1/5] mptcp: pm: in-kernel: C-flag: handle late ADD_ADDR Matthieu Baerts (NGI0)
  2025-10-20 20:53 ` [PATCH net 2/5] selftests: mptcp: join: mark 'flush re-add' as skipped if not supported Matthieu Baerts (NGI0)
@ 2025-10-20 20:53 ` Matthieu Baerts (NGI0)
  2025-10-20 20:53 ` [PATCH net 4/5] selftests: mptcp: join: mark 'delete re-add signal' " Matthieu Baerts (NGI0)
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-10-20 20:53 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
  Cc: netdev, mptcp, linux-kernel, linux-kselftest,
	Matthieu Baerts (NGI0), stable

The call to 'continue_if' was missing: it properly marks a subtest as
'skipped' if the attached condition is not valid.

Without that, the test is wrongly marked as passed on older kernels.

Fixes: 36c4127ae8dd ("selftests: mptcp: join: skip implicit tests if not supported")
Cc: stable@vger.kernel.org
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index deba21ca5a97..d98f8f8905b9 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -3939,7 +3939,7 @@ endpoint_tests()
 	# subflow_rebuild_header is needed to support the implicit flag
 	# userspace pm type prevents add_addr
 	if reset "implicit EP" &&
-	   mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
+	   continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
 		pm_nl_set_limits $ns1 2 2
 		pm_nl_set_limits $ns2 2 2
 		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -3964,7 +3964,7 @@ endpoint_tests()
 	fi
 
 	if reset_with_tcp_filter "delete and re-add" ns2 10.0.3.2 REJECT OUTPUT &&
-	   mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
+	   continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
 		start_events
 		pm_nl_set_limits $ns1 0 3
 		pm_nl_set_limits $ns2 0 3

-- 
2.51.0


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

* [PATCH net 4/5] selftests: mptcp: join: mark 'delete re-add signal' as skipped if not supported
  2025-10-20 20:53 [PATCH net 0/5] mptcp: handle late ADD_ADDR + selftests skip Matthieu Baerts (NGI0)
                   ` (2 preceding siblings ...)
  2025-10-20 20:53 ` [PATCH net 3/5] selftests: mptcp: join: mark implicit tests " Matthieu Baerts (NGI0)
@ 2025-10-20 20:53 ` Matthieu Baerts (NGI0)
  2025-10-20 20:53 ` [PATCH net 5/5] selftests: mptcp: join: mark laminar tests " Matthieu Baerts (NGI0)
  2025-10-22  0:50 ` [PATCH net 0/5] mptcp: handle late ADD_ADDR + selftests skip patchwork-bot+netdevbpf
  5 siblings, 0 replies; 7+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-10-20 20:53 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
  Cc: netdev, mptcp, linux-kernel, linux-kselftest,
	Matthieu Baerts (NGI0), stable

The call to 'continue_if' was missing: it properly marks a subtest as
'skipped' if the attached condition is not valid.

Without that, the test is wrongly marked as passed on older kernels.

Fixes: b5e2fb832f48 ("selftests: mptcp: add explicit test case for remove/readd")
Cc: stable@vger.kernel.org
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index d98f8f8905b9..b2a8c51a3969 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -4040,7 +4040,7 @@ endpoint_tests()
 
 	# remove and re-add
 	if reset_with_events "delete re-add signal" &&
-	   mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
+	   continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then
 		ip netns exec $ns1 sysctl -q net.mptcp.add_addr_timeout=0
 		pm_nl_set_limits $ns1 0 3
 		pm_nl_set_limits $ns2 3 3

-- 
2.51.0


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

* [PATCH net 5/5] selftests: mptcp: join: mark laminar tests as skipped if not supported
  2025-10-20 20:53 [PATCH net 0/5] mptcp: handle late ADD_ADDR + selftests skip Matthieu Baerts (NGI0)
                   ` (3 preceding siblings ...)
  2025-10-20 20:53 ` [PATCH net 4/5] selftests: mptcp: join: mark 'delete re-add signal' " Matthieu Baerts (NGI0)
@ 2025-10-20 20:53 ` Matthieu Baerts (NGI0)
  2025-10-22  0:50 ` [PATCH net 0/5] mptcp: handle late ADD_ADDR + selftests skip patchwork-bot+netdevbpf
  5 siblings, 0 replies; 7+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-10-20 20:53 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
  Cc: netdev, mptcp, linux-kernel, linux-kselftest,
	Matthieu Baerts (NGI0)

The call to 'continue_if' was missing: it properly marks a subtest as
'skipped' if the attached condition is not valid.

Without that, the test is wrongly marked as passed on older kernels.

Fixes: c912f935a5c7 ("selftests: mptcp: join: validate new laminar endp")
Reviewed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index b2a8c51a3969..78a1aa4ecff2 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -2324,7 +2324,7 @@ laminar_endp_tests()
 {
 	# no laminar endpoints: routing rules are used
 	if reset_with_tcp_filter "without a laminar endpoint" ns1 10.0.2.2 REJECT &&
-	   mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
+	   continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
 		pm_nl_set_limits $ns1 0 2
 		pm_nl_set_limits $ns2 2 2
 		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2336,7 +2336,7 @@ laminar_endp_tests()
 
 	# laminar endpoints: this endpoint is used
 	if reset_with_tcp_filter "with a laminar endpoint" ns1 10.0.2.2 REJECT &&
-	   mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
+	   continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
 		pm_nl_set_limits $ns1 0 2
 		pm_nl_set_limits $ns2 2 2
 		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2348,7 +2348,7 @@ laminar_endp_tests()
 
 	# laminar endpoints: these endpoints are used
 	if reset_with_tcp_filter "with multiple laminar endpoints" ns1 10.0.2.2 REJECT &&
-	   mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
+	   continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
 		pm_nl_set_limits $ns1 0 2
 		pm_nl_set_limits $ns2 2 2
 		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2363,7 +2363,7 @@ laminar_endp_tests()
 
 	# laminar endpoints: only one endpoint is used
 	if reset_with_tcp_filter "single laminar endpoint" ns1 10.0.2.2 REJECT &&
-	   mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
+	   continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
 		pm_nl_set_limits $ns1 0 2
 		pm_nl_set_limits $ns2 2 2
 		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
@@ -2376,7 +2376,7 @@ laminar_endp_tests()
 
 	# laminar endpoints: subflow and laminar flags
 	if reset_with_tcp_filter "sublow + laminar endpoints" ns1 10.0.2.2 REJECT &&
-	   mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
+	   continue_if mptcp_lib_kallsyms_has "mptcp_pm_get_endp_laminar_max$"; then
 		pm_nl_set_limits $ns1 0 4
 		pm_nl_set_limits $ns2 2 4
 		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal

-- 
2.51.0


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

* Re: [PATCH net 0/5] mptcp: handle late ADD_ADDR + selftests skip
  2025-10-20 20:53 [PATCH net 0/5] mptcp: handle late ADD_ADDR + selftests skip Matthieu Baerts (NGI0)
                   ` (4 preceding siblings ...)
  2025-10-20 20:53 ` [PATCH net 5/5] selftests: mptcp: join: mark laminar tests " Matthieu Baerts (NGI0)
@ 2025-10-22  0:50 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-22  0:50 UTC (permalink / raw)
  To: Matthieu Baerts
  Cc: martineau, geliang, davem, edumazet, kuba, pabeni, horms, shuah,
	netdev, mptcp, linux-kernel, linux-kselftest, stable

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 20 Oct 2025 22:53:25 +0200 you wrote:
> Here are a few independent fixes related to MPTCP and its selftests:
> 
> - Patch 1: correctly handle ADD_ADDR being received after the switch to
>   'fully-established'. A fix for another recent fix backported up to
>   v5.14.
> 
> - Patches 2-5: properly mark some MPTCP Join subtests as 'skipped' if
>   the tested kernel doesn't support the feature being validated. Some
>   fixes for up to v5.13, v5.18, v6.11 and v6.18-rc1 respectively.
> 
> [...]

Here is the summary with links:
  - [net,1/5] mptcp: pm: in-kernel: C-flag: handle late ADD_ADDR
    https://git.kernel.org/netdev/net/c/e84cb860ac3c
  - [net,2/5] selftests: mptcp: join: mark 'flush re-add' as skipped if not supported
    https://git.kernel.org/netdev/net/c/d68460bc31f9
  - [net,3/5] selftests: mptcp: join: mark implicit tests as skipped if not supported
    https://git.kernel.org/netdev/net/c/973f80d715bd
  - [net,4/5] selftests: mptcp: join: mark 'delete re-add signal' as skipped if not supported
    https://git.kernel.org/netdev/net/c/c3496c052ac3
  - [net,5/5] selftests: mptcp: join: mark laminar tests as skipped if not supported
    https://git.kernel.org/netdev/net/c/a9649dfbe552

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] 7+ messages in thread

end of thread, other threads:[~2025-10-22  0:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-20 20:53 [PATCH net 0/5] mptcp: handle late ADD_ADDR + selftests skip Matthieu Baerts (NGI0)
2025-10-20 20:53 ` [PATCH net 1/5] mptcp: pm: in-kernel: C-flag: handle late ADD_ADDR Matthieu Baerts (NGI0)
2025-10-20 20:53 ` [PATCH net 2/5] selftests: mptcp: join: mark 'flush re-add' as skipped if not supported Matthieu Baerts (NGI0)
2025-10-20 20:53 ` [PATCH net 3/5] selftests: mptcp: join: mark implicit tests " Matthieu Baerts (NGI0)
2025-10-20 20:53 ` [PATCH net 4/5] selftests: mptcp: join: mark 'delete re-add signal' " Matthieu Baerts (NGI0)
2025-10-20 20:53 ` [PATCH net 5/5] selftests: mptcp: join: mark laminar tests " Matthieu Baerts (NGI0)
2025-10-22  0:50 ` [PATCH net 0/5] mptcp: handle late ADD_ADDR + selftests skip 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;
as well as URLs for NNTP newsgroup(s).