From nobody Mon Feb 9 16:32:39 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:cbb9:0:0:0:0:0 with SMTP id v25csp398625jap; Wed, 15 Dec 2021 16:33:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXWo7FKJDpEgE3+2keotgZ4wYRPDLBBcRQUYZYwQ5HScCDlTb7qXD36XvdKVgfzFd4zH+g X-Received: by 2002:a0c:edca:: with SMTP id i10mr13971505qvr.62.1639614831286; Wed, 15 Dec 2021 16:33:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639614831; cv=none; d=google.com; s=arc-20160816; b=DPCxHjNYk7PCo2ZU1RQJ63Q4rQwoByyAt/gZZs/81C++kgdxKXDY14l3BlvcAekXqY LD4voR0/aFSivB358uTksS9wbwxD2HbgYe9xBX0DeqtasLvTxY1DG/3QEaFf/+Q/u2Gl Y0frPrUsQs1AJOPgG6CgAOgIF0csR3QyPDKsgeyskoAcnmXPhcaO/LlqNlGAQqGKKnGf tr0UF8QfJaJ3vb8bcFcaW0mOFcN1/Leo42YgfDnILYJ7btkShWxbB2J07rCiYGdHKy3f GGRKaeRy2c5WRPN5ScNVCsYExW5QCyjV16i/sp6BdAOYpNz+k/rrkEimb6OgNFKj22IZ FVtQ== 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=kHUcDsI44STX7nGDUVF9D881XTkAVw2tMoPdAuoYOQM=; b=vm2A6As6WeCF8pwvlH223IpBf7Y1clgTu8hf/CyQS77KdoqOd7DViHWh4cxxwOkC0O EsL/JogO3JfGp2jas7yDLglAbD/BJltuDHZQOpxnEfoo7+CO8rhwxyk5HbpulZYGgADY WhpxJwchmLkWwiZIXQxFQHIZ9u/NDPUVnBEmwlzEz4ES1HYIzfHyaXuH8dh967csl+oW klmmvQdLfG4/pAzwtQlh8Ll3w1mzP+wWW0mHu07TuPqrbJRQBrx6xSpAwtrSkZyZwt+H W43tEAfYV6AOWJzcaezl2W56BNLWKJnsRjaQWlEXjtogTkzujokvIgMMBTOrFDGFJxFm 6LPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mptcp+bounces-2783-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2783-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. [2604:1380:1:3600::1]) by mx.google.com with ESMTPS id t14si2054139qtw.31.2021.12.15.16.33.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Dec 2021 16:33:51 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2783-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) client-ip=2604:1380:1:3600::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mptcp+bounces-2783-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2783-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 D9D001C0C50 for ; Thu, 16 Dec 2021 00:33:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4671A3FDD; Thu, 16 Dec 2021 00:33:48 +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 E60D02FB6 for ; Thu, 16 Dec 2021 00:33:46 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10199"; a="236907571" X-IronPort-AV: E=Sophos;i="5.88,209,1635231600"; d="scan'208";a="236907571" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2021 16:33:30 -0800 X-IronPort-AV: E=Sophos;i="5.88,209,1635231600"; d="scan'208";a="465835394" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.209.72.63]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2021 16:33:29 -0800 From: Mat Martineau To: mptcp@lists.linux.dev Cc: Mat Martineau , Geliang Tang Subject: [PATCH mptcp-next v4 6/6] selftests: mptcp: Add tests for userspace PM type Date: Wed, 15 Dec 2021 16:33:24 -0800 Message-Id: <20211216003324.403195-7-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211216003324.403195-1-mathew.j.martineau@linux.intel.com> References: <20211216003324.403195-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. Tested-by: Geliang Tang 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 8cbff7ce35d6..dfff017a08f6 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 @@ -1911,6 +1912,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 @@ -1928,6 +1991,7 @@ all_tests() checksum_tests deny_join_id0_tests fullmesh_tests + userspace_tests } =20 usage() @@ -1948,6 +2012,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" @@ -1983,7 +2048,7 @@ if [ $do_all_tests -eq 1 ]; then exit $ret fi =20 -while getopts 'fesltra64bpkdmchCS' opt; do +while getopts 'fesltra64bpkdmuchCS' opt; do case $opt in f) subflows_tests @@ -2030,6 +2095,9 @@ while getopts 'fesltra64bpkdmchCS' opt; do m) fullmesh_tests ;; + u) + userspace_tests + ;; c) ;; C) --=20 2.34.1