Skip to contentSkip to conversation

selftests: mptcp: specific fixes for v6.1

PATCH Applied Matthieu Baerts (NGI0) 2 participants 5 messages Mar 24 – Apr 8

Subsystems (4)
lore
Share & tools
lore

Matthieu Baerts (NGI0)

author maintainer
#0 lore raw

cover selftests: mptcp: specific fixes for v6.1

Here is one fix, plus a new version of a patch including an adaptation required for v6.1.

The first patch fixes an issue with the MPTCP Join selftest, only visible in selftests from the v6.1 tree: it is required to explicitly stop the test with another dedicated helper.

The second patch is a backport that needs to be adapted to work with the selftests suite on v6.1.

Matthieu Baerts (NGI0) (2):
selftests: mptcp: join: implicit: stop transfer after last check
selftests: mptcp: join: check removing signal+subflow endp

 tools/testing/selftests/net/mptcp/mptcp_join.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH 1/2 selftests: mptcp: join: implicit: stop transfer after last check

With this kernel version, the 'implicit EP' MPTCP Join selftest ended with an error message:

115 implicit EP creation[ ok ]
ID change is prevented[ ok ] modif is allowed[ ok ]

  TcpPassiveOpens                 2                  0.0
  TcpEstabResets                  2                  0.0
  TcpInSegs                       315                0.0
  TcpOutSegs                      617                0.0
  TcpOutRsts                      1                  0.0
  TcpExtDelayedACKs               289                0.0
  TcpExtTCPPureAcks               6                  0.0
  TcpExtTCPOrigDataSent           306                0.0
  TcpExtTCPDelivered              306                0.0
  MPTcpExtMPCapableSYNRX          1                  0.0
  MPTcpExtMPCapableACKRX          1                  0.0
  MPTcpExtMPJoinSynRx             1                  0.0
  MPTcpExtMPJoinAckRx             1                  0.0
  MPTcpExtAddAddr                 1                  0.0
  MPTcpExtEchoAdd                 1                  0.0
  MPTcpExtMPFastcloseTx           1                  0.0
  MPTcpExtMPRstTx                 1                  0.0
  MPTcpExtMPRstRx                 1                  0.0
  TcpActiveOpens                  2                  0.0
  TcpEstabResets                  2                  0.0
  TcpInSegs                       617                0.0
  TcpOutSegs                      315                0.0
  TcpOutRsts                      1                  0.0
  TcpExtTCPPureAcks               308                0.0
  TcpExtTCPOrigDataSent           306                0.0
  TcpExtTCPDelivered              307                0.0
  MPTcpExtMPCapableSYNTX          1                  0.0
  MPTcpExtMPCapableSYNACKRX       1                  0.0
  MPTcpExtMPJoinSynAckRx          1                  0.0
  MPTcpExtAddAddr                 1                  0.0
  MPTcpExtEchoAdd                 1                  0.0
  MPTcpExtMPFastcloseRx           1                  0.0
  MPTcpExtMPRstTx                 1                  0.0
  MPTcpExtMPRstRx                 1                  0.0
  MPTcpExtRcvWndShared            1                  0.0

That's because the test was waiting for the end of the transfer for no reasons, which ended after a timeout with an error. In this case, the stats were displayed, but this error was ignored: the end of transfer is not validated in this test.

To fix that, stop the transfer after the last check, similar to what is done in the other tests.

Fixes 699879d5f866 ("selftests: mptcp: join: endpoints: longer transfer")
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/net/mptcp/mptcp_join.sh +2 -0
index 80497053fe2f..044ba9c4e169 100755
@@ -3429,6 +3429,7 @@ endpoint_tests()
 		pm_nl_set_limits $ns2 2 2
 		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
 		run_tests $ns1 $ns2 10.0.1.1 128 0 0 slow 2>/dev/null &
+		local tests_pid=$!
 
 		wait_mpj $ns1
 		pm_nl_check_endpoint 1 "creation" \
@@ -3441,6 +3442,7 @@ endpoint_tests()
 		pm_nl_add_endpoint $ns2 10.0.2.2 flags signal
 		pm_nl_check_endpoint 0 "modif is allowed" \
 			$ns2 10.0.2.2 id 1 flags signal
+		kill_wait "${tests_pid}"
 		kill_tests_wait
 	fi
 
Signature · 1 line
2.53.0
maintainer Applied
#2 lore raw

Patch "selftests: mptcp: join: implicit: stop transfer after last check" has been added to the 6.1-stable tree

This is a note to let you know that I've just added the patch titled

selftests: mptcp: join: implicit: stop transfer after last check

