From nobody Mon Feb 9 17:23:34 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:cbb9:0:0:0:0:0 with SMTP id v25csp1060567jap; Wed, 17 Nov 2021 17:30:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJ/ZNKCi87G2rdGO7AzQplb93sq4ZZ/kSLxGCBgAMbxr3mNzNzeRYie6hjihxBmLl8MbGM X-Received: by 2002:a9f:3587:: with SMTP id t7mr30723266uad.49.1637199025427; Wed, 17 Nov 2021 17:30:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637199025; cv=none; d=google.com; s=arc-20160816; b=WU/vftHOhjCv3WkNjlgdimkgQCS6PgfL/OgxXYyDXFELFc1xjcj75fN1RZajKzbFI5 eqzYj8Od4TrPp7/b11m1P8e8gGkO6YQw0ZSIMOfD1//xNu0zICcmF8yCO+Qj7TgDyv6S b33FEZ1trPfolm9f5QPGCZKd5ZLAicRVn+xs9B+PAARk3AjT2TWn8n0uGKbwnVnGOMR1 EzJksG2JEcoLkgJyP56B51/LV3d7oy+5i16sSipv5eJxHBKrldnPL3y4WDd1KEUWWRa8 ZZNChyDqJ+K70M9B1DEYMhZm00c8632XZUrRBbQoQvlHuf37cOwc1iH/EW+/+znvjOfE dzrg== 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; bh=df0Uy60JOmM20CO8r9uRo9PJVOFA33t7d1AHk/rBDwM=; b=ud+v8nQsntgDLBzkOsXLB/AWYwWem6WmIDxF6aQ/Yman56E/P7EKXQOl6vxjElUE3M lsN5Ivw1Z8z7P3ukPOfuWJmJpYvVHMYUh4/L8FG02tODGGq4VBsq6yPmYvV1aSawdhq2 162CWQKb52wKqzaWa4adDtvdteY91M1/wJXm5gSVsVpwiN98jP2m7NaJ+/eXxJfG02du WnYKZK8w1ut6Hpf/xGE0EDystdmOfp5+cYXmMsFBWVVqrCeddvjbQ5WdGJ0aT3SN0tsi 7yCQdkmRuwMOYdCVUQEKKKS1kHE5kv5/4fco5L2oidNiPqYluna95alW/+4T2IbB4d2x Oflw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mptcp+bounces-2464-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) smtp.mailfrom="mptcp+bounces-2464-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ewr.edge.kernel.org (ewr.edge.kernel.org. [147.75.197.195]) by mx.google.com with ESMTPS id b9si4552554vsu.235.2021.11.17.17.30.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Nov 2021 17:30:25 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2464-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; spf=pass (google.com: domain of mptcp+bounces-2464-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 147.75.197.195 as permitted sender) smtp.mailfrom="mptcp+bounces-2464-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.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 0EE8A1C09FE for ; Thu, 18 Nov 2021 01:30:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5A482C83; Thu, 18 Nov 2021 01:30:18 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 D02862C99 for ; Thu, 18 Nov 2021 01:30:17 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="231577918" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="231577918" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2021 17:30:15 -0800 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="568294753" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.251.27.251]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2021 17:30:15 -0800 From: Mat Martineau To: mptcp@lists.linux.dev Cc: Mat Martineau Subject: [PATCH mptcp-next 6/6] selftests: mptcp: Add tests for userspace PM type Date: Wed, 17 Nov 2021 17:30:05 -0800 Message-Id: <20211118013005.263660-7-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211118013005.263660-1-mathew.j.martineau@linux.intel.com> References: <20211118013005.263660-1-mathew.j.martineau@linux.intel.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" These tests ensure that the in-kernel path manager is bypassed when the userspace path manager is configured. Kernel code is still responsible for ADD_ADDR echo, so also make sure that's working. Signed-off-by: Mat Martineau --- .../testing/selftests/net/mptcp/mptcp_join.sh | 70 ++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 2684ef9c0d42..7df9ddb307a8 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -50,6 +50,7 @@ init() ip netns add $netns || exit $ksft_skip ip -net $netns link set lo up ip netns exec $netns sysctl -q net.mptcp.enabled=3D1 + ip netns exec $netns sysctl -q net.mptcp.pm_type=3D0 ip netns exec $netns sysctl -q net.ipv4.conf.all.rp_filter=3D0 ip netns exec $netns sysctl -q net.ipv4.conf.default.rp_filter=3D0 if [ $checksum -eq 1 ]; then @@ -1837,6 +1838,68 @@ fullmesh_tests() chk_add_nr 1 1 } =20 +userspace_tests() +{ + # userspace pm type prevents add_addr + reset + ip netns exec $ns1 sysctl -q net.mptcp.pm_type=3D1 + ip netns exec $ns1 ./pm_nl_ctl limits 0 2 + ip netns exec $ns2 ./pm_nl_ctl limits 0 2 + ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal + run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "userspace pm type prevents add_addr" 0 0 0 + chk_add_nr 0 0 + + # userspace pm type echoes add_addr + reset + ip netns exec $ns2 sysctl -q net.mptcp.pm_type=3D1 + ip netns exec $ns1 ./pm_nl_ctl limits 0 2 + ip netns exec $ns2 ./pm_nl_ctl limits 0 2 + ip netns exec $ns1 ./pm_nl_ctl add 10.0.2.1 flags signal + run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "userspace pm type echoes add_addr" 0 0 0 + chk_add_nr 1 1 + + # userspace pm type rejects join + reset + ip netns exec $ns1 sysctl -q net.mptcp.pm_type=3D1 + ip netns exec $ns1 ./pm_nl_ctl limits 1 1 + ip netns exec $ns2 ./pm_nl_ctl limits 1 1 + ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow + run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "userspace pm type rejects join" 1 1 0 + + # userspace pm type does not send join + reset + ip netns exec $ns2 sysctl -q net.mptcp.pm_type=3D1 + ip netns exec $ns1 ./pm_nl_ctl limits 1 1 + ip netns exec $ns2 ./pm_nl_ctl limits 1 1 + ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow + run_tests $ns1 $ns2 10.0.1.1 + chk_join_nr "userspace pm type does not send join" 0 0 0 + + # userspace pm type prevents mp_prio + reset + ip netns exec $ns1 sysctl -q net.mptcp.pm_type=3D1 + ip netns exec $ns1 ./pm_nl_ctl limits 1 1 + ip netns exec $ns2 ./pm_nl_ctl limits 1 1 + ip netns exec $ns2 ./pm_nl_ctl add 10.0.3.2 flags subflow + run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow backup + chk_join_nr "userspace pm type prevents mp_prio" 1 1 0 + chk_prio_nr 0 0 + + # userspace pm type prevents rm_addr + reset + ip netns exec $ns1 sysctl -q net.mptcp.pm_type=3D1 + ip netns exec $ns2 sysctl -q net.mptcp.pm_type=3D1 + 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 + run_tests $ns1 $ns2 10.0.1.1 0 0 -1 slow + chk_join_nr "userspace pm type prevents rm_addr" 0 0 0 + chk_rm_nr 0 0 +} + all_tests() { subflows_tests @@ -1853,6 +1916,7 @@ all_tests() checksum_tests deny_join_id0_tests fullmesh_tests + userspace_tests } =20 usage() @@ -1872,6 +1936,7 @@ usage() echo " -S checksum_tests" echo " -d deny_join_id0_tests" echo " -m fullmesh_tests" + echo " -u userspace_tests" echo " -c capture pcap files" echo " -C enable data checksum" echo " -h help" @@ -1907,7 +1972,7 @@ if [ $do_all_tests -eq 1 ]; then exit $ret fi =20 -while getopts 'fsltra64bpkdmchCS' opt; do +while getopts 'fsltra64bpkdmuchCS' opt; do case $opt in f) subflows_tests @@ -1951,6 +2016,9 @@ while getopts 'fsltra64bpkdmchCS' opt; do m) fullmesh_tests ;; + u) + userspace_tests + ;; c) ;; C) --=20 2.34.0