From nobody Sun Feb 8 18:43:25 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDCF727877D for ; Mon, 26 Jan 2026 19:24:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455490; cv=none; b=f0HL2ECmeo8r6K9yeJYmGghHByr/CSrjkC1tBzhQL0M9k2MHnH87qwZREgCrhsnXVwd3xlLyuc7V6kEpcFkbuWglILCG4LuAlTiywRCY1+f2NjzZCdnbS9v4UHahlYdHfWat7Sl5TJBtLf58PXHfqxSojrQ3veTVW9bU3z9viZE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455490; c=relaxed/simple; bh=cgQfp6q0YozSh4yXrM6GTQAGJfIOMetJ1A/1KU7GNOM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nG56Fj8Rkj1AwGxAtPmkYW7Awyhfq4r9HXmLp8P52Ssn/1gQ85fXkj5OrAJDICq7iobVp3m/PdW8h+ov7+cAW2nyAi0sJWaXOEqWhry0OWDuG6T/oreXMqK9IOpRRD+c0ACoCnoiCtt7unw9B8lG55cjplkvzGGkX7xzEqVwD60= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CC2ZOcKe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CC2ZOcKe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 010E5C19425; Mon, 26 Jan 2026 19:24:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769455489; bh=cgQfp6q0YozSh4yXrM6GTQAGJfIOMetJ1A/1KU7GNOM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=CC2ZOcKeJCHxVH7V9nORyU6D8wx2xpfMA3vcf/BaeL0RY3ZYWHo65dEiTRP55HGcX guQo5OdHSgBRuK8p4e9nSg/voP9XbonT6rdBvYJMMaAuPNp6YiDVmnfhWz/RnXx+J8 mCGws1ii1Dhe6ARO+V7po3kny+AQl235rfFhvKX9Pq5b/7Yi7AQpxjZ8zrUKoHxn1O hd2lfFHdwQiFl7Xm7zzWyCxeILJjIKfZjSw/u7DuBRZMq6MLWDQ7+uvYtpDWTWlDb3 e5g7Iu95YD9HrxUZnJCPRD80nzfwUcJ+JpDMsyW2G7EQC9W8rIpM8BdbdBoLsu4cFN VZV9eAIgFlG9w== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Jan 2026 20:18:38 +0100 Subject: [PATCH mptcp-net v2 01/11] mptcp: avoid dup SUB_CLOSED events after disconnect Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260126-mptcp-issue-603-v2-1-8393e7840b9e@kernel.org> References: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> In-Reply-To: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" , Marco Angaroni , Geliang Tang X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1811; i=matttbe@kernel.org; h=from:subject:message-id; bh=cgQfp6q0YozSh4yXrM6GTQAGJfIOMetJ1A/1KU7GNOM=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLL91euTlWaYxx3497c3wvUd775Vx2X/29CatxaWb2ko 3vvMD+T6ChlYRDjYpAVU2SRbovMn/m8irfEy88CZg4rE8gQBi5OAbhIJiPDee70eXuEJ029teH0 v397nUt/Mdmdz753tDGjaZHCX47+RkaGmUbmRwNDNhWFNc7ZIaDnqFV4I2C3id6m/OfyXxjtprz kAgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 In case of subflow disconnect(), which can also happen with the first subflow in case of errors like timeout or reset, mptcp_subflow_ctx_reset will reset most fields from the mptcp_subflow_context structure, including close_event_done. Then, when another subflow is closed, yet another SUB_CLOSED event for the disconnected initial subflow is sent. Because of the previous reset, there are no source address and destination port. A solution is then to also check the subflow's local id: it shouldn't be negative anyway. Another solution would be not to reset subflow->close_event_done at disconnect time, but when reused. But then, probably the whole reset could be done when being reused. Let's not change this logic, similar to TCP with tcp_disconnect(). Fixes: d82809b6c5f2 ("mptcp: avoid duplicated SUB_CLOSED events") Reported-by: Marco Angaroni Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/603 Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- v2: rework comment (Geliang) --- net/mptcp/protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 900f26e21acd..335a1723c1dc 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2622,8 +2622,8 @@ void mptcp_close_ssk(struct sock *sk, struct sock *ss= k, struct mptcp_sock *msk =3D mptcp_sk(sk); struct sk_buff *skb; =20 - /* The first subflow can already be closed and still in the list */ - if (subflow->close_event_done) + /* The first subflow can already be closed or disconnected */ + if (subflow->close_event_done || READ_ONCE(subflow->local_id) < 0) return; =20 subflow->close_event_done =3D true; --=20 2.51.0 From nobody Sun Feb 8 18:43:25 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 998B427877D for ; Mon, 26 Jan 2026 19:24:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455490; cv=none; b=puDJHw3/AaLVvwagTNFqm689U1lQ4UhSkqwtjLwBreymZo1zh8ISfmnP5yNJ+j3QbZdsSbUSrBLj+WTMZsnuM8qSttad2C3m71G0nt8xki87SUFlSmBbyD0IV5xzfFVEFcfatotbKwb5+5+/zMWQcn3hsbvSMSJ5q0DjS6dbhXM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455490; c=relaxed/simple; bh=mXlPyAoL3j847lYhCnxVMCVgmzpubksaIta4qTjSs/E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xx48SNWh0T4L0ZQl4Srf3IdgWKfQOAKnjRTPc+kflPsgGyGU8+7B5r+iMH4PJQ46oQwp9iRyUrUf2orJDOLZ9D0X7/4AW32DA4mrBILAHlN3FJFed2psSjSxFLP/4TKzMSPZ9ZAvg34NhreJFdWN1DS6zxrfLIijGMMzGRCsXwM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IuLHbGLl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IuLHbGLl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FFFDC2BC86; Mon, 26 Jan 2026 19:24:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769455490; bh=mXlPyAoL3j847lYhCnxVMCVgmzpubksaIta4qTjSs/E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IuLHbGLlMkwNgQpviHhk1xdWJlHEEpaycxegzipZO9dZ77rKhf75/ALtlnq3H/++e 4N+TekGZhOlIBKxFsLMCidR6WGAuvcHMmovls1wrbga3bRfWc8V7XhuH1/aicFMk/3 sHImABmUvr2Ada6YRDAvULZ48tPcf3/zBatC2B395qlr01TLxKfWxvIt25RsVm8F7D vbApUje4aMTJXDY/+WTepuRz9Dq01IYoAYN6LbQpIbRr2Yru+xL7z5AJ1QJ3WGe/kE +i1ZlkkFucOoVuQXDm8SjHTvMSla8Mnnu7DzLe3yRxMaLaqPGMuXg+bY+yWCGK36mW /SyREHwiMjwwg== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Jan 2026 20:18:39 +0100 Subject: [PATCH mptcp-net v2 02/11] selftests: mptcp: check no dup close events after error Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260126-mptcp-issue-603-v2-2-8393e7840b9e@kernel.org> References: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> In-Reply-To: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3531; i=matttbe@kernel.org; h=from:subject:message-id; bh=mXlPyAoL3j847lYhCnxVMCVgmzpubksaIta4qTjSs/E=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLL91fdrdmxUP1nqV8Yk9tfiXfJOU23X8jnmKik3Qidx By/htmko5SFQYyLQVZMkUW6LTJ/5vMq3hIvPwuYOaxMIEMYuDgFYCLLPjL8DzzxPPGV9b/H92vk HoRs4JqbN7/kk05ie07j/92mH2sr3jD8jzLK+ciXec1zvZHZupIvn9bNXqw7u7zE74rdha8pKfu l+AE= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This validates the previous commit: subflow closed events are re-sent with less info when the initial subflow is disconnected after an error and each time a subflow is closed after that. In this new test, the userspace PM is involved because that's how it was discovered, but it is not specific to it. The initial subflow is terminated with a RESET, and that will cause the subflow disconnect. Then, a new subflow is initiated, but also got rejected, which cause a second subflow closed event, but not a third one. While at it, in case of failure to get the expected amount of events, the events are printed. 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. Fixes: d82809b6c5f2 ("mptcp: avoid duplicated SUB_CLOSED events") Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang --- v2: avoid too long lines with iptables commands (Geliang) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 51 +++++++++++++++++++++= ++++ 1 file changed, 51 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index f1a0d812e642..35ff769f440f 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3871,11 +3871,32 @@ chk_evt_nr() count=3D$(grep -cw "type:${evt}" "${evts}") if [ "${count}" !=3D "${exp}" ]; then fail_test "got ${count} events, expected ${exp}" + cat "${evts}" else print_ok fi } =20 +# $1: ns ; $2: event type ; $3: expected count +wait_event() +{ + local ns=3D"${1}" + local evt_name=3D"${2}" + local exp=3D"${3}" + + local evt=3D"${!evt_name}" + local evts=3D"${evts_ns1}" + local count + + [ "${ns}" =3D=3D "ns2" ] && evts=3D"${evts_ns2}" + + for _ in $(seq 100); do + count=3D$(grep -cw "type:${evt}" "${evts}") + [ "${count}" -ge "${exp}" ] && break + sleep 0.1 + done +} + userspace_tests() { # userspace pm type prevents add_addr @@ -4084,6 +4105,36 @@ userspace_tests() kill_events_pids mptcp_lib_kill_group_wait $tests_pid fi + + # userspace pm no duplicated spurious close events after an error + if reset_with_events "userspace pm no dup close events after error" && + continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then + set_userspace_pm $ns2 + pm_nl_set_limits $ns1 0 2 + { timeout_test=3D120 test_linkfail=3D128 speed=3Dslow \ + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null + local tests_pid=3D$! + wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 + userspace_pm_add_sf $ns2 10.0.3.2 20 + chk_mptcp_info subflows 1 subflows 1 + chk_subflows_total 2 2 + + # force quick loss + ip netns exec $ns2 sysctl -q net.ipv4.tcp_syn_retries=3D1 + if ip netns exec "${ns1}" ${iptables} -A INPUT -s "10.0.1.2" \ + -p tcp --tcp-option 30 -j REJECT --reject-with tcp-reset && + ip netns exec "${ns2}" ${iptables} -A INPUT -d "10.0.1.2" \ + -p tcp --tcp-option 30 -j REJECT --reject-with tcp-reset; then + wait_event ns2 MPTCP_LIB_EVENT_SUB_CLOSED 1 + wait_event ns1 MPTCP_LIB_EVENT_SUB_CLOSED 1 + chk_subflows_total 1 1 + userspace_pm_add_sf $ns2 10.0.1.2 0 + wait_event ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 + fi + kill_events_pids + mptcp_lib_kill_group_wait $tests_pid + fi } =20 endpoint_tests() --=20 2.51.0 From nobody Sun Feb 8 18:43:25 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8243B27877D for ; Mon, 26 Jan 2026 19:24:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455491; cv=none; b=m5GVLsdWKTA4fSlQV9J920D9RfsWoyMz5V7iBpbR31XWUXprVetVFX0Jf5/bmw3yQBJZilvbWMfcgN0a9CpNidLZRmLLTcPceNA0SXPwM8hIkagiFcX1buXtsVa1haIOVSt9LUveV7i4s0TxD4GosFJdixEJqGUL43+uPBoeHmo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455491; c=relaxed/simple; bh=Ngmr3wL7Ofuvts2jVIJXdbSdTuPi0mOLmHnscFsySJ4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VHgV+tYhrO2alEk8h1wurf28wErqHsPuYMPfglrlJ4fgu9MMiLhIfvmGyweTCEZMPLTZ4X7V+6XeNa9GM2Mb649c6eh/BqEQ1YsnoJtOHnLusFHUZVveYTunyM8rARlzgmNS+Lt23sJdgcqsnAqre5lqf5kJsIAxTmrjzQQRoBM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P0bBh2lq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P0bBh2lq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC34BC116C6; Mon, 26 Jan 2026 19:24:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769455491; bh=Ngmr3wL7Ofuvts2jVIJXdbSdTuPi0mOLmHnscFsySJ4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=P0bBh2lqHZve5sl412lmjhTJ4aKZ0aNLqNjcUVEmxB4u7WETqSJJ0PubjTR6JUMOh yqM8NjeXBapxtiXw4iUTyn6TpvRV8WIT6XpfuAiktgLNsiGCO/8BX2CtPkw9Br95CC q1zswbxiTxW1x8B7iw8LKlCSk+CrxdKJ82KMBaS88ebz/FP6a8FDQ4zjKkvQ7WKV+3 KyfONciuthy49vwHT/es2Vdig8gPVDcPUhF9vx5XX4i0lQBGox85iftwgb/6GSUTXH DLZGNEhK/0DK1BPRpm0zsp1HqOc9EYNx+meN4nqGrXZ337XOhaisDZD4RtVFr+Qg0i psYNC8/syCpTw== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Jan 2026 20:18:40 +0100 Subject: [PATCH mptcp-net v2 03/11] mptcp: only reset subflow errors when propagated Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260126-mptcp-issue-603-v2-3-8393e7840b9e@kernel.org> References: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> In-Reply-To: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1979; i=matttbe@kernel.org; h=from:subject:message-id; bh=Ngmr3wL7Ofuvts2jVIJXdbSdTuPi0mOLmHnscFsySJ4=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLL91c9OsT9UVNsQmzFMn3Ht2URnpJc1T+6pu55kJe+i +P9VJnejlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgIl0fWH4pxdrtvNwuVm2jKFf 6JWFdx8cn27Mq7Zg4tISnZchpk3TuhgZFn5OFYiv0ptTF3hBUXLR/fPbWUTOy1TWLe7+kWL08sd ydgA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Some subflow socket errors need to be reported to the MPTCP socket: the initial subflow connect (MP_CAPABLE), and the ones from the fallback sockets. The others are not propagated. The issue is that sock_error() was used to retrieve the error, which was also resetting the sk_err field. Because of that, when notifying the userspace about subflow close events later on from the MPTCP worker, the ssk->sk_err field was always 0. Now, the error (sk_err) is only reset when propagating it to the msk. Fixes: 15cc10453398 ("mptcp: deliver ssk errors to msk") Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang --- Note: I guess we could also duplicate the error in mptcp_subflow_context struct before scheduling the worker, and use this field in mptcp_event_put_token_and_ssk(), but I don't see why we should always reset ssk->sk_err in __mptcp_subflow_error_report() in all cases. v2: keep 'err' variable (Geliang) --- net/mptcp/protocol.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 335a1723c1dc..1b87b3b0d089 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -817,11 +817,8 @@ static bool __mptcp_ofo_queue(struct mptcp_sock *msk) =20 static bool __mptcp_subflow_error_report(struct sock *sk, struct sock *ssk) { - int err =3D sock_error(ssk); int ssk_state; - - if (!err) - return false; + int err; =20 /* only propagate errors on fallen-back sockets or * on MPC connect @@ -829,6 +826,10 @@ static bool __mptcp_subflow_error_report(struct sock *= sk, struct sock *ssk) if (sk->sk_state !=3D TCP_SYN_SENT && !__mptcp_check_fallback(mptcp_sk(sk= ))) return false; =20 + err =3D sock_error(ssk); + if (!err) + return false; + /* We need to propagate only transition to CLOSE state. * Orphaned socket will see such state change via * subflow_sched_work_if_closed() and that path will properly --=20 2.51.0 From nobody Sun Feb 8 18:43:25 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4007727877D for ; Mon, 26 Jan 2026 19:24:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455492; cv=none; b=Au58XkgW+mzSI2cMH68QzYz3EK1reSWd0G3oKNnAmmZQqymyGFnnX+JUy14yctMYayA0n2RCuwg8L6wFKx1AXWLx6h9eF97w8ieQpI7IAEjYYfUtMWGeMg5+Q095BFG3DbnO+K9+R5rxj4dQx6+T94LnYLsGyF63ygnCuW6tksQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455492; c=relaxed/simple; bh=s4TBAz8WcWznvgR11XYKwjYSG7NOK0Sxe4EBmgmiAEY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y0UlbtsRjTJ+CBalsy5jWjm3zMmeUoq8iwGQ//2A/4XugWOpb9gNLd4mi4MV0o1aSHS7bvvHtygSGHGMm0jEHCC6kIzDmbJM6j9Yl13AP9McVywjwPKdJ05evR6QlAp+Izcqzo3iWWSxeosGFqcLLLSZmpgU/1keVfYjUUWNhaY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VylWyCan; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VylWyCan" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93D89C19422; Mon, 26 Jan 2026 19:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769455492; bh=s4TBAz8WcWznvgR11XYKwjYSG7NOK0Sxe4EBmgmiAEY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=VylWyCanbQnoUk02NrjkpStN/bLYN96RDWed9zztiirhOrF8kRr1v8HPOnKufDKzf SVMA4Z59cZjOoPlFcV4xIpl+A/MaWLJU9aE59nWBjKvkUeYPetra7zgx2Rme7ywoWY kyIe6mkbWOH72w7obovky0R7IAIEp8CN3c0dijSUW5gi+l0+diiWHR6Rsk3vHglTNw tJWPG0vaqaNDKkH98rSlPoXo1uV7g/iRE3knsg4q5FF7dLip/bdKzi1WBRAizVfEuP ugoDNzKApAObKubTQvIiLgSbaluLnRLuuhrsaU7Dc34Od6crgjiUk9+4CtUNpOwHF/ eh6EezuoVXg2Q== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Jan 2026 20:18:41 +0100 Subject: [PATCH mptcp-net v2 04/11] selftests: mptcp: check subflow errors in close events Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260126-mptcp-issue-603-v2-4-8393e7840b9e@kernel.org> References: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> In-Reply-To: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2684; i=matttbe@kernel.org; h=from:subject:message-id; bh=s4TBAz8WcWznvgR11XYKwjYSG7NOK0Sxe4EBmgmiAEY=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLL91dfebP+wrTibptHFRd+3RZ8dKLh9ENJG5Z7+Uv1/ 3Wcvn7sbEcpC4MYF4OsmCKLdFtk/sznVbwlXn4WMHNYmUCGMHBxCsBEDLYzMhx6ySPSYPx/4UPp K8uYthS83nlTZsPhw9cOP7J7dLF9drAiw3/Pyo1rtbasXxl03PP6etGdJ04rLM203BO+cdX/vKw NHLF8AA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This validates the previous commit: subflow closed events should contain an error field when a subflow got closed with an error, e.g. reset or timeout. For this test, the chk_evt_nr helper has been extended to check attributes in the matched events. In this test, the 2 subflow closed events should have an error. 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. Fixes: 15cc10453398 ("mptcp: deliver ssk errors to msk") Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 23 ++++++++++++++++++++-= -- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 35ff769f440f..e70d3420954f 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3846,21 +3846,28 @@ userspace_pm_chk_get_addr() fi } =20 -# $1: ns ; $2: event type ; $3: count +# $1: ns ; $2: event type ; $3: count ; [ $4: attr ; $5: attr count ] chk_evt_nr() { local ns=3D${1} local evt_name=3D"${2}" local exp=3D"${3}" + local attr=3D"${4}" + local attr_exp=3D"${5}" =20 local evts=3D"${evts_ns1}" local evt=3D"${!evt_name}" + local attr_name local count =20 + if [ -n "${attr}" ]; then + attr_name=3D", ${attr}: ${attr_exp}" + fi + evt_name=3D"${evt_name:16}" # without MPTCP_LIB_EVENT_ [ "${ns}" =3D=3D "ns2" ] && evts=3D"${evts_ns2}" =20 - print_check "event ${ns} ${evt_name} (${exp})" + print_check "event ${ns} ${evt_name} (${exp}${attr_name})" =20 if [[ "${evt_name}" =3D "LISTENER_"* ]] && ! mptcp_lib_kallsyms_has "mptcp_event_pm_listener$"; then @@ -3872,6 +3879,16 @@ chk_evt_nr() if [ "${count}" !=3D "${exp}" ]; then fail_test "got ${count} events, expected ${exp}" cat "${evts}" + return + elif [ -z "${attr}" ]; then + print_ok + return + fi + + count=3D$(grep -w "type:${evt}" "${evts}" | grep -c ",${attr}:") + if [ "${count}" !=3D "${attr_exp}" ]; then + fail_test "got ${count} event attributes, expected ${attr_exp}" + grep -w "type:${evt}" "${evts}" else print_ok fi @@ -4130,7 +4147,7 @@ userspace_tests() chk_subflows_total 1 1 userspace_pm_add_sf $ns2 10.0.1.2 0 wait_event ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 - chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 + chk_evt_nr ns2 MPTCP_LIB_EVENT_SUB_CLOSED 2 error 2 fi kill_events_pids mptcp_lib_kill_group_wait $tests_pid --=20 2.51.0 From nobody Sun Feb 8 18:43:25 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9E2727B34F for ; Mon, 26 Jan 2026 19:24:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455493; cv=none; b=nhiFi3D8zLstLYB2RwxMVaBvLm2Rkew7P1CyrFRen71Ueti4YfjSPZ7g17E1mwT2+bkzNV359xx6TtJBImJtvP4vz5qiPTtxroaUpQj5p+IMhUNCy2BWQnlMkxg7FoUbFxr/XDMUKPMijhl7GbiyNSHeRgKL3zuaIRMDBCTE2oQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455493; c=relaxed/simple; bh=mEMkY0k39eIndONhSfyg0mNTQ9E/68On4Ffvhp63Ejs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DrrczuDrC1d+jmH+kft9Fmiif4nN/9nKycd+XyYSO+wA/T5N/8zRIDvO61kgw264sUS0XjK2V1I1Gu1OT3hGTtzQwp1Gw/rIOjKXrkM+6pzaFbLyu8RlkNAkMtOEVFA/yd0I0cs9iLurbufX1FCwTgrU8JX1/0aJvpGGQ4JrT1E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=okkjaIZy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="okkjaIZy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BF2DC19425; Mon, 26 Jan 2026 19:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769455492; bh=mEMkY0k39eIndONhSfyg0mNTQ9E/68On4Ffvhp63Ejs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=okkjaIZyHL7tqKXBxPmAsTpM30AkacGsBer0nWhi+TgkDHPuhGXMMQi+oQ4+UK562 9f1bkd6CplYQVAE2N7m9A0Oe54hCEcRo/H5BsxxPjEmWPgGgMEGtJSKZBLS8q/R3VL m5yFvF3QC0W/hj5gwWmKFHg0y5QAy4bLlQ1PCmFMutUoOfR9+xd8N03tXvVQ13Kxm2 l5IbKbgvrQ/uku4cZ+wjBhpGzQbzfcme4duD9lBmWJ6xciCdgiUULwuHlm+9qJIIgT REpCUyvhb1vh3vw5bLRlbvAyx8IAv3dxbZJOqoN20oETs2NDFgq8mmf66Lihs9tNS6 p6gstbpn9IFxw== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Jan 2026 20:18:42 +0100 Subject: [PATCH mptcp-net v2 05/11] selftests: mptcp: join: wait for estab event instead of MPJ Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260126-mptcp-issue-603-v2-5-8393e7840b9e@kernel.org> References: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> In-Reply-To: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4100; i=matttbe@kernel.org; h=from:subject:message-id; bh=mEMkY0k39eIndONhSfyg0mNTQ9E/68On4Ffvhp63Ejs=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLL91dru55Ijry/oDzuE9eD/yl/9/U5TChZpc/8pt++4 shsJY+OjlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgIk8kWBkOJE8L2r/T64625QT JemNd82WG7h0Hn4p57CbdXnEsscLUxgZ5h3c1RfKK3bn0w7VmvnidyY6p7N2vzwiES/6O8aVJVu fDwA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 'wait_mpj' was used just after having created a background connection, but before creating new subflows. So no MPJ were sent. The intention was to wait for the connection to be established, which was the same as doing a simple sleep with a "random" value. Instead, wait for an "established" event. With this, the tests can finish quicker. Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang --- v2: use reset_with_events instead of starting them manually (Geliang) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index e70d3420954f..ff20d86ed399 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3999,7 +3999,7 @@ userspace_tests() { timeout_test=3D120 test_linkfail=3D128 speed=3D5 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! - wait_mpj $ns1 + wait_event ns1 MPTCP_LIB_EVENT_ESTABLISHED 1 userspace_pm_add_addr $ns1 10.0.2.1 10 userspace_pm_add_addr $ns1 10.0.3.1 20 chk_join_nr 2 2 2 @@ -4032,7 +4032,7 @@ userspace_tests() { timeout_test=3D120 test_linkfail=3D128 speed=3D5 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! - wait_mpj $ns2 + wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 userspace_pm_add_sf $ns2 10.0.3.2 20 chk_join_nr 1 1 1 chk_mptcp_info subflows 1 subflows 1 @@ -4060,7 +4060,7 @@ userspace_tests() { timeout_test=3D120 test_linkfail=3D128 speed=3D5 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! - wait_mpj $ns2 + wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 chk_mptcp_info subflows 0 subflows 0 chk_subflows_total 1 1 userspace_pm_add_sf $ns2 10.0.3.2 0 @@ -4081,7 +4081,7 @@ userspace_tests() { timeout_test=3D120 test_linkfail=3D128 speed=3D5 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! - wait_mpj $ns2 + wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 userspace_pm_add_sf $ns2 10.0.3.2 20 chk_join_nr 1 1 1 chk_mptcp_info subflows 1 subflows 1 @@ -4105,7 +4105,7 @@ userspace_tests() { timeout_test=3D120 test_linkfail=3D128 speed=3D5 \ run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! - wait_mpj $ns1 + wait_event ns1 MPTCP_LIB_EVENT_ESTABLISHED 1 userspace_pm_add_addr $ns1 10.0.2.1 10 chk_join_nr 1 1 1 chk_add_nr 1 1 @@ -4158,7 +4158,7 @@ endpoint_tests() { # subflow_rebuild_header is needed to support the implicit flag # userspace pm type prevents add_addr - if reset "implicit EP" && + if reset_with_events "implicit EP" && continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then pm_nl_set_limits $ns1 2 2 pm_nl_set_limits $ns2 2 2 @@ -4167,7 +4167,7 @@ endpoint_tests() run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! =20 - wait_mpj $ns1 + wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 pm_nl_check_endpoint "creation" \ $ns2 10.0.2.2 id 1 flags implicit chk_mptcp_info subflows 1 subflows 1 @@ -4181,6 +4181,7 @@ endpoint_tests() pm_nl_check_endpoint "modif is allowed" \ $ns2 10.0.2.2 id 1 flags signal mptcp_lib_kill_group_wait $tests_pid + kill_events_pids fi =20 if reset_with_tcp_filter "delete and re-add" ns2 10.0.3.2 REJECT OUTPUT && @@ -4194,7 +4195,7 @@ endpoint_tests() run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! =20 - wait_mpj $ns2 + wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 pm_nl_check_endpoint "creation" \ $ns2 10.0.2.2 id 2 flags subflow dev ns2eth2 chk_subflow_nr "before delete id 2" 2 @@ -4272,7 +4273,7 @@ endpoint_tests() run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null local tests_pid=3D$! =20 - wait_mpj $ns2 + wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 pm_nl_check_endpoint "creation" \ $ns1 10.0.2.1 id 1 flags signal chk_subflow_nr "before delete" 2 --=20 2.51.0 From nobody Sun Feb 8 18:43:25 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F71C283FF5 for ; Mon, 26 Jan 2026 19:24:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455493; cv=none; b=ZmIYPtnoX5F/ega57ihZ0dVpCGD+E9wc/TK0DNnR5DCzyWRDQjaE7kkUlLo4n2oEMKDBfVQgpbFzNqHcU3PN+9L+oe+R3ouELXoelzPUHO7Bn+yYQUdqeHsE2toYA1XzV4aSUjFEzg1w537lKj0cR5xytZmYXMIZZF7Ov83si88= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455493; c=relaxed/simple; bh=UHERAxu10ZJ+RINGroNmczXSgLe6VESbXo9pE/t+mXs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AnqhJGdGGrqh3B3xNNEr9nwpDHQU7tUVWRI27/36SWeQbc3XXeqntLTFBDFtpFr6Uxavfzp9bvX+WVv9ed+PK1Gsr+KCMqEsY7jqTz5ddbVo5wJp1VfhkP3hq5rWdTPAwNzSPpULV61VPq+go7eIjlzKzefdj21Y97ch4ejxUxQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GE/eSuC4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GE/eSuC4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23C26C19422; Mon, 26 Jan 2026 19:24:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769455493; bh=UHERAxu10ZJ+RINGroNmczXSgLe6VESbXo9pE/t+mXs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GE/eSuC4MrSHZcKyuz7Gp+ZPuNkVG0uy4diNzRn9x3ouqkchBQTbQ9prWIBXPS32Y dUy3F9QhBPMPb4BuBUajRWCDhkIaC8/RHObERYCn7emwCUnnvrc+l6NT1CYF4A9k9P iIzhjXYa02JIA8MXEqhJRsRMSj0kf9fQsvyyaUjmYDfA7lS8hiYAtoZKScvDZlkDXS XMOZgt2ZPY6jh35KNMmpdXbn5ecTVcUaZbQB1Jmp3svcHE220y8bRN4VJijczel55I j1QXiDd/sfvQ898v3R9Ivvd301m4onxsJofpUE6cnaYXUR4BdW4HyKAiog9FVrNLdU e+nd0dqcCEslw== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Jan 2026 20:18:43 +0100 Subject: [PATCH mptcp-net v2 06/11] selftests: mptcp: join: fix wait_mpj helper Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260126-mptcp-issue-603-v2-6-8393e7840b9e@kernel.org> References: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> In-Reply-To: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4182; i=matttbe@kernel.org; h=from:subject:message-id; bh=UHERAxu10ZJ+RINGroNmczXSgLe6VESbXo9pE/t+mXs=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLL99c4ztmRpvA5ZWLVOVF3+U/9r5f9udOXVbG+4ZNqm sVFs/ffO0pZGMS4GGTFFFmk2yLzZz6v4i3x8rOAmcPKBDKEgYtTACby9gPDXyEh64dmU6fkLzod b1DM8kZgXkOiQrlDQn1bhW78+YpdDQz/c+WmixxpFquRUvlwXn2i8aPPjJveCimaGjhlra2fVvq ZBwA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 It looks like most of the time, this helper was simply waiting a bit more than one second: the previous MPJoin counter was often already at the expected value. So at the end, it was just checking 10 times for the MPJoin counter to change, but it was not happening. For the tests, that was time, it was just waiting longer for nothing. Instead, use 'wait_mpj' with the expected counter: in the tests, the MPJ counter can easily be predicted. While at it, stop passing the netns as argument: here the received MPJoin ACK is checked, which happens on the server side. If later on, this needs to be checked on the client side, the helper can be adapted for this case, but better avoid confusions now if it is not needed. While at it, stop using 'i' for the variable if it is not used. With this, the tests can finish quicker. Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 30 ++++++++++++---------= ---- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index ff20d86ed399..6ab568d6b856 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -631,17 +631,15 @@ wait_rm_sf() done } =20 +# $1: expected MPJ ACK Rx counter in $ns1 wait_mpj() { - local ns=3D"${1}" - local cnt old_cnt + local exp_cnt=3D"${1}" + local cnt =20 - old_cnt=3D$(mptcp_lib_get_counter ${ns} "MPTcpExtMPJoinAckRx") - - local i - for i in $(seq 10); do - cnt=3D$(mptcp_lib_get_counter ${ns} "MPTcpExtMPJoinAckRx") - [ "$cnt" =3D "${old_cnt}" ] || break + for _ in $(seq 10); do + cnt=3D$(mptcp_lib_get_counter ${ns1} "MPTcpExtMPJoinAckRx") + [ "${cnt}" =3D "${exp_cnt}" ] && break sleep 0.1 done } @@ -4207,7 +4205,7 @@ endpoint_tests() chk_mptcp_info subflows 0 subflows 0 =20 pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow - wait_mpj $ns2 + wait_mpj 2 chk_subflow_nr "after re-add id 2" 2 chk_mptcp_info subflows 1 subflows 1 =20 @@ -4219,7 +4217,7 @@ endpoint_tests() ip netns exec "${ns2}" ${iptables} -D OUTPUT -s "10.0.3.2" -p tcp -j REJ= ECT pm_nl_del_endpoint $ns2 3 10.0.3.2 pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow - wait_mpj $ns2 + wait_mpj 3 chk_subflow_nr "after no reject" 3 chk_mptcp_info subflows 2 subflows 2 =20 @@ -4231,7 +4229,7 @@ endpoint_tests() chk_mptcp_info subflows 2 subflows 2 # only decr for additional sf =20 pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow - wait_mpj $ns2 + wait_mpj $((3 + i)) chk_subflow_nr "after re-add id 0 ($i)" 3 chk_mptcp_info subflows 3 subflows 3 done @@ -4289,7 +4287,7 @@ endpoint_tests() =20 pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal pm_nl_add_endpoint $ns1 10.0.3.1 id 2 flags signal - wait_mpj $ns2 + wait_mpj 3 chk_subflow_nr "after re-add" 3 chk_mptcp_info subflows 2 subflows 2 chk_mptcp_info add_addr_signal 2 add_addr_accepted 2 @@ -4301,7 +4299,7 @@ endpoint_tests() chk_mptcp_info add_addr_signal 2 add_addr_accepted 2 =20 pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal - wait_mpj $ns2 + wait_mpj 4 chk_subflow_nr "after re-add ID 0" 3 chk_mptcp_info subflows 3 subflows 3 chk_mptcp_info add_addr_signal 3 add_addr_accepted 2 @@ -4313,7 +4311,7 @@ endpoint_tests() chk_mptcp_info add_addr_signal 2 add_addr_accepted 2 =20 pm_nl_add_endpoint $ns1 10.0.1.1 id 88 flags signal - wait_mpj $ns2 + wait_mpj 5 chk_subflow_nr "after re-re-add ID 0" 3 chk_mptcp_info subflows 3 subflows 3 chk_mptcp_info add_addr_signal 3 add_addr_accepted 2 @@ -4362,9 +4360,9 @@ endpoint_tests() wait_rm_addr $ns2 0 ip netns exec "${ns2}" ${iptables} -D OUTPUT -s "10.0.3.2" -p tcp -j REJ= ECT pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow - wait_mpj $ns2 + wait_mpj 1 pm_nl_add_endpoint $ns1 10.0.3.1 id 2 flags signal - wait_mpj $ns2 + wait_mpj 2 mptcp_lib_kill_group_wait $tests_pid =20 join_syn_tx=3D3 join_connect_err=3D1 \ --=20 2.51.0 From nobody Sun Feb 8 18:43:25 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7292F283FF5 for ; Mon, 26 Jan 2026 19:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455494; cv=none; b=GjKRZ8EUyPVRxLHrDEZI/WbOYFPR8DA9p5jUcq8z66jBpNbiSdbdbfcaBbbtlkoYf/f2UfljpeUl+Ff0Ug4j/7blkeZsgdR8BvqkVkU/Py3BCW5VqgZ1GZLxPe2rhmbATsy6b3nafoOx2xHT3DAbmNT39L10Wox+AqOjbqw093s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455494; c=relaxed/simple; bh=8FEOMEoWj+2MMl4Rxoa/W2/GoF/YNd19VazBontGtFQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TyAC+U6oNyWbmcbMXS405NiLgVqUa7cHKmMDXxsvGxyJ/0jGDErdoDNZxXcN9dl453Y8mbYaFpI+hM3cvCTf8/YZ+VNaXWhmAQD4PRXl5IdaeuxgmduTTzZrsfA4b/mzmN8mWz2ho7XSQrRiuuZQtV6SiRZ11nh7PazVDw57ZUc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L6UFuPqW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L6UFuPqW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFABDC19422; Mon, 26 Jan 2026 19:24:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769455494; bh=8FEOMEoWj+2MMl4Rxoa/W2/GoF/YNd19VazBontGtFQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=L6UFuPqWI3iSyt5uRnlj8ZvplSDKZgUTS+4vla5xPpc0HX2OmdRZXKkG5wbebaQxS a3+isj2fYrPQyxcBOpr/tEqzZi1Jc5CHE19/vWIT++bAvMWm1VDB7q2CXBOcrPrh37 uKC5oy5HRz3BtxR8qkyOvXDxsgvh9xKEy/IvFhlM1CwHJ08yIIJfeny3KVTwUTB3vi 7kV4FlozV/blKgnXys3uXUOe8oPP1FnfUclfoXa7ofhkdKrOsQI5agLKQ/FZ4pnEof O/EtUE+3BcJXfAX1eilw3nRh0arqe/tYv1LI4OlDP1VN2st9hAaai/5eWEj+oAAr8v IW9sTSou/mGGw== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Jan 2026 20:18:44 +0100 Subject: [PATCH mptcp-net v2 07/11] selftests: mptcp: join: userspace: wait for new events Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260126-mptcp-issue-603-v2-7-8393e7840b9e@kernel.org> References: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> In-Reply-To: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3035; i=matttbe@kernel.org; h=from:subject:message-id; bh=8FEOMEoWj+2MMl4Rxoa/W2/GoF/YNd19VazBontGtFQ=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLL99faRu2yeDZZQuTMvBSObok3yb1GgtP+7b6dc661p P1xrsC9jlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgImoFTH8ZjHOzn85+/mBdR8S NxRoSLLuu2wz8eqbTuHI7T8DPmtbCDIyTDj0XFzrzpOIs3VKb1qmKirc1CxfVJb4sEg+4o/21MS vHAA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Instead of waiting for a random amount of time (1 second), wait for an event to be received on the other side. To do that, when an address is announced (userspace_pm_add_addr), the ANNOUNCED is expected. When a new subflow is created (userspace_pm_add_sf), the SUB_ESTABLISHED event is expected. With this, the tests can finish quicker. Signed-off-by: Matthieu Baerts (NGI0) Reviewed-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 6ab568d6b856..4977e6ff17b4 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3716,7 +3716,6 @@ userspace_pm_add_addr() tk=3D$(mptcp_lib_evts_get_info token "$evts") =20 ip netns exec $1 ./pm_nl_ctl ann $2 token $tk id $3 - sleep 1 } =20 # $1: ns ; $2: id @@ -3747,7 +3746,6 @@ userspace_pm_add_sf() =20 ip netns exec $1 ./pm_nl_ctl csf lip $2 lid $3 \ rip $da rport $dp token $tk - sleep 1 } =20 # $1: ns ; $2: addr $3: event type @@ -3999,7 +3997,9 @@ userspace_tests() local tests_pid=3D$! wait_event ns1 MPTCP_LIB_EVENT_ESTABLISHED 1 userspace_pm_add_addr $ns1 10.0.2.1 10 + wait_event ns2 MPTCP_LIB_EVENT_ANNOUNCED 1 userspace_pm_add_addr $ns1 10.0.3.1 20 + wait_event ns2 MPTCP_LIB_EVENT_ANNOUNCED 2 chk_join_nr 2 2 2 chk_add_nr 2 2 chk_mptcp_info subflows 2 subflows 2 @@ -4032,6 +4032,7 @@ userspace_tests() local tests_pid=3D$! wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 userspace_pm_add_sf $ns2 10.0.3.2 20 + wait_event ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 1 chk_join_nr 1 1 1 chk_mptcp_info subflows 1 subflows 1 chk_subflows_total 2 2 @@ -4062,6 +4063,7 @@ userspace_tests() chk_mptcp_info subflows 0 subflows 0 chk_subflows_total 1 1 userspace_pm_add_sf $ns2 10.0.3.2 0 + wait_event ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 1 userspace_pm_chk_dump_addr "${ns2}" \ "id 0 flags subflow 10.0.3.2" "id 0 subflow" chk_join_nr 1 1 1 @@ -4081,6 +4083,7 @@ userspace_tests() local tests_pid=3D$! wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 userspace_pm_add_sf $ns2 10.0.3.2 20 + wait_event ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 1 chk_join_nr 1 1 1 chk_mptcp_info subflows 1 subflows 1 chk_subflows_total 2 2 @@ -4105,6 +4108,7 @@ userspace_tests() local tests_pid=3D$! wait_event ns1 MPTCP_LIB_EVENT_ESTABLISHED 1 userspace_pm_add_addr $ns1 10.0.2.1 10 + wait_event ns2 MPTCP_LIB_EVENT_ANNOUNCED 1 chk_join_nr 1 1 1 chk_add_nr 1 1 chk_mptcp_info subflows 1 subflows 1 @@ -4131,6 +4135,7 @@ userspace_tests() local tests_pid=3D$! wait_event ns2 MPTCP_LIB_EVENT_ESTABLISHED 1 userspace_pm_add_sf $ns2 10.0.3.2 20 + wait_event ns2 MPTCP_LIB_EVENT_SUB_ESTABLISHED 1 chk_mptcp_info subflows 1 subflows 1 chk_subflows_total 2 2 =20 --=20 2.51.0 From nobody Sun Feb 8 18:43:25 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96C7F280CFC for ; Mon, 26 Jan 2026 19:24:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455495; cv=none; b=fHqV7hJA71ffzQglIwXS20ADHzs3KkjZMxk7oAHiChYT9zaUVqjclo/sfEDvtJd6pJpQdAS+lDyBFtrYZU28JUpOzumRDP/a/tLTFfl6+Q5rbexvX2b9tA+oCT7wFs0Us4stENeVwBGi73zOarTHCBf9zDRT2kNziWeKx9gEsF8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455495; c=relaxed/simple; bh=QI7WRTwVSEM0XiF/j6mP2IUzraAerfechwCzPq+aXgE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r4HEmZKESlO2b1OrTreRt074MKYra8A5oqIb+MsarNYz0TspQF3pvf/JIcH1OJxUEDF9Qx17p7lEijH2OoJ0yR/xaVGs45bSVRElbGWvQ44OOZqjMhfnmDg6ngavtiTceWBtX7HTUbor34XteDnJ9kD0a5FhZa6E0LG5gDverHw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lvhId2db; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lvhId2db" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A78B7C19422; Mon, 26 Jan 2026 19:24:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769455495; bh=QI7WRTwVSEM0XiF/j6mP2IUzraAerfechwCzPq+aXgE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lvhId2db9j/J82i6vWGmvNrjFPZ/MTAPbAgizg/zEMtqShiqoiaKppsYsxb1yGc3D Jsb6nbZQ/LOWgPK6D1Zjb7cq+qTEhfRBtBOvAJqBTS53K1W0LL0L+avAZm3aANuTO3 zcy55/2b1pd3xnQY38bUNGJquQUqaChoULBukbKkEyzSRpoDC9hORI9kLOBZeLnadD ecv6Zb6S69KFsXnTyYmFx9VUdVJJx0wr0JnVtl7L9jkisjgffejJ92aIxrvHS/dh7E EuxvAwt7H/WfrCPxugYcTbAOwRFTERK8CaZzDxfN1LhVia5Db9LkrN4h3NNZlFuN7h 60ISZPWdjUPmA== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Jan 2026 20:18:45 +0100 Subject: [PATCH mptcp-net v2 08/11] selftests: mptcp: join chk_stale_nr: avoid dup stats Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260126-mptcp-issue-603-v2-8-8393e7840b9e@kernel.org> References: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> In-Reply-To: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" , Geliang Tang X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1401; i=matttbe@kernel.org; h=from:subject:message-id; bh=QI7WRTwVSEM0XiF/j6mP2IUzraAerfechwCzPq+aXgE=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLL99fO9Jm+oPL4Af+TZ89NuSV4/oqszNpE9umfj1Xc8 bdiuJlg3lHKwiDGxSArpsgi3RaZP/N5FW+Jl58FzBxWJpAhDFycAjCRs6KMDPs9gqsXfdt2uUNP sV5IYZFo2o6QTb/Te1aVXyr9djzw5leGX0wzfKboZl+8X3eze88qpw99a6QDZnt+qeiUPnGzSf2 VIh8A X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 nstat outputs are already printed when calling 'fail_test', no need to do it again. While at it, no need to use the dump_stats variable, print the extra stats directly. And use 'ip -n $ns' instead of 'ip netns exec $ns', shorter and clearer. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 4977e6ff17b4..a8b9782a85df 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -1648,7 +1648,6 @@ chk_stale_nr() local stale_min=3D$2 local stale_max=3D$3 local stale_delta=3D$4 - local dump_stats local stale_nr local recover_nr =20 @@ -1664,16 +1663,11 @@ chk_stale_nr() fail_test "got $stale_nr stale[s] $recover_nr recover[s], " \ " expected stale in range [$stale_min..$stale_max]," \ " stale-recover delta $stale_delta" - dump_stats=3D1 + echo $ns stats + ip -n $ns -s link show else print_ok fi - - if [ "${dump_stats}" =3D 1 ]; then - echo $ns stats - ip netns exec $ns ip -s link show - ip netns exec $ns nstat -as | grep MPTcp - fi } =20 chk_add_nr() --=20 2.51.0 From nobody Sun Feb 8 18:43:25 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EDB3280CFC for ; Mon, 26 Jan 2026 19:24:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455496; cv=none; b=ibTyDRqSLZTBzgpcbBEwFYUOrHvWrMAV0x6jAr0qanQcWNLlyXOdHX71dNLnB+B5SMzezPUHxmfm9gSw/iuffz6t0VPt7on7KCVaEZKOwAZRSUxGcXG2GovKAvtq5geZB0P5a1gxcCKoew7oAdfU0RYgndqHPMz2DGMc974GtbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455496; c=relaxed/simple; bh=Z8cK/JNiqVPUBBg4tXXQ1Y0y30lvNWBmJ1Pbnubo00c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=R2ZL5CQZszaI6VL0WNccJw8/PnhaYgBfiCXfFrcV72aXHGvWO6TGQShvbULOgoFukcDdF2uDvU63cwb6oKa0lHG/i9P9ZitCyidZvnAQK/aowL4zYSy/wUwvUlmX+N8qHRoRTOi3/5DFIyzgQPDXLrEMKV0+vlHiy2/Evgdezzo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ghaxxZvh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ghaxxZvh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92E0DC19425; Mon, 26 Jan 2026 19:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769455496; bh=Z8cK/JNiqVPUBBg4tXXQ1Y0y30lvNWBmJ1Pbnubo00c=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ghaxxZvh/sCSV+CtjKbYMkqMa1/RstAKp7VpRrJuW70COqdpmiZF8URIUWIYLM/u2 yuImPYZ4Sh4ioKmCI4/SBrl0fajnIdvZSvNe3DeXTKDRqFbVRQI4dYaXlDET1fT23t tyq1p+Yni+y/8LpOBDc57TT0vIhMsWNP24QmAP63JTwoQnYgYQeqvQuOXlsOwlsz4y Y0jyy69WHB36+u2aeVoY0FW+N9NjNeoVCTOgjjB7tyzt5N4Px7Nw+8rG6HdDr57JMO +aZHeBeBKPYlwW6PxIEiKkFRcwsieQlVOgRqI6kFptU4PfhA5qXTmx779vYCc0aWTm TUqOw9QZfeCPg== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Jan 2026 20:18:46 +0100 Subject: [PATCH mptcp-net v2 09/11] selftests: mptcp: join: avoid declaring i if not used Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260126-mptcp-issue-603-v2-9-8393e7840b9e@kernel.org> References: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> In-Reply-To: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" , Geliang Tang X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1359; i=matttbe@kernel.org; h=from:subject:message-id; bh=Z8cK/JNiqVPUBBg4tXXQ1Y0y30lvNWBmJ1Pbnubo00c=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLL99cdLXV/33Xxe+exbdGHDuje+XyfUfhHUU/KmRRFx Q0JXsFqHaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABNxFmb477xE0ZjjRHPQk4W7 9rxOi+i32KSR1L6g98/dyfcU9pUtU2f4Z22X0/esmI9v3p7/d1ZOE2AzbDC0Lpm7Sz3nzMsyZYb /fAA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 A few loops were declaring 'i', but this variable was not used. To avoid confusions, use '_' instead: it is more explicit to mark that this variable is not needed. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index a8b9782a85df..0f9253d607c3 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -603,8 +603,7 @@ wait_rm_addr() local old_cnt=3D"${2}" local cnt =20 - local i - for i in $(seq 10); do + for _ in $(seq 10); do cnt=3D$(rm_addr_count ${ns}) [ "$cnt" =3D "${old_cnt}" ] || break sleep 0.1 @@ -623,8 +622,7 @@ wait_rm_sf() local old_cnt=3D"${2}" local cnt =20 - local i - for i in $(seq 10); do + for _ in $(seq 10); do cnt=3D$(rm_sf_count ${ns}) [ "$cnt" =3D "${old_cnt}" ] || break sleep 0.1 @@ -648,8 +646,7 @@ wait_ll_ready() { local ns=3D"${1}" =20 - local i - for i in $(seq 50); do + for _ in $(seq 50); do ip -n "${ns}" -6 addr show scope link | grep "inet6 fe80" | grep -qw "tentative" || break sleep 0.1 --=20 2.51.0 From nobody Sun Feb 8 18:43:25 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 608EE27877D for ; Mon, 26 Jan 2026 19:24:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455497; cv=none; b=HkfUTEA6Qbfi9Wl4wu18YK4AFu9qOBYvno5J9ztE0bYf+gFKJhUlSt8DvRi3GRIbtgcykIg+UQO0qFgayCuLMKgg8Knr5y9eNt6uKJE8ye+63JAuWOrc6iULgbCKSL2Gy9DmKr5wNHwpwRZ8ZCuQoKEDJ2Hy6rkPXpJ6SxczKVk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455497; c=relaxed/simple; bh=hK+yDv0v7+KVb+xYAFsvnyGIUmuxWx2Pvp3fAPsLWGM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dqPaqFU2je66zfWkGeQCTkcRkFPcqd5TXakER7/7wWORUQE4Vd704l+yPjrTe947b9JXO/dKZGZWuMQCTlR2pe1FCwisnsta6CG1Ou6Y1PwfqWdmfOHtCMeoshQgy3fXXUnlHCNHoSaXV9me27JkLZ9EeT9ylzFZOVY6jIyl+uc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L/xVRBXu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L/xVRBXu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E954C4AF0C; Mon, 26 Jan 2026 19:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769455497; bh=hK+yDv0v7+KVb+xYAFsvnyGIUmuxWx2Pvp3fAPsLWGM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=L/xVRBXu2mWOptUbz9VZSVSPQYtjNBYWU0y2SGwv4ehg0zUolMULXSFzmFuLA3Ve7 cIHvXppOdzcqMHmZgk4kjmbm6IfR+iE0Vec8TdHYYCNVLTfWQ5sLcN0v4fFt3SPMot yrFhdqcoYmJMgVNBjn+FqVGeijAIFdGQRgKsD0dTR3PXGRexA2+1GxFhYaZNIo1Kha xIByglfd8GVOZX2CHVUuEq7RlNYYJRBCN0Fvoovg6zj6gAXEf/fk//n4rcKRlKnJlA oDEnv0yUtBe20fYGAhj9AM148FNeDcCDuAHiltAdc0kabbw4TTn4UvFjPUWRm8DUgQ xuGFyxiJhWoGw== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Jan 2026 20:18:47 +0100 Subject: [PATCH mptcp-net v2 10/11] selftests: mptcp: connect: fix maybe-uninitialize warn Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260126-mptcp-issue-603-v2-10-8393e7840b9e@kernel.org> References: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> In-Reply-To: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" , Geliang Tang X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1432; i=matttbe@kernel.org; h=from:subject:message-id; bh=hK+yDv0v7+KVb+xYAFsvnyGIUmuxWx2Pvp3fAPsLWGM=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLL99fFeKx8Ff3rh8zXY3w/ry7i0L47lcVXf/WZ3wcr/ /+3n3pzT0cpC4MYF4OsmCKLdFtk/sznVbwlXn4WMHNYmUCGMHBxCsBEvJgZ/gfH7OQ7x6/sflRY NC3YeZot6xLphb+idSZJz9PIMphxt42RYZL7UYG7pm3Rvuk7nj3+fkHAO/mGNoPLGqbYQH1Zjf6 PzAA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 This warning can be seen with GCC 15.2: mptcp_connect.c: In function =E2=80=98main_loop=E2=80=99: mptcp_connect.c:1422:37: warning: =E2=80=98peer=E2=80=99 may be used unin= itialized [-Wmaybe-uninitialized] 1422 | if (connect(fd, peer->ai_addr, peer->ai_addrlen)) | ~~~~^~~~~~~~~ mptcp_connect.c:1377:26: note: =E2=80=98peer=E2=80=99 was declared here 1377 | struct addrinfo *peer; | ^~~~ This variable is set in sock_connect_mptcp() in some conditions. If not, this helper returns an error, and the program stops. So this is a false positive, but better remove it by initialising peer to NULL. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/test= ing/selftests/net/mptcp/mptcp_connect.c index 1c4fe60089a2..554886f23d6a 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1354,8 +1354,8 @@ void xdisconnect(int fd) =20 int main_loop(void) { + struct addrinfo *peer =3D NULL; int fd =3D 0, ret, fd_in =3D 0; - struct addrinfo *peer; struct wstate winfo; =20 if (cfg_input && cfg_sockopt_types.mptfo) { --=20 2.51.0 From nobody Sun Feb 8 18:43:25 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DBCE27877D for ; Mon, 26 Jan 2026 19:24:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455498; cv=none; b=ea0VPJ6sPlS/yPotYldMUsRo1vdiqafUmMMANjysANGZsJdVljkeOhYP6NPWcfKK6ooizmZFSCY6edrIUAc0SjsjhFm93WkMs1KY+yTuCtTYJKhX2R+mVkrkUk6129ThsfLgY1v42X0Td1sadhkmvTqCQsZB1hVFa+yaCD8dTLM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769455498; c=relaxed/simple; bh=EHENzNVQYoEkrsZOJYba954H0Z36EQpT8zSFFfpaLyY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=P+3vsp+1zLdJEL6uAwhG3tDEVxNUGGYUGov0iMCDhGq0shyAsSbzEDnesDlncvXmM0iAVe3V43+rnA4DrQMfrQE1cmkH7UgaZQ1uX8BIO6c+n15Xe+MuQf0XWJhKiw6fiyLARoYMLwNDUb1Dbf9Bot+8Ce6VADxu1H0BP6q2v9A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KLdO6IDP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KLdO6IDP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A638C116C6; Mon, 26 Jan 2026 19:24:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769455498; bh=EHENzNVQYoEkrsZOJYba954H0Z36EQpT8zSFFfpaLyY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=KLdO6IDP0oCuZO0AdVA1OWWkWuMEA5YkZNzV1gHf54vY4Pi1hX62S8MC4C5ujnUEX C3Ml5JvJ2EqqAnZim//Z8R1xzSXggaiEMS/esbJDROoYHwCwD/TAVbXjxGoei9kfVs RzaH62Ayj7mAQzRxtlXHc53VNemeUD7gofIpJwj+UKLgpaZQR42r3zIPQN30vUO7H7 E4eS1MG7yuwq3OG39VRpxym/kPfFrlG0xmfp6AjaLj1OmcwOyT9rtPnhlbgBS3n7lQ 5LbG0cgSAVND4vtPd6Kc/Lg7ILD1Zwv3GJxGmYbifE+rc3FtGFljc+o98jCvZ0t6KI XXLr6yHEQWnyA== From: "Matthieu Baerts (NGI0)" Date: Mon, 26 Jan 2026 20:18:48 +0100 Subject: [PATCH mptcp-net v2 11/11] selftests: mptcp: connect cleanup TFO setup Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260126-mptcp-issue-603-v2-11-8393e7840b9e@kernel.org> References: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> In-Reply-To: <20260126-mptcp-issue-603-v2-0-8393e7840b9e@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" , Geliang Tang X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1762; i=matttbe@kernel.org; h=from:subject:message-id; bh=EHENzNVQYoEkrsZOJYba954H0Z36EQpT8zSFFfpaLyY=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDLL99e/Vr2ycF/a67lBqRVP9s4XdWfc3lgpGeuykVlSd q7mHUOujlIWBjEuBlkxRRbptsj8mc+reEu8/Cxg5rAygQxh4OIUgIl8FmNkeJVQsF75y+ZuDrnT zcmKplNqfM/43wuIKizY/f/aoohDxowME32y1hXtucM/UVP0esSsND3ldCazyY+fp/GyR12aZqP KAQA= X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 To the TFO, only the file descriptor is needed, the family is not. Also, the error can be handled the same way when 'sendto()' or 'connect()' are used. Only the printed error message is different. This avoids a bit of confusions. Reviewed-by: Geliang Tang Signed-off-by: Matthieu Baerts (NGI0) --- tools/testing/selftests/net/mptcp/mptcp_connect.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.c b/tools/test= ing/selftests/net/mptcp/mptcp_connect.c index 554886f23d6a..ff1a298d3469 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -259,7 +259,7 @@ static void set_transparent(int fd, int pf) } } =20 -static void set_mptfo(int fd, int pf) +static void set_mptfo(int fd) { int qlen =3D 25; =20 @@ -336,7 +336,7 @@ static int sock_listen_mptcp(const char * const listena= ddr, set_transparent(sock, pf); =20 if (cfg_sockopt_types.mptfo) - set_mptfo(sock, pf); + set_mptfo(sock); =20 if (bind(sock, a->ai_addr, a->ai_addrlen) =3D=3D 0) break; /* success */ @@ -407,21 +407,18 @@ static int sock_connect_mptcp(const char * const remo= teaddr, *peer =3D a; break; /* success */ } + perror("sendto()"); } else { if (connect(sock, a->ai_addr, a->ai_addrlen) =3D=3D 0) { *peer =3D a; break; /* success */ } - } - if (cfg_sockopt_types.mptfo) { - perror("sendto()"); - close(sock); - sock =3D -1; - } else { perror("connect()"); - close(sock); - sock =3D -1; } + + /* error */ + close(sock); + sock =3D -1; } =20 freeaddrinfo(addr); --=20 2.51.0