to the 6.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
selftests-mptcp-join-implicit-stop-transfer-after-last-check.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From [email protected] Tue Mar 24 10:50:55 2026
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Tue, 24 Mar 2026 10:49:38 +0100
Subject: selftests: mptcp: join: implicit: stop transfer after last check
To: [email protected], [email protected], [email protected]
Cc: "Matthieu Baerts (NGI0)" <[email protected]>, [email protected]
Message-ID: <[email protected]>

From: "Matthieu Baerts (NGI0)" <[email protected]>

With this kernel version, the 'implicit EP' MPTCP Join selftest ended with an error message:

115 implicit EP creation[ ok ]
ID change is prevented[ ok ] modif is allowed[ ok ]

  TcpPassiveOpens                 2                  0.0
  TcpEstabResets                  2                  0.0
  TcpInSegs                       315                0.0
  TcpOutSegs                      617                0.0
  TcpOutRsts                      1                  0.0
  TcpExtDelayedACKs               289                0.0
  TcpExtTCPPureAcks               6                  0.0
  TcpExtTCPOrigDataSent           306                0.0
  TcpExtTCPDelivered              306                0.0
  MPTcpExtMPCapableSYNRX          1                  0.0
  MPTcpExtMPCapableACKRX          1                  0.0
  MPTcpExtMPJoinSynRx             1                  0.0
  MPTcpExtMPJoinAckRx             1                  0.0
  MPTcpExtAddAddr                 1                  0.0
  MPTcpExtEchoAdd                 1                  0.0
  MPTcpExtMPFastcloseTx           1                  0.0
  MPTcpExtMPRstTx                 1                  0.0
  MPTcpExtMPRstRx                 1                  0.0
  TcpActiveOpens                  2                  0.0
  TcpEstabResets                  2                  0.0
  TcpInSegs                       617                0.0
  TcpOutSegs                      315                0.0
  TcpOutRsts                      1                  0.0
  TcpExtTCPPureAcks               308                0.0
  TcpExtTCPOrigDataSent           306                0.0
  TcpExtTCPDelivered              307                0.0
  MPTcpExtMPCapableSYNTX          1                  0.0
  MPTcpExtMPCapableSYNACKRX       1                  0.0
  MPTcpExtMPJoinSynAckRx          1                  0.0
  MPTcpExtAddAddr                 1                  0.0
  MPTcpExtEchoAdd                 1                  0.0
  MPTcpExtMPFastcloseRx           1                  0.0
  MPTcpExtMPRstTx                 1                  0.0
  MPTcpExtMPRstRx                 1                  0.0
  MPTcpExtRcvWndShared            1                  0.0

That's because the test was waiting for the end of the transfer for no reasons, which ended after a timeout with an error. In this case, the stats were displayed, but this error was ignored: the end of transfer is not validated in this test.

To fix that, stop the transfer after the last check, similar to what is done in the other tests.

Fixes 699879d5f866 ("selftests: mptcp: join: endpoints: longer transfer")
---
 tools/testing/selftests/net/mptcp/mptcp_join.sh |    2 ++
 1 file changed, 2 insertions(+)
tools/testing/selftests/net/mptcp/mptcp_join.sh +2 -0
@@ -3429,6 +3429,7 @@ endpoint_tests()
 		pm_nl_set_limits $ns2 2 2
 		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal
 		run_tests $ns1 $ns2 10.0.1.1 128 0 0 slow 2>/dev/null &
+		local tests_pid=$!
 
 		wait_mpj $ns1
 		pm_nl_check_endpoint 1 "creation" \
@@ -3441,6 +3442,7 @@ endpoint_tests()
 		pm_nl_add_endpoint $ns2 10.0.2.2 flags signal
 		pm_nl_check_endpoint 0 "modif is allowed" \
 			$ns2 10.0.2.2 id 1 flags signal
+		kill_wait "${tests_pid}"
 		kill_tests_wait
 	fi
 

Patches currently in stable-queue which might be from [email protected] are

queue-6.1/selftests-mptcp-join-implicit-stop-transfer-after-last-check.patch queue-6.1/selftests-mptcp-join-check-removing-signal-subflow-endp.patch queue-6.1/mptcp-fix-lock-class-name-family-in-pm_nl_create_listen_socket.patch

author maintainer
#3 lore raw

PATCH 2/2 selftests: mptcp: join: check removing signal+subflow endp

In reply to Matthieu Baerts (NGI0)

commit 1777f349ff41b62dfe27454b69c27b0bc99ffca5 upstream.

This validates the previous commit: endpoints with both the signal and subflow flags should always be marked as used even if it was not possible to create new subflows due to the MPTCP PM limits.

