From: Geliang Tang <geliang@kernel.org>
To: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
MPTCP Upstream <mptcp@lists.linux.dev>
Subject: Re: [PATCH mptcp-next 02/11] selftests: mptcp: check no dup close events after error
Date: Sun, 04 Jan 2026 11:17:13 +0800 [thread overview]
Message-ID: <522643c85b522c8cd1ce7642179da7288ea9bd0f.camel@kernel.org> (raw)
In-Reply-To: <20251226-mptcp-issue-603-v1-2-bb30e331b839@kernel.org>
Hi Matt,
On Fri, 2025-12-26 at 07:40 +0100, Matthieu Baerts (NGI0) wrote:
> 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) <matttbe@kernel.org>
> ---
> 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/testing/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=$(grep -cw "type:${evt}" "${evts}")
> if [ "${count}" != "${exp}" ]; then
> fail_test "got ${count} events, expected ${exp}"
> + cat "${evts}"
> else
> print_ok
> fi
> }
>
> +# $1: ns ; $2: event type ; $3: expected count
> +wait_event()
> +{
> + local ns="${1}"
> + local evt_name="${2}"
> + local exp="${3}"
> +
> + local evt="${!evt_name}"
> + local evts="${evts_ns1}"
> + local count
> +
> + [ "${ns}" == "ns2" ] && evts="${evts_ns2}"
> +
> + for _ in $(seq 100); do
> + count=$(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=120 test_linkfail=128 speed=slow \
> + run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null
> + local tests_pid=$!
> + 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=1
> + 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
These two lines are too long and need to be wrapped.
Thanks,
-Geliang
> + 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
> }
>
> endpoint_tests()
next prev parent reply other threads:[~2026-01-04 3:17 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-26 6:40 [PATCH mptcp-next 00/11] mptcp: avoid dup events + error + misc Matthieu Baerts (NGI0)
2025-12-26 6:40 ` [PATCH mptcp-next 01/11] mptcp: avoid dup SUB_CLOSED events after disconnect Matthieu Baerts (NGI0)
2026-01-04 3:15 ` Geliang Tang
2025-12-26 6:40 ` [PATCH mptcp-next 02/11] selftests: mptcp: check no dup close events after error Matthieu Baerts (NGI0)
2026-01-04 3:17 ` Geliang Tang [this message]
2025-12-26 6:40 ` [PATCH mptcp-next 03/11] mptcp: only reset subflow errors when propagated Matthieu Baerts (NGI0)
2026-01-04 3:30 ` Geliang Tang
2026-01-04 4:00 ` Geliang Tang
2025-12-26 6:40 ` [PATCH mptcp-next 04/11] selftests: mptcp: check subflow errors in close events Matthieu Baerts (NGI0)
2025-12-26 6:40 ` [PATCH mptcp-next 05/11] selftests: mptcp: join: wait for estab event instead of MPJ Matthieu Baerts (NGI0)
2025-12-28 2:41 ` Geliang Tang
2025-12-26 6:40 ` [PATCH mptcp-next 06/11] selftests: mptcp: join: fix wait_mpj helper Matthieu Baerts (NGI0)
2025-12-26 6:40 ` [PATCH mptcp-next 07/11] selftests: mptcp: join: userspace: wait for new events Matthieu Baerts (NGI0)
2025-12-28 2:48 ` Geliang Tang
2026-01-26 18:59 ` Matthieu Baerts
2025-12-26 6:40 ` [PATCH mptcp-next 08/11] selftests: mptcp: join chk_stale_nr: avoid dup stats Matthieu Baerts (NGI0)
2025-12-28 2:25 ` Geliang Tang
2025-12-28 4:43 ` Geliang Tang
2025-12-26 6:40 ` [PATCH mptcp-next 09/11] selftests: mptcp: join: avoid declaring i if not used Matthieu Baerts (NGI0)
2025-12-28 2:51 ` Geliang Tang
2025-12-26 6:40 ` [PATCH mptcp-next 10/11] selftests: mptcp: connect: fix maybe-uninitialize warn Matthieu Baerts (NGI0)
2025-12-28 2:54 ` Geliang Tang
2026-01-26 19:02 ` Matthieu Baerts
2025-12-26 6:40 ` [PATCH mptcp-next 11/11] selftests: mptcp: connect cleanup TFO setup Matthieu Baerts (NGI0)
2025-12-28 2:59 ` Geliang Tang
2025-12-26 7:51 ` [PATCH mptcp-next 00/11] mptcp: avoid dup events + error + misc MPTCP CI
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=522643c85b522c8cd1ce7642179da7288ea9bd0f.camel@kernel.org \
--to=geliang@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox