From nobody Mon Feb 9 06:02:06 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:cbb9:0:0:0:0:0 with SMTP id v25csp10559912jap; Wed, 24 Nov 2021 08:22:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8Fr6dVCG76o0wanuG+8Y4bhbnbrE6KRuEDZNDQLKjO8cyDQhiPLU5x+atQu7o/AOIImKC X-Received: by 2002:a05:6102:11ed:: with SMTP id e13mr26054863vsg.57.1637770963186; Wed, 24 Nov 2021 08:22:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637770963; cv=none; d=google.com; s=arc-20160816; b=GQoArCYqtm7X37eEqCYbbMQaOzz3Q1KhOvUazkYl+4cPnzDUg/PlJAcSWSbitMVU4A sdFki/oPDMNOkEr/acw1l0Td2frlok6lfvo3g4Ugbnw5fTyzkA+gzajA/pcbiJaFB8n4 UhfB0VZeAPJNP1thOEqEBcl7nSE6u3N8pOO9iTDEOqey+QWoqaOVw24XhdYPrHG6l2wO AkV00HGfLVqUezKBgM4TwUpV8VhsDMTqzzz3u93h+LKDgD2wFQgOFv9qHyrx0MgwRrhJ 7nicDn0gf5cNAAKlwQBbRJaxuwu9sSUPnkTq6P2oZyzG7uhwa+XQJXl/oOVFn1/dWPzH zUSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=h4z8wCUS89CcyUEM+0LmMvqsYXS2sjkIU3n6Pg//daQ=; b=yArmz6fkpPWV0aVLIIkCCGSYctw8Ic23N7LMaNeV5NWb5TJ3AD4+l8FVS99yn54wxJ Xll2pkJtiIUlGaF68zRRbpP9nNuDM8Vkhd4kXXF8DIDsdO4YOxftj2v2qiGaJc6gKbWZ 4pXFwM7cgSgleytjX6g8mj7mXBmBxhpTZKG0zz8rsljSusiLx2SenBDW1kF3nnelAXUb GKBjOUjaLJ34iXzdf5JdTzGnz2P5sf83gaVgQ4E85XjqvYaTSE0IrispmeR93JyBjdBx fSuKupFTjI+PsIi6FBe+4yGpu8KRedoWR31ikPqjQLJMUZfJgptaZv4shUx4DEFjxOAV UwMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UP5P0pxV; spf=pass (google.com: domain of mptcp+bounces-2536-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) smtp.mailfrom="mptcp+bounces-2536-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ewr.edge.kernel.org (ewr.edge.kernel.org. [147.75.197.195]) by mx.google.com with ESMTPS id h22si899826vsu.416.2021.11.24.08.22.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Nov 2021 08:22:43 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2536-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) client-ip=147.75.197.195; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UP5P0pxV; spf=pass (google.com: domain of mptcp+bounces-2536-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) smtp.mailfrom="mptcp+bounces-2536-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ewr.edge.kernel.org (Postfix) with ESMTPS id D25001C0F7F for ; Wed, 24 Nov 2021 16:22:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B3032C83; Wed, 24 Nov 2021 16:22:39 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 0FE1472 for ; Wed, 24 Nov 2021 16:22:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637770957; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=h4z8wCUS89CcyUEM+0LmMvqsYXS2sjkIU3n6Pg//daQ=; b=UP5P0pxVpH3Hy5kmEOs1ELZaQPX2ycc8/hUfofueXrf/eXBgYWs/rxMSY3ZsQ++a1Sg5Ti PyWIwoRpYVwxSHrDVX5lZi3fv6vvcpSxFCrJU611bZ1iJQxmeaYShumdP/qC+3XWb0QFHr NSxlPklwd+Rqv28+rulplxSxB4+bU/M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-499-CEKDtGh4PIuG9viWk7Vguw-1; Wed, 24 Nov 2021 11:22:34 -0500 X-MC-Unique: CEKDtGh4PIuG9viWk7Vguw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C8011193578B; Wed, 24 Nov 2021 16:22:33 +0000 (UTC) Received: from gerbillo.redhat.com (unknown [10.39.194.176]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05A1B100EBBF; Wed, 24 Nov 2021 16:22:32 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Cc: Phil Greenland Subject: [PATCH mptcp-next v2 4/4] selftests: mptcp: add tests for subflow creation failure Date: Wed, 24 Nov 2021 17:22:14 +0100 Message-Id: <44593f9acfe286b9d18973e13877c1e48a15706c.1637770883.git.pabeni@redhat.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pabeni@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- 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/selft= ests/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=3Dm CONFIG_NFT_SOCKET=3Dm CONFIG_IP_ADVANCED_ROUTER=3Dy CONFIG_IP_MULTIPLE_TABLES=3Dy +CONFIG_IP_NF_TARGET_REJECT=3Dm CONFIG_IPV6_MULTIPLE_TABLES=3Dy diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 2684ef9c0d42..6d342f9985b8 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 } =20 +wait_for_tw() +{ + local timeout_ms=3D$((timeout_poll * 1000)) + local time=3D0 + local ns=3D$1 + + while [ $time -lt $timeout_ms ]; do + local cnt=3D`ip netns exec $ns ss -t state time-wait |wc -l` + + [ "$cnt" =3D 1 ] && return 1 + time=3D$((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 } =20 +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 +} + 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 " -f 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 =20 -while getopts 'fsltra64bpkdmchCS' opt; do +while getopts 'fesltra64bpkdmchCS' opt; do case $opt in f) subflows_tests ;; + e) + subflows_error_tests + ;; s) signal_address_tests ;; --=20 2.33.1