For this test, an extra endpoint is created with both the signal and the subflow flags, and limits are set not to create extra subflows. In this case, an ADD_ADDR is sent, but no subflows are created. Still, the local endpoint is marked as used, and no warning is fired when removing the endpoint, after having sent a RM_ADDR.

The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID.

[ No conflicts, but in this kernel version 'run_tests' doesn't support
parameters set via env vars: positional parameters need to be used. See commit 595ef566a2ef ("selftests: mptcp: drop addr_nr_ns1/2 parameters") and commit e571fb09c893 ("selftests: mptcp: add speed env var") which are not in this kernel version. ]

---
 tools/testing/selftests/net/mptcp/mptcp_join.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
tools/testing/selftests/net/mptcp/mptcp_join.sh +12 -0
index 044ba9c4e169..973f76557f23 100755
@@ -2407,6 +2407,18 @@ remove_tests()
 		chk_rst_nr 0 0
 	fi
 
+	# signal+subflow with limits, remove
+	if reset "remove signal+subflow with limits"; then
+		pm_nl_set_limits $ns1 0 0
+		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal,subflow
+		pm_nl_set_limits $ns2 0 0
+		run_tests $ns1 $ns2 10.0.1.1 0 -1 0 slow
+		chk_join_nr 0 0 0
+		chk_add_nr 1 1
+		chk_rm_nr 1 0 invert
+		chk_rst_nr 0 0
+	fi
+
 	# addresses remove
 	if reset "remove addresses"; then
 		pm_nl_set_limits $ns1 3 3
Signature · 1 line
2.53.0
maintainer Applied
#4 lore raw

Patch "selftests: mptcp: join: check removing signal+subflow endp" has been added to the 6.1-stable tree

This is a note to let you know that I've just added the patch titled

selftests: mptcp: join: check removing signal+subflow endp

to the 6.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
selftests-mptcp-join-check-removing-signal-subflow-endp.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From [email protected] Tue Mar 24 10:50:56 2026
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Tue, 24 Mar 2026 10:49:39 +0100
Subject: selftests: mptcp: join: check removing signal+subflow endp
To: [email protected], [email protected], [email protected]
Cc: "Matthieu Baerts (NGI0)" <[email protected]>, [email protected], Mat Martineau <[email protected]>, Jakub Kicinski <[email protected]>
Message-ID: <[email protected]>

From: "Matthieu Baerts (NGI0)" <[email protected]>

commit 1777f349ff41b62dfe27454b69c27b0bc99ffca5 upstream.

This validates the previous commit: endpoints with both the signal and subflow flags should always be marked as used even if it was not possible to create new subflows due to the MPTCP PM limits.

For this test, an extra endpoint is created with both the signal and the subflow flags, and limits are set not to create extra subflows. In this case, an ADD_ADDR is sent, but no subflows are created. Still, the local endpoint is marked as used, and no warning is fired when removing the endpoint, after having sent a RM_ADDR.

The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests, but it validates the previous fix for an issue introduced by this commit ID.

[ No conflicts, but in this kernel version 'run_tests' doesn't support
parameters set via env vars: positional parameters need to be used. See commit 595ef566a2ef ("selftests: mptcp: drop addr_nr_ns1/2 parameters") and commit e571fb09c893 ("selftests: mptcp: add speed env var") which are not in this kernel version. ]

---
 tools/testing/selftests/net/mptcp/mptcp_join.sh |   12 ++++++++++++
 1 file changed, 12 insertions(+)
tools/testing/selftests/net/mptcp/mptcp_join.sh +12 -0
@@ -2407,6 +2407,18 @@ remove_tests()
 		chk_rst_nr 0 0
 	fi
 
+	# signal+subflow with limits, remove
+	if reset "remove signal+subflow with limits"; then
+		pm_nl_set_limits $ns1 0 0
+		pm_nl_add_endpoint $ns1 10.0.2.1 flags signal,subflow
+		pm_nl_set_limits $ns2 0 0
+		run_tests $ns1 $ns2 10.0.1.1 0 -1 0 slow
+		chk_join_nr 0 0 0
+		chk_add_nr 1 1
+		chk_rm_nr 1 0 invert
+		chk_rst_nr 0 0
+	fi
+
 	# addresses remove
 	if reset "remove addresses"; then
 		pm_nl_set_limits $ns1 3 3

Patches currently in stable-queue which might be from [email protected] are

queue-6.1/selftests-mptcp-join-implicit-stop-transfer-after-last-check.patch queue-6.1/selftests-mptcp-join-check-removing-signal-subflow-endp.patch queue-6.1/mptcp-fix-lock-class-name-family-in-pm_nl_create_listen_socket.patch