Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH net 00/11] mptcp: pm: misc. fixes for v7.1-rc3
@ 2026-05-05 15:00 Matthieu Baerts (NGI0)
  2026-05-05 15:00 ` [PATCH net 10/11] selftests: mptcp: check output: catch cmd errors Matthieu Baerts (NGI0)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-05-05 15:00 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Christoph Paasch
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), stable,
	Shuah Khan, linux-kselftest

Here are various fixes, mainly related to ADD_ADDRs:

- Patch 1: save ADD_ADDR for rtx with ID0 when needed. A fix for v6.1.

- Patch 2: remove unneeded exception for ID 0. A fix for v5.10.

- Patches 3-5: fix potential data-race and leaks during ADD_ADDR rtx. A
  fix for v5.10.

- Patch 6: resched blocked ADD_ADDR rtx after a more appropriated
  timeout, not after 15 seconds. A fix for v5.10.

- Patch 7: skip inactive subflows when when looking at the max RTO. A
  fix for v6.18.

- Patch 8: avoid iterating over all subflows when there is no need to. A
  fix for v6.18.

- Patch 9: skip closed subflows when looking at sending MP_PRIO. A fix
  for v5.17.

- Patch 10: properly catch errors when using check_output() in the
  selftests. A fix for v6.9.

- Patch 11: skip the 'unknown' flag test when 'ip mptcp' is used. A fix
  for v6.10.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Matthieu Baerts (NGI0) (11):
      mptcp: pm: kernel: correctly retransmit ADD_ADDR ID 0
      mptcp: pm: ADD_ADDR rtx: allow ID 0
      mptcp: pm: ADD_ADDR rtx: fix potential data-race
      mptcp: pm: ADD_ADDR rtx: always decrease sk refcount
      mptcp: pm: ADD_ADDR rtx: free sk if last
      mptcp: pm: ADD_ADDR rtx: resched blocked ADD_ADDR quicker
      mptcp: pm: ADD_ADDR rtx: skip inactive subflows
      mptcp: pm: ADD_ADDR rtx: return early if no retrans
      mptcp: pm: prio: skip closed subflows
      selftests: mptcp: check output: catch cmd errors
      selftests: mptcp: pm: restrict 'unknown' check to pm_nl_ctl

 net/mptcp/pm.c                                  | 62 +++++++++++++++++--------
 net/mptcp/pm_kernel.c                           | 13 ++++--
 tools/testing/selftests/net/mptcp/mptcp_lib.sh  | 16 ++++---
 tools/testing/selftests/net/mptcp/pm_netlink.sh | 20 +++++---
 4 files changed, 73 insertions(+), 38 deletions(-)
---
base-commit: 07d99587396024932e02474c3a5bede71d108454
change-id: 20260504-net-mptcp-pm-fixes-7-1-rc3-e4d81787300e

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


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

* [PATCH net 10/11] selftests: mptcp: check output: catch cmd errors
  2026-05-05 15:00 [PATCH net 00/11] mptcp: pm: misc. fixes for v7.1-rc3 Matthieu Baerts (NGI0)
@ 2026-05-05 15:00 ` Matthieu Baerts (NGI0)
  2026-05-05 15:00 ` [PATCH net 11/11] selftests: mptcp: pm: restrict 'unknown' check to pm_nl_ctl Matthieu Baerts (NGI0)
  2026-05-07  1:30 ` [PATCH net 00/11] mptcp: pm: misc. fixes for v7.1-rc3 patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-05-05 15:00 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Christoph Paasch
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), stable,
	Shuah Khan, linux-kselftest

Using '${?}' inside the if-statement to check the returned value from
the command that was evaluated as part of the if-statement is not
correct: here, '${?}' will be linked to the previous instruction, not
the one that is expected here (${cmd}).

Instead, simply mark the error, except if an error is expected. If
that's the case, 1 can be passed as the 4th argument of this helper.
Three checks from pm_netlink.sh expect an error.

While at it, improve the error message when the command unexpectedly
fails or succeeds.

Note that we could expect a specific returned value, but the checks
currently expecting an error can be used with 'ip mptcp' or 'pm_nl_ctl',
and these two tools don't return the same error code.

Fixes: 2d0c1d27ea4e ("selftests: mptcp: add mptcp_lib_check_output helper")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org
---
 tools/testing/selftests/net/mptcp/mptcp_lib.sh  | 16 ++++++++++------
 tools/testing/selftests/net/mptcp/pm_netlink.sh | 10 ++++++----
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
index 5fea7e7df628..989a5975dcea 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh
@@ -474,20 +474,24 @@ mptcp_lib_wait_local_port_listen() {
 	wait_local_port_listen "${@}" "tcp"
 }
 
