From nobody Mon Feb 9 09:22:35 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:9f92:0:0:0:0:0 with SMTP id a18csp701898jam; Fri, 4 Feb 2022 16:03:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+4xKanBaV1bgdLcXMEi2z0OaDV+3oeZPZkaUwudbkzOdfO1SgYg6u/arAGaNnFOXqiNQr X-Received: by 2002:a05:6a00:1805:: with SMTP id y5mr5680544pfa.6.1644019432886; Fri, 04 Feb 2022 16:03:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644019432; cv=none; d=google.com; s=arc-20160816; b=x73S8q1keijXnpQw0m7V+LodZ8D2IxCq+RwapJh1VZbJq/OimHQoSOmZWH98GAAJcF BEEnA10ALS0F1bneELjA5oHpilplNROXjFuPrM5ZoCflF3jSsu6eCY/P8vniKP8qloLA nmqrl+RriuSIarqLxtyboI0581h30Q1JDJtEG7Ar2eZ3zi8Nv/XA5br6uORw1E7AtOA3 rx/i3DKiSQP4dVwERW6kTsEdvw8Re010CL1/RbEaSM3PoLXwUdLC8kbpVwj18zShflcc Z5QGRE2kN9qO/IPIab2dmT10e0J+7V03cLy9TILy/vsGknJqJbimcj6JXS+I4vxaX8M3 tAqA== 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=kOCk64ambahpQc6XmVYiKbVC/tVevW06BbvexBbu1k0=; b=AYJFYsEVs21Z2/jGHjF3vh7mjSRwy6et0ojIgIQBzsbgnGcgf3U192QqmYWty/s63b CuiqaqAcLEyX5Y51Y0pKo+CiGXprPwFJgDrEWsYnoWHS/DIglN5tiU71NCdndoZmyA6n WwMyaKWN7Qj9Q0HU/XS0Po/3MCc8yJlkjbSB0w31VpdLX3b52we4KAGR/h2fbP3MecY+ Tj/bsmi4/64cQQQ2406giImpHl2b5k3SEUIyPaHRY05p/CZXJzFUyVW168nM0IVteY2V pghvQoAeQPDiD83e3EaNNKKAZpunPwu1B+ynuzCA6P3IDXUSvyXE2BO0bK3Os8s98Gj1 nkNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ow2SqaRe; spf=pass (google.com: domain of mptcp+bounces-3480-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-3480-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [2604:1380:1000:8100::1]) by mx.google.com with ESMTPS id t79si3157888pfc.235.2022.02.04.16.03.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Feb 2022 16:03:52 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-3480-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) client-ip=2604:1380:1000:8100::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ow2SqaRe; spf=pass (google.com: domain of mptcp+bounces-3480-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-3480-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=pass (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 sjc.edge.kernel.org (Postfix) with ESMTPS id 484EE3E1014 for ; Sat, 5 Feb 2022 00:03:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 172782CA2; Sat, 5 Feb 2022 00:03:49 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 EAF702C9C for ; Sat, 5 Feb 2022 00:03:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644019427; x=1675555427; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NHxaD7+mSuBO6VwGpRSVDcFxi9YTf5ek/cd1ohC1TFk=; b=Ow2SqaRezYzOknEhpirWOHqFO8bn8/wdC1zpF21yhNtUTymYbhpB3tUq lpI1GGReYjchaQIidg3rKd6CutT98+G271yK5need/NS1cNT6LU4CUFn3 bZ84fPnCwshyXSKy2/a3J9SPrQMEcqBGtuDl1/sJKef8fMDp8D1F+ZgaR Z/r4qj/V5mZyDPknCejubNq/IyCrpfeRbydy/y3PSRari4MmFvcnFUigS BBMPvL3T/qzmq5TKReCbXAhvjSxfSJs1dnu/SeNUGP5ZtYd4g2u4Eh+dY aE0G4rE8TRQnDMulujAlwY4HHeLBKw1dnW3kMSBG6oEhhdd3TB6EdvLPd Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10248"; a="248678301" X-IronPort-AV: E=Sophos;i="5.88,344,1635231600"; d="scan'208";a="248678301" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2022 16:03:45 -0800 X-IronPort-AV: E=Sophos;i="5.88,344,1635231600"; d="scan'208";a="770097524" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.212.231.200]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2022 16:03:44 -0800 From: Mat Martineau To: netdev@vger.kernel.org Cc: Geliang Tang , davem@davemloft.net, kuba@kernel.org, matthieu.baerts@tessares.net, mptcp@lists.linux.dev, Mat Martineau Subject: [PATCH net-next 6/9] selftests: mptcp: add wrapper for setting flags Date: Fri, 4 Feb 2022 16:03:34 -0800 Message-Id: <20220205000337.187292-7-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220205000337.187292-1-mathew.j.martineau@linux.intel.com> References: <20220205000337.187292-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" From: Geliang Tang This patch implemented a new function named pm_nl_set_endpoint(), wrapped the PM netlink commands 'ip mptcp endpoint change flags' and 'pm_nl_ctl set flags' in it, and used a new argument 'ip_mptcp' to choose which one to use to set the flags of the PM endpoint. 'ip mptcp' used the ID number argument to find out the address to change flags, while 'pm_nl_ctl' used the address and port number arguments. So we need to parse the address ID from the PM dump output as well as the address and port number. Used this wrapper in do_transfer() instead of using the pm_nl_ctl command directly. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- .../testing/selftests/net/mptcp/mptcp_join.sh | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 093eb27f5c6d..757f26674c62 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -376,6 +376,22 @@ pm_nl_show_endpoints() fi } =20 +pm_nl_change_endpoint() +{ + local ns=3D$1 + local flags=3D$2 + local id=3D$3 + local addr=3D$4 + local port=3D"" + + if [ $ip_mptcp -eq 1 ]; then + ip -n $ns mptcp endpoint change id $id ${flags//","/" "} + else + if [ $5 -ne 0 ]; then port=3D"port $5"; fi + ip netns exec $ns ./pm_nl_ctl set $addr flags $flags $port + fi +} + do_transfer() { listener_ns=3D"$1" @@ -577,7 +593,7 @@ do_transfer() local arr=3D($line) local addr local port=3D0 - local _port=3D"" + local id =20 for i in ${arr[@]}; do if is_addr $i; then @@ -586,11 +602,13 @@ do_transfer() # The minimum expected port number is 10000 if [ $i -gt 10000 ]; then port=3D$i + # The maximum id number is 255 + elif [ $i -lt 255 ]; then + id=3D$i fi fi done - if [ $port -ne 0 ]; then _port=3D"port $port"; fi - ip netns exec $netns ./pm_nl_ctl set $addr flags $sflags $_port + pm_nl_change_endpoint $netns $sflags $id $addr $port done done fi --=20 2.35.1