From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Paolo Abeni <pabeni@redhat.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v4 5/5] selftests: mptcp: add tests for subflow creation failure
Date: Fri, 3 Dec 2021 17:13:05 -0800 (PST) [thread overview]
Message-ID: <1d52a2f6-8087-421-1fb3-572ee97041e2@linux.intel.com> (raw)
In-Reply-To: <bd0c8b9c4ac5e667889f0c0a5f99da295a574cd8.1638544716.git.pabeni@redhat.com>
On Fri, 3 Dec 2021, Paolo Abeni wrote:
> Verify that, when multiple endpoints are available, subflows
> creation proceed even when the first additional subflow creation
> fails - due to packet drop on the relevant link
>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
> v3 -> v4:
> - use $() where applicable - Matt
> - fix typo in help() - Matt
>
> v1 -> v2:
> - add missing NF kconfig
> - add more test-cases (drop, later subflow creation)
> ---
> tools/testing/selftests/net/mptcp/config | 1 +
> .../testing/selftests/net/mptcp/mptcp_join.sh | 65 ++++++++++++++++++-
> 2 files changed, 65 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/net/mptcp/config b/tools/testing/selftests/net/mptcp/config
> index 419e71560fd1..41e94e004bdc 100644
> --- a/tools/testing/selftests/net/mptcp/config
> +++ b/tools/testing/selftests/net/mptcp/config
> @@ -18,4 +18,5 @@ CONFIG_NFT_TPROXY=m
> CONFIG_NFT_SOCKET=m
> CONFIG_IP_ADVANCED_ROUTER=y
> CONFIG_IP_MULTIPLE_TABLES=y
> +CONFIG_IP_NF_TARGET_REJECT=m
> CONFIG_IPV6_MULTIPLE_TABLES=y
> diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> index 2684ef9c0d42..54a826ae984b 100755
> --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
> +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
> @@ -975,6 +975,22 @@ chk_link_usage()
> fi
> }
>
> +wait_for_tw()
> +{
> + local timeout_ms=$((timeout_poll * 1000))
> + local time=0
> + local ns=$1
> +
> + while [ $time -lt $timeout_ms ]; do
> + local cnt=$(ip netns exec $ns ss -t state time-wait |wc -l)
> +
> + [ "$cnt" = 1 ] && return 1
> + time=$((time + 100))
> + sleep 0.1
> + done
> + return 1
> +}
> +
> subflows_tests()
> {
> reset
> @@ -1032,6 +1048,48 @@ subflows_tests()
> chk_join_nr "single subflow, dev" 1 1 1
> }
>
> +subflows_error_tests()
> +{
> + # multiple subflows, with subflow creation error
> + reset
> + ip netns exec $ns1 ./pm_nl_ctl limits 0 2
> + ip netns exec $ns2 ./pm_nl_ctl limits 0 2
> + ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow
> + ip netns exec $ns2 ./pm_nl_ctl add 10.0.2.2 flags subflow
> + ip netns exec $ns1 iptables -A INPUT -s 10.0.3.2 -p tcp -j REJECT
> + run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow
> + chk_join_nr "multiple subflows, with failing subflow" 1 1 1
> +
> + # multiple subflows, with subflow timeout on MPJ
> + reset
> + ip netns exec $ns1 ./pm_nl_ctl limits 0 2
> + ip netns exec $ns2 ./pm_nl_ctl limits 0 2
> + ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow
> + ip netns exec $ns2 ./pm_nl_ctl add 10.0.2.2 flags subflow
> + ip netns exec $ns1 iptables -A INPUT -s 10.0.3.2 -p tcp -j DROP
> + run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow
> + chk_join_nr "multiple subflows, with subflow timeout" 1 1 1
> +
> + # multiple subflows, check that the endpoint corresponding to
> + # closed subflow (due to reset) is not reused if additional
> + # subflows are added later
> + reset
> + ip netns exec $ns1 ./pm_nl_ctl limits 0 1
> + ip netns exec $ns2 ./pm_nl_ctl limits 0 1
> + ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow
> + ip netns exec $ns1 iptables -A INPUT -s 10.0.3.2 -p tcp -j REJECT
> + run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow &
> +
> + # mpj subflow will be in TW after the reset
> + wait_for_tw $ns2
> + ip netns exec $ns2 ./pm_nl_ctl add 10.0.2.2 flags subflow
> + wait
> +
> + # additional subflow could be created only if the PM select
> + # the later endpoint, skipping the already used one
> + chk_join_nr "multiple subflows, fair usage on close" 1 1 1
> +}
The results are printed like this for me:
01 multiple subflows, with failing subflow syn[ ok ] - synack[ ok ] - ack[ ok ]
02 multiple subflows, with subflow timeout syn[ ok ] - synack[ ok ] - ack[ ok ]
02 multiple subflows, fair usage on close syn[ ok ] - synack[ ok ] - ack[ ok ]
^^ not 03
With test 3 running in the background, I guess $TEST_COUNT doesn't get
updated. Hopefully there aren't other globals doing unexpected things...
-Mat
> +
> signal_address_tests()
> {
> # add_address, unused
> @@ -1840,6 +1898,7 @@ fullmesh_tests()
> all_tests()
> {
> subflows_tests
> + subflows_error_tests
> signal_address_tests
> link_failure_tests
> add_addr_timeout_tests
> @@ -1859,6 +1918,7 @@ usage()
> {
> echo "mptcp_join usage:"
> echo " -f subflows_tests"
> + echo " -e subflows_error_tests"
> echo " -s signal_address_tests"
> echo " -l link_failure_tests"
> echo " -t add_addr_timeout_tests"
> @@ -1907,11 +1967,14 @@ if [ $do_all_tests -eq 1 ]; then
> exit $ret
> fi
>
> -while getopts 'fsltra64bpkdmchCS' opt; do
> +while getopts 'fesltra64bpkdmchCS' opt; do
> case $opt in
> f)
> subflows_tests
> ;;
> + e)
> + subflows_error_tests
> + ;;
> s)
> signal_address_tests
> ;;
> --
> 2.33.1
>
>
>
--
Mat Martineau
Intel
prev parent reply other threads:[~2021-12-04 1:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-03 15:19 [PATCH mptcp-next v4 0/5] mptcp: improve subflow creation on errors Paolo Abeni
2021-12-03 15:19 ` [PATCH mptcp-next v4 1/5] mptcp: fix per socket endpoint accounting Paolo Abeni
2021-12-03 15:19 ` [PATCH mptcp-next v4 2/5] mptcp: clean-up MPJ option writing Paolo Abeni
2021-12-03 15:19 ` [PATCH mptcp-next v4 3/5] mptcp: keep track of local endpoint still available for each msk Paolo Abeni
2021-12-04 1:05 ` Mat Martineau
2021-12-06 10:18 ` Paolo Abeni
2021-12-07 11:28 ` Paolo Abeni
2021-12-07 18:08 ` Paolo Abeni
2021-12-07 18:18 ` Mat Martineau
2021-12-09 10:13 ` Paolo Abeni
2021-12-03 15:19 ` [PATCH mptcp-next v4 4/5] mptcp: do not block subflows creation on errors Paolo Abeni
2021-12-03 15:19 ` [PATCH mptcp-next v4 5/5] selftests: mptcp: add tests for subflow creation failure Paolo Abeni
2021-12-04 1:13 ` Mat Martineau [this message]
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=1d52a2f6-8087-421-1fb3-572ee97041e2@linux.intel.com \
--to=mathew.j.martineau@linux.intel.com \
--cc=mptcp@lists.linux.dev \
--cc=pabeni@redhat.com \
/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