+# $1: error file, $2: cmd, $3: expected msg, [$4: expected error]
 mptcp_lib_check_output() {
 	local err="${1}"
 	local cmd="${2}"
 	local expected="${3}"
+	local exp_error="${4:-0}"
 	local cmd_ret=0
 	local out
 
-	if ! out=$(${cmd} 2>"${err}"); then
-		cmd_ret=${?}
-	fi
+	out=$(${cmd} 2>"${err}") || cmd_ret=1
 
-	if [ ${cmd_ret} -ne 0 ]; then
-		mptcp_lib_pr_fail "command execution '${cmd}' stderr"
-		cat "${err}"
+	if [ "${cmd_ret}" != "${exp_error}" ]; then
+		mptcp_lib_pr_fail "unexpected returned code for '${cmd}', info:"
+		if [ "${exp_error}" = 0 ]; then
+			cat "${err}"
+		else
+			echo "${out}"
+		fi
 		return 2
 	elif [ "${out}" = "${expected}" ]; then
 		return 0
diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh
index 123d9d7a0278..b69f30fcb91e 100755
--- a/tools/testing/selftests/net/mptcp/pm_netlink.sh
+++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh
@@ -122,10 +122,12 @@ check()
 	local cmd="$1"
 	local expected="$2"
 	local msg="$3"
+	local exp_error="$4"
 	local rc=0
 
 	mptcp_lib_print_title "$msg"
-	mptcp_lib_check_output "${err}" "${cmd}" "${expected}" || rc=${?}
+	mptcp_lib_check_output "${err}" "${cmd}" "${expected}" "${exp_error}" ||
+		rc=${?}
 	if [ ${rc} -eq 2 ]; then
 		mptcp_lib_result_fail "${msg} # error ${rc}"
 		ret=${KSFT_FAIL}
@@ -158,13 +160,13 @@ check "show_endpoints" \
 			    "3,10.0.1.3,signal backup")" "dump addrs"
 
 del_endpoint 2
-check "get_endpoint 2" "" "simple del addr"
+check "get_endpoint 2" "" "simple del addr" 1
 check "show_endpoints" \
 	"$(format_endpoints "1,10.0.1.1" \
 			    "3,10.0.1.3,signal backup")" "dump addrs after del"
 
 add_endpoint 10.0.1.3 2>/dev/null
-check "get_endpoint 4" "" "duplicate addr"
+check "get_endpoint 4" "" "duplicate addr" 1
 
 add_endpoint 10.0.1.4 flags signal
 check "get_endpoint 4" "$(format_endpoints "4,10.0.1.4,signal")" "id addr increment"
@@ -173,7 +175,7 @@ for i in $(seq 5 9); do
 	add_endpoint "10.0.1.${i}" flags signal >/dev/null 2>&1
 done
 check "get_endpoint 9" "$(format_endpoints "9,10.0.1.9,signal")" "hard addr limit"
-check "get_endpoint 10" "" "above hard addr limit"
+check "get_endpoint 10" "" "above hard addr limit" 1
 
 del_endpoint 9
 for i in $(seq 10 255); do

-- 
2.53.0


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

