From nobody Thu Jan 8 10:12:48 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 F0F001DFDB8 for ; Fri, 26 Dec 2025 06:40:38 +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=1766731239; cv=none; b=EVWuepOTlGdQ+4CLDGE1nBqFex/MlmEZVDYg9gP5N6MnZD73Lydx5Y6G4x8Dr0/9tYIMUTQbxC854xTH5NUrsRKC6upAfIZlCMrvAubSdCVQGhQvm4qx6dSfO9vmQd8BUZYUlJaKoHzDhrQJQOzgz0B2OTRZ3CN7/N1JPRFew1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766731239; c=relaxed/simple; bh=Qraa+t6rJPZ+4nMSWiWCDFDkvGT+LbudCM71qhohYbM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gRNwhfzO1W/SvQZ4CqcPTe/A1D6joMdV14LfCBM/lyy1S39Zv2jEY6ItUYn2Df6PDt+oenR27zohTOWfUZve+HpfApcgJcI6WzNsoPlmdPr2/tWNLHFOQnOAKHAp8vMVXlySRYpftbekdOoylbaXo4QYD2pAWBg8hnUf26azFTo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YwvCESFG; 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="YwvCESFG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1517DC113D0; Fri, 26 Dec 2025 06:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766731238; bh=Qraa+t6rJPZ+4nMSWiWCDFDkvGT+LbudCM71qhohYbM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YwvCESFGdfd3DymB/p8zvE+ngdQDACDwkw5lS/B2bLg7sYBgmL1hqHSmjFbBtqSWT ZJqirAiQvF0vEyoFtijL5spUwPGzEKv3x+iuP1jTUMhMrTYwwDVZXkRgPuvB1fGNRU 6QehYMxQUhHwuyTlZ/8NQqQXhuiaCfd9F+LLEFA74YvfnTLfq0/Lmj5NFrS7d9bCaf xIPtb0Jq0hYaEaLF2KoBApRFUY6CMloo5mGO+3rYdaD7jVNlvQYj4wlGh2mIQRQb2O It4dXHBaJ2EZpepgOnK2C6I4XVHz131l9QtAQgOXwQ6qcdVFPS8FxtgRbxbPiOTYDt JKLEbMI8Ihhfg== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Dec 2025 07:40:15 +0100 Subject: [PATCH mptcp-next 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: <20251226-mptcp-issue-603-v1-1-bb30e331b839@kernel.org> References: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> In-Reply-To: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" , Marco Angaroni X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1738; i=matttbe@kernel.org; h=from:subject:message-id; bh=Qraa+t6rJPZ+4nMSWiWCDFDkvGT+LbudCM71qhohYbM=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDL9dG9d0D6Qw3S1eH7OsZT0G9lt33eenPDnxJFFGiy78 ovqvtn+6ChlYRDjYpAVU2SRbovMn/m8irfEy88CZg4rE8gQBi5OAZhI1neGv3L2d/7OuuYlstvk e21sb+C3jD9zL1+dbcDfb2bt/3BlxDVGhgnLrqxovbFlz+Up2i8iAhakzTtr/VN5k63BpH/6Adz tivwA 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 Signed-off-by: Matthieu Baerts (NGI0) --- 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..1d68648b5194 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 1st subflow can already be closed/disco and still in the list */ + 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 Thu Jan 8 10:12:48 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 D08B81DFDB8 for ; Fri, 26 Dec 2025 06:40:39 +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=1766731239; cv=none; b=dQk61POCU8oiIJp4wjVJIud+Lpybdw8cJTLmUpkvgHdnwfpcJgF+hA5paJVw9DqwiIoYn0VppXvwmHSVb60IiMOyUhlN7t2K6K+5uF7GP0QWQOtThPIeZEAs2Qwtop4PcCzELhLE7TWOOw3s/+UqnMWcuiw6MZxRC+10UDzv4sU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766731239; c=relaxed/simple; bh=MCi1y25SPS8z7Y88JLvAm1fEInEpa/6tsyMqcR4lLAU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YzJDfzC5ZCo0zSjrDyAlkpaHOuY/FYbZ9Ixl4gMYP++3p8mnYFSIcGJH60j4eET0ThHjh6e+hZREJpsD05GYw+6ZR9Z60PxEU8+RQ0Uz7hdv+toP+1MgVZrjmLeEO2zoHkXAsmDL1jRFkGRgqqC1AZEtV1pslCXkYptueXqEPs8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Wb5nfXi6; 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="Wb5nfXi6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3139C4CEF7; Fri, 26 Dec 2025 06:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766731239; bh=MCi1y25SPS8z7Y88JLvAm1fEInEpa/6tsyMqcR4lLAU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Wb5nfXi6rNku5QsAlZIQB3frEb0LUkmu2A6tQcnHIRJkTdfcBcIGyJOq9I4PAA+d2 uxgjYt0iIAyJOfLq2i6lhbhPSKrf6xwnpIIlU1cXBgkHWJX6p1EO23uULvNtLfTpnP WRK4FraHnIqzdYoUJrh6V2nacuQUouQibzkjGHDHlIX8d9M8IGKeioLRuXNUp/G4eP hYXXcrLl4ARYd7+IwzBJ0NYnJJ9VRLaeZMyTDg8zsSajcbQdAiNUPeEXxcQ038AWXU oyitFZX0Kd6DwRQgIGg46VvZepYFCPmjjk91sqSaHVFz3+I00Djy6YrjYTLbLbFTYy 8Kvwg1Ew6sEIA== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Dec 2025 07:40:16 +0100 Subject: [PATCH mptcp-next 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: <20251226-mptcp-issue-603-v1-2-bb30e331b839@kernel.org> References: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> In-Reply-To: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3443; i=matttbe@kernel.org; h=from:subject:message-id; bh=MCi1y25SPS8z7Y88JLvAm1fEInEpa/6tsyMqcR4lLAU=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDL9dG9/svEz+bFF5LPrhM6zwqfOOJrXNh/9dEot+p1aQ PrUOXuUO0pZGMS4GGTFFFmk2yLzZz6v4i3x8rOAmcPKBDKEgYtTACZy2YmRoSee7fyc7VbBgWFe nRovFza1pz7/N7vkN+/hrGzt29Mz/zH8D99frmA2u8GnMd1Jd7b0Uzmmy7MFwgJLtBYorN4VaHO TDQA= 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) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 49 +++++++++++++++++++++= ++++ 1 file changed, 49 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index b2e6e548f796..468ffb97293b 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3872,11 +3872,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 @@ -4085,6 +4106,34 @@ 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 --tc= p-option 30 -j REJECT --reject-with tcp-reset && + ip netns exec "${ns2}" ${iptables} -A INPUT -d "10.0.1.2" -p tcp --tc= p-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 Thu Jan 8 10:12:48 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 511961DFDB8 for ; Fri, 26 Dec 2025 06:40:40 +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=1766731240; cv=none; b=A9KyJieGjqlu4FdlwGdxnGQ0aOOrb1ptRHH1fVrMu8T/uJ1crl7CN8FOPhR7ftd/f5cdmIQl8sumTiZOPWKLL/WoBFBFP0U85635AsHERRuou81p+WtsxAP81/NiziAN5nqIDlCPNj/3kkPvKlOsaDWueMe1/w4gDW5VY/JSQvc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766731240; c=relaxed/simple; bh=gtUybE9wszvo+9x8LDu2L+Gz8Vg2wf3Wvn6frsIYIjg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=olJG41EWI8RVitlfB9PsiP42F+TU8SHvuVOjXsiri8LLwY5dXAnv5qI9CYesi6N1ptUXFd40eEY8cUNxc5HTH21mKCTR+EPwVLGPuuXmGovO8c53fqVwtWfBk+hknRe4RKUgQrSUnGk2CMluvuLTb9PcEiE87ZkhuZrwSrBnm64= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OPousf47; 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="OPousf47" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9ACAC113D0; Fri, 26 Dec 2025 06:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766731240; bh=gtUybE9wszvo+9x8LDu2L+Gz8Vg2wf3Wvn6frsIYIjg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=OPousf47zbGRLSQzyD3IGBnTjXg16b//4ow7afQK/Nxuue9c+tsGC7Nm3EVLNF2SJ IwoJ4xkCSYMipdKTvLcDEOeHScCksSDKyd0f7udyQC1ieZ1tjTqAKxE5rzQZju5qfh 2MVd2Tpj3NXDWQFhr9kW6Ovyf5XOzDHfnETxg4zeqV8xSImG3JzDNKdYX8Y9e46/Xj AjvW4P2SzpYp5i5cfjIjhzDoKy1kAJEXekRqywIJW5cYrnT9LA+yVkiwruGJI/xUCl RakUMdnvK7JDLynCyetpTapBu4Yhn30O7etVhXVBBfO1T6GhhZRCdlDGKsEw1ELU3L dQPdkpXKCXdmQ== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Dec 2025 07:40:17 +0100 Subject: [PATCH mptcp-next 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: <20251226-mptcp-issue-603-v1-3-bb30e331b839@kernel.org> References: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> In-Reply-To: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1891; i=matttbe@kernel.org; h=from:subject:message-id; bh=gtUybE9wszvo+9x8LDu2L+Gz8Vg2wf3Wvn6frsIYIjg=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDL9dO+IKJet+Lq96GRkbq3RGlGOh1VdfB/bzlg9u/7l9 5Ww/kvGHaUsDGJcDLJiiizSbZH5M59X8ZZ4+VnAzGFlAhnCwMUpABMR0mP476lv1RXjeYzLYtnU 7eunWvzmVk/3Tjg2uU6LU5z7++0GeUaG4y67uE0/fz1z5omK/ORL/J/zdfZ4iZy4x3XS0e1BfeR 7LgA= 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) --- 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. --- net/mptcp/protocol.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 1d68648b5194..5d6c987089c6 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -817,10 +817,9 @@ 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; =20 - if (!err) + if (!READ_ONCE(ssk->sk_err)) return false; =20 /* only propagate errors on fallen-back sockets or @@ -837,7 +836,7 @@ static bool __mptcp_subflow_error_report(struct sock *s= k, struct sock *ssk) ssk_state =3D inet_sk_state_load(ssk); if (ssk_state =3D=3D TCP_CLOSE && !sock_flag(sk, SOCK_DEAD)) mptcp_set_state(sk, ssk_state); - WRITE_ONCE(sk->sk_err, -err); + WRITE_ONCE(sk->sk_err, -sock_error(ssk)); =20 /* This barrier is coupled with smp_rmb() in mptcp_poll() */ smp_wmb(); --=20 2.51.0 From nobody Thu Jan 8 10:12:48 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 5AA3D1DFDB8 for ; Fri, 26 Dec 2025 06:40:41 +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=1766731241; cv=none; b=GohLRFdhofQ4g+e+01dSkVxAUtMRptB4eZ6zKfSAYOOGTRfq+saoS+qdEAm3A0w+/0NsAOEQ7dzRpAQFGzk73wIKF2DxGkB+r2Nm/hlSt8+05KZv50z8MgGSW3SCOk/C+lVY3AfEbcGnJ2lssdiFNzmSXsx5NwXxndycaORIcss= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766731241; c=relaxed/simple; bh=7lwBXaaiytSrnOb4A9lX8uKFtCJoHPSb0Y+OFgVYFyQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ekef1AN7+n+plVYvGi1CSXsWvgxj94a5a57Z9ov/SMSd8LpCbm9UNORxSrtt19V/OKXHDgab5mnpkTzpRvtWZ1fCQ6WNBPkdc0lRrf2rKPaN01K/V9EBKrgwMm/cfjLbZZcRtnC9VQMTtBme9/pDwRphjg31FVNW0bvSiEGOG0U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V/JXNVqw; 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="V/JXNVqw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8086DC113D0; Fri, 26 Dec 2025 06:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766731240; bh=7lwBXaaiytSrnOb4A9lX8uKFtCJoHPSb0Y+OFgVYFyQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=V/JXNVqwc49d1qhgTOmO0TLDcz2+y5crTOl2EHOAVnpd6K4J+iuT2DA4OYDInxybl Y4Sh0RgOjD0BScxkd/wNYh6/PNaucC3Q/SPdT38E/o2JXml69YpyWqgUe7mYFdCuvX +C6K3US/6+NEfOVN5lTv+WtLNyeRcWLk4AWyuscTYK1k2EFxL/7mgSrcSWxzzNYmS7 5ptoxgJ5SCMA3Jafs3auCZiBSkkkrEZVdZxsecCK045spFp35NFOAQ/0tidgnojRPt lna/vj3hNGFfJgjNZUTxKj1/eRAmAKhbh2Am0tDAVxtAxQ3CE9hKfz1w0RqRM3LKqo 7ri7IlVkyuz/A== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Dec 2025 07:40:18 +0100 Subject: [PATCH mptcp-next 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: <20251226-mptcp-issue-603-v1-4-bb30e331b839@kernel.org> References: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> In-Reply-To: <20251226-mptcp-issue-603-v1-0-bb30e331b839@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=7lwBXaaiytSrnOb4A9lX8uKFtCJoHPSb0Y+OFgVYFyQ=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDL9dO9ueeT/eKlsg/iR18JrPh4O3CVkvuS89cZXdZfvF 0TPa7Aq7ihlYRDjYpAVU2SRbovMn/m8irfEy88CZg4rE8gQBi5OAZjIw2hGhicBH594ZH2Ufzr/ lk90yY1k67uX5HcfbTuyY3tp18ywaGOG//X/fBR0P6i47bxVrjtF/vzRY519osunpuvmJEqXXqp +ygsA 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) --- 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 468ffb97293b..bf0cc59b5210 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3847,21 +3847,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 @@ -3873,6 +3880,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 @@ -4129,7 +4146,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 Thu Jan 8 10:12:48 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 2BBC11DFDB8 for ; Fri, 26 Dec 2025 06:40:41 +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=1766731242; cv=none; b=I6SB4H+XSOEPfsVQzWnH0f+0s7Dz7Z2fmlvLTtgbkfJjP7CqU93x6hKXcNtTHVc4+HCQEvC1DX6AYLX4+jF5ijvJ8rmSv9lrlqj5R8p91MQGNZn0LfRs/2I5aPawFpPjV/hLUYoK/59n2ppHfICNn+sMgLLaQLCoP/Y+2uyN6bE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766731242; c=relaxed/simple; bh=jhjMiNr5+aaFx1bqk9cS/LdE2h7vU46w6MTlQZ9d9Qk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KKgwfEUinYijqYNAVTPlKoWw6LY342t7MF4TYmvAICWTw2pNsT2o2Zpn5ZDuiOtKce32MuiaZXHdZKnuBTVLETAeg0NrP8y+2b2P6JNBYUg1RF2B8FSXLSHEvAVv+yeHO7SZNrTjDnBb/2AJbJBxIlSKP9YPYJdrokBCrMJBbPg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NJy3t3bE; 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="NJy3t3bE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 477D5C4CEF7; Fri, 26 Dec 2025 06:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766731241; bh=jhjMiNr5+aaFx1bqk9cS/LdE2h7vU46w6MTlQZ9d9Qk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NJy3t3bEYRbssGi2WZaPZ08smw2S1AnmWm0cZtfLzW0cWKErMa4yDBgrNGg1baNUE HLgqTNO7pmji5b7HdY/WE6d008v1nitJG+O4PyKn3DatBnyDq2CGu2PqIIxjUVRvC2 i4XSGzy1WN6CpEDrzxxRG/1JXIzsSmYpiTS2EGAuAHoQE9AbWJhPFsAIqtgS7EiNt9 HDE8zIIyVe7q7rXcAzvQcCEIHumjP+3TbJ+kLj5KzFC6NpdN4VSUKTaBpo6H9f1K4x Q6DRwNSzg/xbd33csqgihIHV75Sbs38u17Jf7zXG0NCB7uh3WJEliqu5r3j/3EpVLn ejWYbklXalUEA== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Dec 2025 07:40:19 +0100 Subject: [PATCH mptcp-next 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: <20251226-mptcp-issue-603-v1-5-bb30e331b839@kernel.org> References: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> In-Reply-To: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3978; i=matttbe@kernel.org; h=from:subject:message-id; bh=jhjMiNr5+aaFx1bqk9cS/LdE2h7vU46w6MTlQZ9d9Qk=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDL9dO/9j5pnuPD/vxdrpi5dGbBI0jCqsYZrg+xElZ2M/ FI/lx5R6yhlYRDjYpAVU2SRbovMn/m8irfEy88CZg4rE8gQBi5OAZjIBR2G/w5bdXcmpWo+mnj+ 9erNJirXwmJqurdHBs1b8mvrmdeGbQkM/5S4vwc53YzhPu/9QbBur9MhpWVKgvEa6mv4/nNUx9s KMwIA 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) --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 18 ++++++++++-------- 1 file changed, 10 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 bf0cc59b5210..9b58d7567c18 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -4000,7 +4000,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 @@ -4033,7 +4033,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 @@ -4061,7 +4061,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 @@ -4082,7 +4082,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 @@ -4106,7 +4106,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 @@ -4159,6 +4159,7 @@ endpoint_tests() # userspace pm type prevents add_addr if reset "implicit EP" && continue_if mptcp_lib_kallsyms_has "subflow_rebuild_header$"; then + start_events 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 @@ -4166,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 @@ -4180,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 && @@ -4193,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 @@ -4271,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 Thu Jan 8 10:12:48 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 CD8481DFDB8 for ; Fri, 26 Dec 2025 06:40:42 +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=1766731242; cv=none; b=ikD1u99MzL4y1JrVAKKPLI7MHJJYtBnQ4VUFONCcwUcF3HRb/GslWcUrGiU6W5gIzZAmEg56m3pyFBtbsbROkURXGXK+s4NJPxm/zUilOUWwlht67bXb0OpsQgr9BiMvyqLKwX31t1SJFbQyECi5E0mxnXQkR+qxalRU3SAOHOs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766731242; c=relaxed/simple; bh=I6g/CxaHeQnEBKjAuNkEnCV5RoXjeg6XVnG+uN9y91w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cdLVa3qLU74HeiKw7tPpZZPoNhxPfrAT1K8ieo5Tf1H7GYtmuv+lvoCaRaXKTMUaCs+WhLVujfe1l+Qep/dpQXsFpM9el3cYZecrqIhw7lsIUPVSLCJHDPoAuCTqMT2MEkMJzU3+LR9V9auRHAsYGsdVBMvE755z0ueVzyQAW3Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZxBa6Yqh; 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="ZxBa6Yqh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E713C116D0; Fri, 26 Dec 2025 06:40:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766731242; bh=I6g/CxaHeQnEBKjAuNkEnCV5RoXjeg6XVnG+uN9y91w=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ZxBa6YqhKNOyA9zsPSSu3oZp3NOdJfz9yLTZBSEeK+jEZ+EQiEkN/hWOXNun6VwAb S2M1IXIfC0ahNJ/UJbhtWIIa01h3ez+1fjxCAXJnWy8OcOweAjV/o9xE6O2irdtaId SqoCpgcWS+yaPJCT2syJovOZgupwTPCwTcaUrmUIsRJYGMTAQtqEtPzuRp0S0VM/e/ lAn2AnBDo/P8Ue3hVtu19u+Tuxy7XM8Kmv17/xZeDuyZ5+S+DocPzJaWYX+K2DaZSJ d1UEZ5DD7ulm3TmbbzfLLkRW3dcD+Rg7XoDV/B779i7ZdgooQ7+NOO4Z/OXVEYkyOi Etb6BzSzb5y2A== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Dec 2025 07:40:20 +0100 Subject: [PATCH mptcp-next 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: <20251226-mptcp-issue-603-v1-6-bb30e331b839@kernel.org> References: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> In-Reply-To: <20251226-mptcp-issue-603-v1-0-bb30e331b839@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=I6g/CxaHeQnEBKjAuNkEnCV5RoXjeg6XVnG+uN9y91w=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDL9dO9HKvkJfbrIekKsS+vGI8/c3YkhO5levKo6l5CcM fl0p55GRykLgxgXg6yYIot0W2T+zOdVvCVefhYwc1iZQIYwcHEKwER4XRj+Ry8tvJyz8Pi8uV05 uiu+lv/+qrWrKeCwamlCb5FWD4sdH8Mv5oQW0yzmrdNuXKte9+vDc+atvmKdqhMmFUvyNf+7EMz PDAA= 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) --- 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 9b58d7567c18..cf28537b71f7 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 Thu Jan 8 10:12:48 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 9F2E81DFE26 for ; Fri, 26 Dec 2025 06:40:43 +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=1766731243; cv=none; b=Vevv6TpzSHbsPDutWDBlqJafAj+JghK5OQ+cDe00sSbgAF2apV6i3JbzYlC1OYOyzeyMb0zo+gS4wzEstwm8eNnolNAeUfPXWCPcZtfUO/O7AJwWW0TdDCTzgE6dXeIqib8YCFn5kX/94L7E3PEZ3oaPyeNIFCrRvDGCnhEStRw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766731243; c=relaxed/simple; bh=DMW34tbEoKsul9FuN+wymT8UDV5jEqmOjz8JHxNivqU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=g2zsBFODS5wsPPP9aD9uBmLEBvurPLcXM0wEZKW3ID41zAcwFahDe9Y4WG1Ggl4dKSJsekuTVBAXNdkbXyWvyhIa1F4/LXootLVu81wlKrJ4jTLYf3CFsoPw9YFsK9E3qKwbRFHcG5gIY8N8r4Yy/HX1loRqe2Ofpc3SLzxLwSc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rNmofOzf; 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="rNmofOzf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C98D9C113D0; Fri, 26 Dec 2025 06:40:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766731243; bh=DMW34tbEoKsul9FuN+wymT8UDV5jEqmOjz8JHxNivqU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=rNmofOzfmcXjyH2GMN0z69wdOBcqvvS591d41izYWCICSjPLMjfJT+V3PZ/0xiwT0 Ix26t87RUh1ouTjYFJLIN1+y4Scr1dTovoOihtoXrn2Uv6K64feSgVliqBS6h4g07H KQ5fChenplEp/6mINdN5xHHelK7TSGaAqSdJ+fVM62ECivFcZjDHL/ze4kmqhnBYzf P6PKgEN1CafPK1fhjeU+P/KRqFOZP9PtMf/l7/IxnPutimxqtvmMEkJAY7ZLHwCkMu DpovlzxGgWIUHMkqg1b7PaGCgfuYhFOid8zxFcNRMH6k8MHl1megZh2ezH/1ZO2WgO tFSUgoFFa1EGQ== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Dec 2025 07:40:21 +0100 Subject: [PATCH mptcp-next 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: <20251226-mptcp-issue-603-v1-7-bb30e331b839@kernel.org> References: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> In-Reply-To: <20251226-mptcp-issue-603-v1-0-bb30e331b839@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=DMW34tbEoKsul9FuN+wymT8UDV5jEqmOjz8JHxNivqU=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDL9dB8s+yt5yL0srTU4zivw0rc3Ua7Zs++2hdz6nLjJ5 Q0rU19nRykLgxgXg6yYIot0W2T+zOdVvCVefhYwc1iZQIYwcHEKwETaPzAy7DRmkNn44pB+jry5 +alj+09cu/fm0sMDbLeTz2w5n/Ao8jsjw82M21y+lsuuZD1+F2XJmxGpJldyN3RB+bRJehki58V b+AE= 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) --- 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 cf28537b71f7..63a84a4d43a6 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -3717,7 +3717,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 @@ -3748,7 +3747,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 @@ -4000,7 +3998,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 @@ -4033,6 +4033,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 @@ -4063,6 +4064,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 @@ -4082,6 +4084,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 @@ -4106,6 +4109,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 @@ -4132,6 +4136,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 Thu Jan 8 10:12:48 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 738C921C163 for ; Fri, 26 Dec 2025 06:40:44 +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=1766731244; cv=none; b=d/OkDXA7j4RjygHC2fwinEh9iLBuqf+pC1SG7/OPd4bj5XV0y2BexwIv7rL0Yu1z+JdeWBKOR6/8UvbVa4zgEGUI5TsJN6hmzOMDgDHmUDQeO8QIY03bwS3kfKsgCwyaCqlsJfy+Y3j8CjbRpToTAKOd7voFrU0cgM+CYkapqXA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766731244; c=relaxed/simple; bh=GlDwT9qgtQH30wgJpwvOD9NItVpCeYGnuyWNngZIUZU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ENZqpl0D2sLus7Ug9Rj+/xClFomWIHfj397Xx/floNgjXfHf9uNiygtqaOIUVo6VfKoxn8ySPpNHlXF+DLD4z5F8e424rPpGGVrPB2Weh/ZeEtln1TyStOfMwtkrFl8ff/5qxKZ51Sgi9wptUcJXR5jTI3DRJ09IGvZm/swMhBA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IDwAONtW; 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="IDwAONtW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 902C0C16AAE; Fri, 26 Dec 2025 06:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766731244; bh=GlDwT9qgtQH30wgJpwvOD9NItVpCeYGnuyWNngZIUZU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IDwAONtW/QuMBKBGSyNlep08oSqDzvjIhyn31BRC1t8pgwjkcphS1cycWmFvj1Gis cbNJw9OGwnkw6GMS2KZ4C2aKfjKtkCcUyz21u9o7gtEjZ2RgaQkCZOD5H0B46maUW2 2TzISanmgNfxeKoC0Qm8dTYsTJko/m1YPKPcRp57m2Zh7r9kyI9b9cG5Eb4ymRAZdu rRjwDNAErV3pzuSeg4LgRQ5u9kiqXEk9wM+PBUZQ0EzYSvb4gNWS9wTNEZIXQTduCi 8E7GT0wqzq4i6HkRjt+WNG+zz9BMvp8G8ixlZL+yL6Hz8X7QhkezUEgNzGEi4Y3YeX GF2ONEpb7ueSg== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Dec 2025 07:40:22 +0100 Subject: [PATCH mptcp-next 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: <20251226-mptcp-issue-603-v1-8-bb30e331b839@kernel.org> References: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> In-Reply-To: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1353; i=matttbe@kernel.org; h=from:subject:message-id; bh=GlDwT9qgtQH30wgJpwvOD9NItVpCeYGnuyWNngZIUZU=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDL9dB/e4Xa7w6ba02olOt3D8RjX92dfXm67v6HgQlj6/ +NWlb03O0pZGMS4GGTFFFmk2yLzZz6v4i3x8rOAmcPKBDKEgYtTACaid5Dhf9r+gDKp089y/t89 mN1Ws9l+7bxmcdWs5778t50mCcSF/WBk6Pu5uJ9z1g+F5AOV1i+0tiX/em7A+lpvl9AjL5vqyO/ 72QA= 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. 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 63a84a4d43a6..80e03168b419 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 Thu Jan 8 10:12:48 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 D3C5F1DFDB8 for ; Fri, 26 Dec 2025 06:40:44 +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=1766731244; cv=none; b=oiRJwZaQdZ6VOo7iv9cEH+bqfRgf0UvIpViA3uQrvuUgZhvUaybMaveU1k3nhr/KYGzekiVy58x5TBvVteTScCTuPXAC/Ghz1piHd9NYM1+TppLRkManW5eQENl7s5CNZttnlEg2B97JW31LUVnrKbmFoYer40BlNSNfJmS+vg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766731244; c=relaxed/simple; bh=EPM3VrvMtnC/n2lqAnWoJw0H0//DaGS52xi+CA6xgyQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JbgFAg8ZK/6Qc14KRtzDB2PkUZMZrK0CqN19gKUMuB8x3zOtYFsHu8MzArIPoQXTvC0Mxb3dRItHCS63vxvJgTat0B6Bb7BcrHlrt9scSL80wJtFD0KVpUIirJhEXrunL/oBITZRtkkbwFvyUUl7g+r0SkQDde2fVO4gU0rAVR4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qrsNkEvJ; 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="qrsNkEvJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56D63C113D0; Fri, 26 Dec 2025 06:40:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766731244; bh=EPM3VrvMtnC/n2lqAnWoJw0H0//DaGS52xi+CA6xgyQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qrsNkEvJVavYdQmEc3VhDU8E///9CvhYkn7DuSWY7k7Jz8qPfaQCuoamYvS43T5zO fDNziEPd7ivGkJXubyMtb0CigSWZUT0K1bM2RkPSY0IgWbXmcqa1u8KpEgZ10xk/nE A2bWfIqjf80ujHOCa0Gtpi8QhC+WhZ8U4YxHcetI6L9Y9d0karZIA5dZbadU5WMavD CG9FG5CTcoNevX9QAtLhdag+kNkg9FjMdZbaidUHIFHUMbBc0TwmQPY3vER8G31xEz NC9InGtFfj9/qXqtIFb8CsgT1+wXKkmepYiiDUQ8SOvtl5CFaWkyD2Fc6n8I/rLtGZ IlG0+vFUfEAbg== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Dec 2025 07:40:23 +0100 Subject: [PATCH mptcp-next 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: <20251226-mptcp-issue-603-v1-9-bb30e331b839@kernel.org> References: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> In-Reply-To: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1311; i=matttbe@kernel.org; h=from:subject:message-id; bh=EPM3VrvMtnC/n2lqAnWoJw0H0//DaGS52xi+CA6xgyQ=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDL9dB8pVb8sirzKL/FR/8nxw1NsZulvqdrc+vp/gPELQ XPjM7tndZSyMIhxMciKKbJIt0Xmz3xexVvi5WcBM4eVCWQIAxenAEyk05Xhv+8CweXH3+yecqTX //ri8KOp1s8X6Z7q5xDSKQl+plg+YSUjw87/Jw4dio8P9f3we4nrHudW4aYtP+yF526UzNWu//s omRUA 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. 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 80e03168b419..4ca4bdfea246 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 Thu Jan 8 10:12:48 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 E25BA1DFE26 for ; Fri, 26 Dec 2025 06:40:45 +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=1766731246; cv=none; b=Fz2mGHjQ+GC/mkuvXkb8QIUajX1gpufUQxf4MeTJL0HKcKDM9yJF1/E60zl80biUHLQtb42V+2w5//vhKSshI4iBOpI2uwlK00jy/TZQj0IbBqHocrZgrWf3GaPXJtRfUAH7qc5+7HM95zM3hEmspuMtK56y76ixWi+j4zaixkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766731246; c=relaxed/simple; bh=8EguqXF8awHx+bmrI9lqgUlarr8KMwXpgRyjVW9xOdE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Bq1L00DvtmsFuyhHOuIutzWgnBrVYRFoni2C1brYxJ2ZjAQUHFTiL4gXPjZtxMfTpXknCdJwzJd3qr5gt/6kiIRwsp08ntqI01kLrnZhjy02co3X5Js5yAKFvJsIbBfvccDK9s5O94fNE3SxYFnslLUYGUQ6D8APLxhrVRAH0A0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lAU/2O4U; 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="lAU/2O4U" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DB73C113D0; Fri, 26 Dec 2025 06:40:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766731245; bh=8EguqXF8awHx+bmrI9lqgUlarr8KMwXpgRyjVW9xOdE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lAU/2O4Uinrp/2+lSgChjhpfWZ+FVpAteCLPejGd1E/dBVri7AGRe+XEkTuqYaMys 1i4lI5B/cc51/FvPN3q8rFebqSxGabuRjWFVj5QguIKLsG+FoR63LhrxwboLC/gqam Yr7EzXDoi6GEruJu9tpCKIcalCthcJ9XVfeWrKprYBCVlVO5TFmhZiXoRtdossQL/t nGmhTKDmDEroKboxr9PagAfMKZlhJ7hUxUYtL7+jnRfpIfdRfZ55SnFgVJEhMZDSWD K6UvbfIgbJxfmcOmbnC43oqzBWcGSkOyIoBrcOdCYRQSketlDc9mWA2V8nUnuu4RLK Aj/k4w6myS+XA== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Dec 2025 07:40:24 +0100 Subject: [PATCH mptcp-next 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: <20251226-mptcp-issue-603-v1-10-bb30e331b839@kernel.org> References: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> In-Reply-To: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1384; i=matttbe@kernel.org; h=from:subject:message-id; bh=8EguqXF8awHx+bmrI9lqgUlarr8KMwXpgRyjVW9xOdE=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDL9dB+7ffF/YNt0LDZh/8upVx1eCe/58T7lrO69njdr/ wQHOLjf7ihlYRDjYpAVU2SRbovMn/m8irfEy88CZg4rE8gQBi5OAZiI+CmGv2LPO/Yoy1XGx+zv SVs352rDm5xFH60/xP2vFIz3UnK3vsjIMH29xq+7Nx9e3BN+U7O/Ndt30//M5A/rZrhY/TsVbb2 lixMA 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. 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 b82df82e0594..27a93a25b142 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -1353,8 +1353,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 Thu Jan 8 10:12:48 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 A713A1EA7CE for ; Fri, 26 Dec 2025 06:40:46 +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=1766731247; cv=none; b=mvDxr7swj7RAV3JJzAWHWU64AVvMQCsUo2xiynvStilsnLSXrPME9DERtSDUZo0WUCu8zld4zeS4oW/rTjlqzKMXpDK+GbKgHsGiS597Qf5S6m3JGDtkvCv1lOI+GKxpMOQaebIkKJdvwTvn+YmDdea+/cW15kD5ebQE2t/GHA8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766731247; c=relaxed/simple; bh=HFVAqDyBP9sSm69PwR05P5ImCpLotJfJ6PgW0UBPzlg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=enzqwtpZiLsft/nthXgIBcHndJ3Q1A/1+y/3nxbjPkUoXlmzmIQ5wNFgiV6Xy6+ynPDignl76OrJK/GB/nlFXXYfKZO+UxkKq95Pp+9NDfOwgihLKOhPdUhEdgcWDow4P96Jmeed0fs22QPHC9r6vlmiBLdDyzi3RI0ZQnBtQmM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IpJq7Dwo; 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="IpJq7Dwo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D875CC116D0; Fri, 26 Dec 2025 06:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1766731246; bh=HFVAqDyBP9sSm69PwR05P5ImCpLotJfJ6PgW0UBPzlg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=IpJq7DwokQkXbq+qcnC8CiEVvxX3IXgCK2dr3sq1QUNSCJzLI0jAIc8ROdS4DXek0 +imBAuoZYIWCTeEbDzTBW37AOh48LP4S5LtYQDD31rO7iO+sRUr3kTERy6nnJIRqsO mWom4z5YQ2ELgLfNFDya4ppTMCJMzXejH3Z4/VkjxzU9DCEm8Ms0+Qscu4SEXx4lq+ uYVOmdeSUtrr2b95A1IPq7kUogwwPsoB83EXNCxDUNyCnMu849D77c3viUmq0cRrlX y34PW/WAjwQ5FnpbuEn2i6qEpfUGAnbEt66N8vMPku5H/JcYsOqkvTIK2biAO1feTl oPacQiJPhvdHg== From: "Matthieu Baerts (NGI0)" Date: Fri, 26 Dec 2025 07:40:25 +0100 Subject: [PATCH mptcp-next 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: <20251226-mptcp-issue-603-v1-11-bb30e331b839@kernel.org> References: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> In-Reply-To: <20251226-mptcp-issue-603-v1-0-bb30e331b839@kernel.org> To: MPTCP Upstream Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1714; i=matttbe@kernel.org; h=from:subject:message-id; bh=HFVAqDyBP9sSm69PwR05P5ImCpLotJfJ6PgW0UBPzlg=; b=owGbwMvMwCVWo/Th0Gd3rumMp9WSGDL9dJ8wy6RbmnlW8LoJrdv9SSPbVTWr5V96bNThfUYcO gYqPqkdpSwMYlwMsmKKLNJtkfkzn1fxlnj5WcDMYWUCGcLAxSkAE1GSZmQ4JXX3cnDllpLss7aZ z9b951DnMmPMT/LsfvMrwjGg7WAYwz8lCy0XhasCK3kEpwe9CTi79HOd2b+G79Uv31WUH9jilcI LAA== 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. 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 27a93a25b142..6d2eb5cf8539 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.c +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.c @@ -258,7 +258,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 @@ -335,7 +335,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 */ @@ -406,21 +406,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