From nobody Sun Feb 8 03:58:23 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:cbb9:0:0:0:0:0 with SMTP id v25csp1803486jap; Fri, 26 Nov 2021 04:19:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTYxFP2NZyqoDaCpZX8i8DfMgCnzyVOXs98gOhvkJarWY2P4DSdsXUCfhqIV8b0ncpLtfp X-Received: by 2002:ab0:71c3:: with SMTP id n3mr32964565uao.54.1637929168510; Fri, 26 Nov 2021 04:19:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637929168; cv=none; d=google.com; s=arc-20160816; b=RQFUSbRtWoaNZ5oon9MBsuLjON/gIUYeUwReswdpYhJL16CqfrpCkzHPsiZjDsQiiQ xCbyTloZQCkw6hOTLDJBFOheSQGlsjO//8sdaDuoYqBRAAgvpgdBD+8+WETZ3jObmN3c Upr2x3xczpRArnhHUS4snmtngmlgHHBM0QAALkM4M91PvigeBxdgUi+RpH+WAdzzkL1D vRHEFAfsVHwIjM4nY6TMPmPmat3JdpZ/2Q85aZw+J/NyPbbkNOsQSEs0r8GiWMijcF5M EehtcwkHwM1geQ0TUP9Y6kNleR+AAwH2SlWphmp9hMrw0m9EKzoKoRx46V0Fr+cGWooW ZGqg== 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:to:from:dkim-signature; bh=h4z8wCUS89CcyUEM+0LmMvqsYXS2sjkIU3n6Pg//daQ=; b=EjSV5UQdKVRsGnpyAR1VBSVtrcXzENkJ2sueRBagISuICeh9lXsT98fP8YYwOdvlS7 ItB3MXJeAQPPGsu1JJ+NSnBjmdU0+fIiskvbrNUJMFE921oSY/wBaJRZNTRvz6C5fqUz A77wyw6ZBJQivb3MstFSbEVpgoxwMQ1N3JIYCzO865N+dQP2Q+m0nhUseEOR2/K4b+bn tm1+IHBOV9R1+fr2Zh65PgJfuu39azDwjweRQ9OacScvlzRc+9C8YHQpypjs3q1fY6aw udNZGn+1TmsT9R0XnZbTISE0q3NHmDSGghpaTMbsruySwLlbbjQgW4tNLX04f9rxmkUS DJZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZwB6NVp2; spf=pass (google.com: domain of mptcp+bounces-2551-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-2551-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [147.75.69.165]) by mx.google.com with ESMTPS id 33si9742292vkn.39.2021.11.26.04.19.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Nov 2021 04:19:28 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2551-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) client-ip=147.75.69.165; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZwB6NVp2; spf=pass (google.com: domain of mptcp+bounces-2551-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.69.165 as permitted sender) smtp.mailfrom="mptcp+bounces-2551-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 sjc.edge.kernel.org (Postfix) with ESMTPS id DCA913E11B7 for ; Fri, 26 Nov 2021 12:19:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 207902C87; Fri, 26 Nov 2021 12:19:25 +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.133.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 E21EA2C86 for ; Fri, 26 Nov 2021 12:19:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637929163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to: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=ZwB6NVp2pogZaaKgswcy/C7Y9voRiNAQzLYkJ68MeNJ+eXv5/FwTj3pCvMVBQNqVn2h+Sq +U3TzHysSeHrJPF2VbEwhjuK7yRUFbBQQRYthhD2pan4mwv/Y+d55OSKu1Q5PUBINsr03G ttxKoeNvcf6v85KEjZfYvcKGmBcFJ80= 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-232-MG2xo0KCP461sIPS0B5lZA-1; Fri, 26 Nov 2021 07:19:21 -0500 X-MC-Unique: MG2xo0KCP461sIPS0B5lZA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 099161F2DB for ; Fri, 26 Nov 2021 12:19:21 +0000 (UTC) Received: from gerbillo.fritz.box (unknown [10.39.194.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E60919C46 for ; Fri, 26 Nov 2021 12:19:20 +0000 (UTC) From: Paolo Abeni To: mptcp@lists.linux.dev Subject: [PATCH v2 mptcp-next 4/4] selftests: mptcp: add tests for subflow creation failure Date: Fri, 26 Nov 2021 13:19:09 +0100 Message-Id: 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.23 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