* [PATCH net 11/11] selftests: mptcp: pm: restrict 'unknown' check to pm_nl_ctl
  2026-05-05 15:00 [PATCH net 00/11] mptcp: pm: misc. fixes for v7.1-rc3 Matthieu Baerts (NGI0)
  2026-05-05 15:00 ` [PATCH net 10/11] selftests: mptcp: check output: catch cmd errors Matthieu Baerts (NGI0)
@ 2026-05-05 15:00 ` Matthieu Baerts (NGI0)
  2026-05-07  1:30 ` [PATCH net 00/11] mptcp: pm: misc. fixes for v7.1-rc3 patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Matthieu Baerts (NGI0) @ 2026-05-05 15:00 UTC (permalink / raw)
  To: Mat Martineau, Geliang Tang, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Christoph Paasch
  Cc: netdev, mptcp, linux-kernel, Matthieu Baerts (NGI0), stable,
	Shuah Khan, linux-kselftest

When pm_netlink.sh is executed with '-i', 'ip mptcp' is used instead of
'pm_nl_ctl'. IPRoute2 doesn't support the 'unknown' flag, which has only
been added to 'pm_nl_ctl' for this specific check: to ensure that the
kernel ignores such unsupported flag.

No reason to add this flag to 'ip mptcp'. Then, this check should be
skipped when 'ip mptcp' is used.

Fixes: 0cef6fcac24d ("selftests: mptcp: ip_mptcp option for more scripts")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-kselftest@vger.kernel.org
---
 tools/testing/selftests/net/mptcp/pm_netlink.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testing/selftests/net/mptcp/pm_netlink.sh
index b69f30fcb91e..04594dfc22b1 100755
--- a/tools/testing/selftests/net/mptcp/pm_netlink.sh
+++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh
@@ -194,9 +194,13 @@ check "show_endpoints" \
 flush_endpoint
 check "show_endpoints" "" "flush addrs"
 
-add_endpoint 10.0.1.1 flags unknown
-check "show_endpoints" "$(format_endpoints "1,10.0.1.1")" "ignore unknown flags"
-flush_endpoint
+# "unknown" flag is only supported by pm_nl_ctl
+if ! mptcp_lib_is_ip_mptcp; then
+	add_endpoint 10.0.1.1 flags unknown
+	check "show_endpoints" "$(format_endpoints "1,10.0.1.1")" \
+	      "ignore unknown flags"
+	flush_endpoint
+fi
 
 set_limits 9 1 2>/dev/null
 check "get_limits" "${default_limits}" "rcv addrs above hard limit"

-- 
2.53.0


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

* Re: [PATCH net 00/11] mptcp: pm: misc. fixes for v7.1-rc3
  2026-05-05 15:00 [PATCH net 00/11] mptcp: pm: misc. fixes for v7.1-rc3 Matthieu Baerts (NGI0)
  2026-05-05 15:00 ` [PATCH net 10/11] selftests: mptcp: check output: catch cmd errors Matthieu Baerts (NGI0)
  2026-05-05 15:00 ` [PATCH net 11/11] selftests: mptcp: pm: restrict 'unknown' check to pm_nl_ctl Matthieu Baerts (NGI0)
@ 2026-05-07  1:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-05-07  1:30 UTC (permalink / raw)
  To: Matthieu Baerts
  Cc: martineau, geliang, davem, edumazet, kuba, pabeni, horms, cpaasch,
	netdev, mptcp, linux-kernel, stable, shuah, linux-kselftest

Hello:

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

On Tue, 05 May 2026 17:00:48 +0200 you wrote:
> Here are various fixes, mainly related to ADD_ADDRs:
> 
> - Patch 1: save ADD_ADDR for rtx with ID0 when needed. A fix for v6.1.
> 
> - Patch 2: remove unneeded exception for ID 0. A fix for v5.10.
> 
> - Patches 3-5: fix potential data-race and leaks during ADD_ADDR rtx. A
>   fix for v5.10.
> 
> [...]

Here is the summary with links:
  - [net,01/11] mptcp: pm: kernel: correctly retransmit ADD_ADDR ID 0
    https://git.kernel.org/netdev/net/c/b12014d2d36e
  - [net,02/11] mptcp: pm: ADD_ADDR rtx: allow ID 0
    https://git.kernel.org/netdev/net/c/03f324f3f1f7
  - [net,03/11] mptcp: pm: ADD_ADDR rtx: fix potential data-race
    https://git.kernel.org/netdev/net/c/5cd6e0ad79d2
  - [net,04/11] mptcp: pm: ADD_ADDR rtx: always decrease sk refcount
    https://git.kernel.org/netdev/net/c/9634cb35af17
  - [net,05/11] mptcp: pm: ADD_ADDR rtx: free sk if last
    https://git.kernel.org/netdev/net/c/b7b9a4615697
  - [net,06/11] mptcp: pm: ADD_ADDR rtx: resched blocked ADD_ADDR quicker
    https://git.kernel.org/netdev/net/c/3cf12492891c
  - [net,07/11] mptcp: pm: ADD_ADDR rtx: skip inactive subflows
    https://git.kernel.org/netdev/net/c/c6d395e2de13
  - [net,08/11] mptcp: pm: ADD_ADDR rtx: return early if no retrans
    https://git.kernel.org/netdev/net/c/62a9b19dce77
  - [net,09/11] mptcp: pm: prio: skip closed subflows
    https://git.kernel.org/netdev/net/c/166b78344031
  - [net,10/11] selftests: mptcp: check output: catch cmd errors
    https://git.kernel.org/netdev/net/c/65db7b27b90e
  - [net,11/11] selftests: mptcp: pm: restrict 'unknown' check to pm_nl_ctl
    https://git.kernel.org/netdev/net/c/53705ddfa184

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

end of thread, other threads:[~2026-05-07  1:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 15:00 [PATCH net 00/11] mptcp: pm: misc. fixes for v7.1-rc3 Matthieu Baerts (NGI0)
2026-05-05 15:00 ` [PATCH net 10/11] selftests: mptcp: check output: catch cmd errors Matthieu Baerts (NGI0)
2026-05-05 15:00 ` [PATCH net 11/11] selftests: mptcp: pm: restrict 'unknown' check to pm_nl_ctl Matthieu Baerts (NGI0)
2026-05-07  1:30 ` [PATCH net 00/11] mptcp: pm: misc. fixes for v7.1-rc3 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