From patchwork Thu Jun 27 14:48:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13714514 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2082.outbound.protection.outlook.com [40.107.94.82]) (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 C47C5819; Thu, 27 Jun 2024 14:49:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499793; cv=fail; b=p+hHHUUc5CJMEh+8MA+SPYsEadX3O4dOSKRjfL28O3MbfRJmXqpKWFI+fQ1OtSEHz8gv+x1gunBb3KTltCDBQp5KIUoJdGBPicWTDW7eDW1Cwox8JREIvXP2t6WfznuQetyS3+hB+Q3dXUCM8QtTixP22zxpeo+y6a8NL51GAug= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499793; c=relaxed/simple; bh=HttYceEmGB0RHPsT/MOScZEBJs8TMMmL19YUUXGXqYw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OHq3Sjzo/VtgJzVBgMUWeoSiquKmwICVk1pF9SHrSsgYtqcCoWjZrL/EsnHByEEN5rBq2mBNDLovJbHDtYqfDC7+SiKbsRpRhgN8KFfSsro9DNxxlDvIrNbSWqo4rUQsIQ0zkoNHCFVLjFmkv4AWgM4ql+ku82z0hmRbK23lWxE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=mM+V40o6; arc=fail smtp.client-ip=40.107.94.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="mM+V40o6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jzGlehJV7ezBwJDnfsQt46o+mt4E5L1OdSbkHF4NZGIJfIjLRxtboLXDEV9Y4MdASr1/HBe3FYqPG2LifWckTJp2iJfNNcC1rAjlQ79oZzeUnw3eWO+IDJGh4M05sMvtAOqF8FyWI1ocjoNE8Oh8mVcsqkhik5tEq0YGTMHoNnMWKxsbHvnFycCm9AiJ0tzak+B1vC4AtnAXyq2Ag02c3h3hNxsIB3eKON0gA8sOcyUCy/k8K3q3bVNohJNnql9QUTjb+GGoefeHd9g57VL6fZeKs2MBKPz8a514w3C6Pu7EMGQwt3gMix4zPOYcVdojoQdrY0XXptvlIIeVFAV2bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=p1sliNlEGVsslmGaGwS9pzD6PsTx9kUstHmpLC41xRk=; b=ivrdzsrBTlcUgrBFKyY31h8whqhlJmFEP2ceX83PKXf9HBfuiijwh5zvLbHcEesWwRIFHOwNlPp6oabca+zvLim04yP48JQKMp380wGa0BIpdlyq32vsdP2e/lLNStV1HDE1fhP6vIMV5HvvckSCNwsIkjEa1wD+qreXu2PFGJt2zUk8IHrFRUAWOh6DKk7RLfllv3LoByuTjvDyrivz5SXVYhNwFfxMvgUWgkIdVA2nVtOXJ8289X73wHMcZKoO9xqDgURyouXXXTr52ebukM3df+Ktac7pYRlgg/AOeJsGDWs/cDEp4B+971UBd5I1NCrXcvbijslNtbuhD0fP3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p1sliNlEGVsslmGaGwS9pzD6PsTx9kUstHmpLC41xRk=; b=mM+V40o6Wfv4drAkJLZNY4HSPKmCp35R9yG1db+RiAVogO1N+pS9gANqEKKfbAUwvTdOSnak+4NvARgFyIzmi+GBZNJ8g0CW0PiuBxfJVLvXT65oBSfTnMUjH/30A/+jVf+Z38HzrG3f+uij/fBWua4pIPbecvZzcPQfIZZwwF9d+ZiQiaKffkxyYOy1HiZTWSuIWxEWgFK1HGikJ1NUydNFKCTtYOHeLiSqeAihKYOxrZlPlP5iTmGDx1IGoOKMnKPKBEFMGtVZ3WwMy42kq53nTiHQMC7E+hL1j/S4qlda+FRzwcFMCdgAGO8wWZ9hmO3S/8mnLYydOoueCvDW0Q== Received: from CH0PR04CA0057.namprd04.prod.outlook.com (2603:10b6:610:77::32) by SA1PR12MB6917.namprd12.prod.outlook.com (2603:10b6:806:24c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Thu, 27 Jun 2024 14:49:48 +0000 Received: from DS3PEPF000099DC.namprd04.prod.outlook.com (2603:10b6:610:77:cafe::b1) by CH0PR04CA0057.outlook.office365.com (2603:10b6:610:77::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.26 via Frontend Transport; Thu, 27 Jun 2024 14:49:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS3PEPF000099DC.mail.protection.outlook.com (10.167.17.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 14:49:47 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:49:30 -0700 Received: from yaviefel.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:49:24 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Danielle Ratson , Petr Machata , Ido Schimmel , Hangbin Liu , Benjamin Poirier , Shuah Khan , , Simon Horman , Subject: [PATCH net-next 01/12] selftests: libs: Expand "$@" where possible Date: Thu, 27 Jun 2024 16:48:38 +0200 Message-ID: <0072d6f7b0c128f9f12b3770a0a5ed3c20b0f17f.1719497773.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099DC:EE_|SA1PR12MB6917:EE_ X-MS-Office365-Filtering-Correlation-Id: bea1ebc6-13af-4014-8bfd-08dc96b863c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: Ir3mHGsF7khEZNxG9dt+6oBvRZW132txjx0q8Aypbwaz+0hzB8+ZH3lHt3ZmryimaitSpG/qSaKoNBIj0mx4srTF7waP19JDmWabHE9/akfUoVlzK2WDnh6pIlTSr8f6IUsfFwqpQoj1PW9Pq/XEOes9+065a+AqwpDFFDRoWVNiJjEx/5QBQnI6YqqNFVzFR8ot5qMC2pH3Xb4UD6VLeBqBeCPxfBWVw3WesSO+a7xgok1fH68MO8xFu8naqsRAYqHlTdEO9lEbjarA0v3wnDa/932VWdsooX0Tc+DI4VB/WCAB76XOQLLJDx2BCvibQNDGI5suUgfGrN2r1Vh1r5E5JUnY3ychnqgIOGsR83VqFi+ajbq5MLEX0XzplnOf7xZHNikiWLLemwUq5wVNBN67w3UrOqGig0lTlMyrU77YlfA477ixPs6MX/b4g3V67LZLZI4TP0HbqaCzQxt7Gxjhw6OKANFSpzl2dHnWcX0bgAnod7+SfAwW8lcEaA4tfj2Kpuq9NnqtVvKdrM1oIz37prcS2pRuu2KNT9A0+C1E8280PC2bK+mtmv/JrxC+58EeuARF5XPtS33+LRJbyGs7Sms7SNM7jyj3pLAX0xNgf25TMAg76d3rVrVQH3weuiaMrqT+6bLOMqTyZnWObUaaqHDcgWY7ZlV3IIyVnoKh2ibv5/imSUL0MMYgwTfyJ2MBjTuLsg9GA7/qKalHeJyGCJ2GFSePoAE+IbauxgyLbgxe7LVo/DoawwaH1xl29aaCIqbfncno4rEYvpv5ckMHunOqX5Nal3tK4NxcgXjmYXjinWwlqqtP40w90uxBLazEdWx4N1counVYN4wKMLbteXwlyhu/5TipAlhxF+aLu3UK9an0dO2MhOTSU0QjRsMq+MxUivvAPxaIboZWiteQMQwNZDelsQsrWejOXH93DFeb2fpBp51jQZ9At+ulAFJ+6elA4Vx4aSkt/e42mI0xYN97mDTHAsp2wJgilHnjR0A7c1GilBWunxoglk0ZMmvg4clbBh28hX4eIfL1rLYHi2DvbVfujQV6ZQzBLU5QgWPagNmXsuhfNwF8FYTUVU9FHStndPtwXi6m2Zzwgo4nLueo7/jD+tXS6fUCUNaG5ueaxyjaxvUOg0EEDNfNlzx2wnH4UzwpKh/piG8XhdORx2uOxBkWTh3qmk8aMUf9iADf30iIsiOTeRIxtAjXh2Lgnn078fqv4T7s25mQ/EzZuOIiJAKZWDa3czV7iKdtZjp34zNhB8PlEmdFj3B75evHkOwE9X8p2sayH/vYYT1C97BFKp1OAaervCJnmXDB8ALjlKg4tqEUSG4pOYdP8A5HTGCRvJFSzVLpRT/a4fmtyQZoWe9Zo8KHUCePLb1YfCtU4lcz7hLxFqMUyEkPKIdJ1xZCbOBr9SBabbXDb6lyY1Z0RSWK8tHhnv8Nh+m4Svl5K7flgkl0F5HZuNjU X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 14:49:47.0295 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bea1ebc6-13af-4014-8bfd-08dc96b863c1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099DC.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6917 In some functions, argument-forwarding through "$@" without listing the individual arguments explicitly is fundamental to the operation of a function. E.g. xfail_on_veth() should be able to run various tests in the fail-to-xfail regime, and usage of "$@" is appropriate as an abstraction mechanism. For functions such as simple_if_init(), $@ is a handy way to pass an array. In other functions, it's merely a mechanism to save some typing, which however ends up obscuring the real arguments and makes life hard for those that end up reading the code. This patch adds some of the implicit function arguments and correspondingly expands $@'s. In several cases this will come in handy as following patches adjust the parameter lists. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- tools/testing/selftests/net/forwarding/lib.sh | 67 ++++++++++++++++--- .../net/forwarding/mirror_gre_flower.sh | 13 +++- .../net/forwarding/mirror_gre_lib.sh | 63 ++++++++++++++--- .../selftests/net/forwarding/mirror_lib.sh | 63 ++++++++++++++--- 4 files changed, 176 insertions(+), 30 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 9086d2015296..df7cacb29160 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -1257,22 +1257,34 @@ __icmp_capture_add_del() icmp_capture_install() { - __icmp_capture_add_del add 100 "" "$@" + local tundev=$1; shift + local filter=$1; shift + + __icmp_capture_add_del add 100 "" "$tundev" "$filter" } icmp_capture_uninstall() { - __icmp_capture_add_del del 100 "" "$@" + local tundev=$1; shift + local filter=$1; shift + + __icmp_capture_add_del del 100 "" "$tundev" "$filter" } icmp6_capture_install() { - __icmp_capture_add_del add 100 v6 "$@" + local tundev=$1; shift + local filter=$1; shift + + __icmp_capture_add_del add 100 v6 "$tundev" "$filter" } icmp6_capture_uninstall() { - __icmp_capture_add_del del 100 v6 "$@" + local tundev=$1; shift + local filter=$1; shift + + __icmp_capture_add_del del 100 v6 "$tundev" "$filter" } __vlan_capture_add_del() @@ -1290,12 +1302,18 @@ __vlan_capture_add_del() vlan_capture_install() { - __vlan_capture_add_del add 100 "$@" + local dev=$1; shift + local filter=$1; shift + + __vlan_capture_add_del add 100 "$dev" "$filter" } vlan_capture_uninstall() { - __vlan_capture_add_del del 100 "$@" + local dev=$1; shift + local filter=$1; shift + + __vlan_capture_add_del del 100 "$dev" "$filter" } __dscp_capture_add_del() @@ -1655,34 +1673,61 @@ __start_traffic() local sip=$1; shift local dip=$1; shift local dmac=$1; shift + local -a mz_args=("$@") $MZ $h_in -p $pktsize -A $sip -B $dip -c 0 \ - -a own -b $dmac -t "$proto" -q "$@" & + -a own -b $dmac -t "$proto" -q "${mz_args[@]}" & sleep 1 } start_traffic_pktsize() { local pktsize=$1; shift + local h_in=$1; shift + local sip=$1; shift + local dip=$1; shift + local dmac=$1; shift + local -a mz_args=("$@") - __start_traffic $pktsize udp "$@" + __start_traffic $pktsize udp "$h_in" "$sip" "$dip" "$dmac" \ + "${mz_args[@]}" } start_tcp_traffic_pktsize() { local pktsize=$1; shift + local h_in=$1; shift + local sip=$1; shift + local dip=$1; shift + local dmac=$1; shift + local -a mz_args=("$@") - __start_traffic $pktsize tcp "$@" + __start_traffic $pktsize tcp "$h_in" "$sip" "$dip" "$dmac" \ + "${mz_args[@]}" } start_traffic() { - start_traffic_pktsize 8000 "$@" + local h_in=$1; shift + local sip=$1; shift + local dip=$1; shift + local dmac=$1; shift + local -a mz_args=("$@") + + start_traffic_pktsize 8000 "$h_in" "$sip" "$dip" "$dmac" \ + "${mz_args[@]}" } start_tcp_traffic() { - start_tcp_traffic_pktsize 8000 "$@" + local h_in=$1; shift + local sip=$1; shift + local dip=$1; shift + local dmac=$1; shift + local -a mz_args=("$@") + + start_tcp_traffic_pktsize 8000 "$h_in" "$sip" "$dip" "$dmac" \ + "${mz_args[@]}" } stop_traffic() diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh b/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh index 09389f3b9369..6efdd944f59f 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh @@ -64,12 +64,21 @@ cleanup() test_span_gre_dir_acl() { - test_span_gre_dir_ips "$@" 192.0.2.3 192.0.2.4 + local tundev=$1; shift + local direction=$1; shift + local forward_type=$1; shift + local backward_type=$1; shift + + test_span_gre_dir_ips "$tundev" "$direction" "$forward_type" \ + "$backward_type" 192.0.2.3 192.0.2.4 } fail_test_span_gre_dir_acl() { - fail_test_span_gre_dir_ips "$@" 192.0.2.3 192.0.2.4 + local tundev=$1; shift + local direction=$1; shift + + fail_test_span_gre_dir_ips "$tundev" "$direction" 192.0.2.3 192.0.2.4 } full_test_span_gre_dir_acl() diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh index 0c36546e131e..da2fd028e2e3 100644 --- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh @@ -5,22 +5,34 @@ source "$net_forwarding_dir/mirror_lib.sh" quick_test_span_gre_dir_ips() { local tundev=$1; shift + local direction=$1; shift + local ip1=$1; shift + local ip2=$1; shift - do_test_span_dir_ips 10 h3-$tundev "$@" + do_test_span_dir_ips 10 h3-$tundev "$direction" "$ip1" "$ip2" } fail_test_span_gre_dir_ips() { local tundev=$1; shift + local direction=$1; shift + local ip1=$1; shift + local ip2=$1; shift - do_test_span_dir_ips 0 h3-$tundev "$@" + do_test_span_dir_ips 0 h3-$tundev "$direction" "$ip1" "$ip2" } test_span_gre_dir_ips() { local tundev=$1; shift + local direction=$1; shift + local forward_type=$1; shift + local backward_type=$1; shift + local ip1=$1; shift + local ip2=$1; shift - test_span_dir_ips h3-$tundev "$@" + test_span_dir_ips h3-$tundev "$direction" "$forward_type" \ + "$backward_type" "$ip1" "$ip2" } full_test_span_gre_dir_ips() @@ -74,27 +86,55 @@ full_test_span_gre_dir_vlan_ips() quick_test_span_gre_dir() { - quick_test_span_gre_dir_ips "$@" 192.0.2.1 192.0.2.2 + local tundev=$1; shift + local direction=$1; shift + + quick_test_span_gre_dir_ips "$tundev" "$direction" 192.0.2.1 192.0.2.2 } fail_test_span_gre_dir() { - fail_test_span_gre_dir_ips "$@" 192.0.2.1 192.0.2.2 + local tundev=$1; shift + local direction=$1; shift + + fail_test_span_gre_dir_ips "$tundev" "$direction" 192.0.2.1 192.0.2.2 } test_span_gre_dir() { - test_span_gre_dir_ips "$@" 192.0.2.1 192.0.2.2 + local tundev=$1; shift + local direction=$1; shift + local forward_type=$1; shift + local backward_type=$1; shift + + test_span_gre_dir_ips "$tundev" "$direction" "$forward_type" \ + "$backward_type" 192.0.2.1 192.0.2.2 } full_test_span_gre_dir() { - full_test_span_gre_dir_ips "$@" 192.0.2.1 192.0.2.2 + local tundev=$1; shift + local direction=$1; shift + local forward_type=$1; shift + local backward_type=$1; shift + local what=$1; shift + + full_test_span_gre_dir_ips "$tundev" "$direction" "$forward_type" \ + "$backward_type" "$what" 192.0.2.1 192.0.2.2 } full_test_span_gre_dir_vlan() { - full_test_span_gre_dir_vlan_ips "$@" 192.0.2.1 192.0.2.2 + local tundev=$1; shift + local direction=$1; shift + local vlan_match=$1; shift + local forward_type=$1; shift + local backward_type=$1; shift + local what=$1; shift + + full_test_span_gre_dir_vlan_ips "$tundev" "$direction" "$vlan_match" \ + "$forward_type" "$backward_type" \ + "$what" 192.0.2.1 192.0.2.2 } full_test_span_gre_stp_ips() @@ -126,5 +166,10 @@ full_test_span_gre_stp_ips() full_test_span_gre_stp() { - full_test_span_gre_stp_ips "$@" 192.0.2.1 192.0.2.2 + local tundev=$1; shift + local nbpdev=$1; shift + local what=$1; shift + + full_test_span_gre_stp_ips "$tundev" "$nbpdev" "$what" \ + 192.0.2.1 192.0.2.2 } diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh index 3e8ebeff3019..b5b0a6545d75 100644 --- a/tools/testing/selftests/net/forwarding/mirror_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh @@ -71,12 +71,22 @@ do_test_span_dir_ips() quick_test_span_dir_ips() { - do_test_span_dir_ips 10 "$@" + local dev=$1; shift + local direction=$1; shift + local ip1=$1; shift + local ip2=$1; shift + + do_test_span_dir_ips 10 "$dev" "$direction" "$ip1" "$ip2" } fail_test_span_dir_ips() { - do_test_span_dir_ips 0 "$@" + local dev=$1; shift + local direction=$1; shift + local ip1=$1; shift + local ip2=$1; shift + + do_test_span_dir_ips 0 "$dev" "$direction" "$ip1" "$ip2" } test_span_dir_ips() @@ -101,12 +111,21 @@ test_span_dir_ips() fail_test_span_dir() { - fail_test_span_dir_ips "$@" 192.0.2.1 192.0.2.2 + local dev=$1; shift + local direction=$1; shift + + fail_test_span_dir_ips "$dev" "$direction" 192.0.2.1 192.0.2.2 } test_span_dir() { - test_span_dir_ips "$@" 192.0.2.1 192.0.2.2 + local dev=$1; shift + local direction=$1; shift + local forward_type=$1; shift + local backward_type=$1; shift + + test_span_dir_ips "$dev" "$direction" "$forward_type" "$backward_type" \ + 192.0.2.1 192.0.2.2 } do_test_span_vlan_dir_ips() @@ -130,20 +149,48 @@ do_test_span_vlan_dir_ips() quick_test_span_vlan_dir_ips() { - do_test_span_vlan_dir_ips 10 "$@" + local dev=$1; shift + local vid=$1; shift + local direction=$1; shift + local ul_proto=$1; shift + local ip1=$1; shift + local ip2=$1; shift + + do_test_span_vlan_dir_ips 10 "$dev" "$vid" "$direction" "$ul_proto" \ + "$ip1" "$ip2" } fail_test_span_vlan_dir_ips() { - do_test_span_vlan_dir_ips 0 "$@" + local dev=$1; shift + local vid=$1; shift + local direction=$1; shift + local ul_proto=$1; shift + local ip1=$1; shift + local ip2=$1; shift + + do_test_span_vlan_dir_ips 0 "$dev" "$vid" "$direction" "$ul_proto" \ + "$ip1" "$ip2" } quick_test_span_vlan_dir() { - quick_test_span_vlan_dir_ips "$@" 192.0.2.1 192.0.2.2 + local dev=$1; shift + local vid=$1; shift + local direction=$1; shift + local ul_proto=$1; shift + + quick_test_span_vlan_dir_ips "$dev" "$vid" "$direction" "$ul_proto" \ + 192.0.2.1 192.0.2.2 } fail_test_span_vlan_dir() { - fail_test_span_vlan_dir_ips "$@" 192.0.2.1 192.0.2.2 + local dev=$1; shift + local vid=$1; shift + local direction=$1; shift + local ul_proto=$1; shift + + fail_test_span_vlan_dir_ips "$dev" "$vid" "$direction" "$ul_proto" \ + 192.0.2.1 192.0.2.2 } From patchwork Thu Jun 27 14:48:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13714515 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2043.outbound.protection.outlook.com [40.107.243.43]) (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 49AD9819; Thu, 27 Jun 2024 14:49:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499797; cv=fail; b=D5uIEwuTbYdIlL5lV2uOKgXdd19KA5STGTUIvH21lGnfGL2TDpv1b9ar47IvPsvgf0UtZVZRw56VgPSF6kTpPxxFbmHkgVxgfxlYWZK7pkiIz/BnGQjSx5hcqJZ8Xf+M7AhazLAnwrRWEmbgAO5NdyzO8WEw6Byb4pQ+PNhPMPE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499797; c=relaxed/simple; bh=Ib1PbLewjHiscj6qGvgIKQYrFvuTweaS3v6zdvtnpZg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sc4NDfv71+bjJGtRNZ4FQogea7Ru9yUZGeTMJ2aesbFMht141zJZToEGVpGSWfV/RKhSWTC1IEZCEG02tDuCXKP8QWhNfHSaQLO93uYatR81SrxSZ1zVuYUu1Ii4pSwcfpl53K54STMCYFkKsYXv7KtJ7C9v0YIaam+FkfMvkno= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=k+A1E1Ue; arc=fail smtp.client-ip=40.107.243.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="k+A1E1Ue" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=glVQD/PYO2CJ9BWu4FS8jUxE5Q9TSyubTahc4K6CwwFyXD3OS5UXZ3z1HbLDEhoXk/mY68TvLz1IH4Axy07t8ToBXlyXKxQic5Sg4K5dUqLoWBTbqz+KfwHwChPioXvkawekJ8ucXZwQinwFqFcVUw4lyypdGup09fkzW6YaOu2Fuds4R6zkn2X9pQNQCGNe3jH8tareM9OBS+C3UrBnARSQ5ZevgConXLy5MMppnpuP9ubEuD5wEDVXaYGJc8PZM/pAzR4R9atPpjdY+c6you2UG6qzK3CPL2+wTxIA7/EDNg1KvCw9z3VijbfHSx/GcFkRahZNnp0AP/oQlPQKlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+5s+K8ZKA1hedFit9gCB6a4eVcsdM+11Oavr2t73Ifk=; b=diNNK5J2mXJFhZhZzdf7YMxzdN6A/qJPmCT1zJprY24DSEXJZyJLhECHP6P3Stovb2ma//2tq5E+JZ05boAkcaLnIbE/w5OSouXi1UYiqOgi7L5T8xUhjsroE+/sJNUQ5KM3ijHKGKV7KKCZo6E9f+spg2r+7pxHPetdUJ8pdJEgERM1+ZwkwqZJHHO4ZBt2Hko2KR3BX1nlKymZMnMI6UXqRs3OzwZkcB5tH+NnLxV7b9ayx+beFlXVBjZQ+nXXC2rJzIPNHk35NszfBMA0UNRSlpoodz2YOx9KHnbb7uqMUiP0kE1YXR7TzgfqfvP2gYvlqoq15UW/cWYXK91ISA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+5s+K8ZKA1hedFit9gCB6a4eVcsdM+11Oavr2t73Ifk=; b=k+A1E1UepuFxz9yIM+rvwpSKWR/IwwbvohKFg8NCKMtxL/8Cd7S+3M4cUF/rG/egTEYO56fqd3M8Y0ccqbi+1dtfJCYs1kT7qbLgmUj/yYKuOfO55BFFhRyjnJAV9vo4IstaM7T3cRObJdeztRxbWTkmhavaWu4UX6BuywEnw/BZkjJG3fv7tbo2ocDVNXe6q0wrfofkjTpZWWfyVgSljUagqMeyYuRCLqoJPxBpcorB6shkIopTqvq22TvFX9dBMJyy2AVJN7hdtTWsOjqpQjhUA7CQRNEgOMwcimCTv3DujrQon+AE+ZURk9kXXHHnVM1qyEZ3Oe3MY2bA31U00A== Received: from SJ0PR03CA0157.namprd03.prod.outlook.com (2603:10b6:a03:338::12) by MW3PR12MB4380.namprd12.prod.outlook.com (2603:10b6:303:5a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.34; Thu, 27 Jun 2024 14:49:51 +0000 Received: from SJ1PEPF00002316.namprd03.prod.outlook.com (2603:10b6:a03:338:cafe::a1) by SJ0PR03CA0157.outlook.office365.com (2603:10b6:a03:338::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.38 via Frontend Transport; Thu, 27 Jun 2024 14:49:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002316.mail.protection.outlook.com (10.167.242.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 14:49:49 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:49:36 -0700 Received: from yaviefel.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:49:31 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Danielle Ratson , Petr Machata , Ido Schimmel , Hangbin Liu , Benjamin Poirier , Shuah Khan , , Simon Horman , Subject: [PATCH net-next 02/12] selftests: mirror: Drop direction argument from several functions Date: Thu, 27 Jun 2024 16:48:39 +0200 Message-ID: <7f68e3b2af05768722b15dd97ea9f01430ab9f81.1719497773.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002316:EE_|MW3PR12MB4380:EE_ X-MS-Office365-Filtering-Correlation-Id: a7dd343f-34f7-4f65-7acf-08dc96b8651e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: gVC8l69GnB0hogJJSoUHroJ1vgicGL8rYVpYV12esJBa5Wbi9xICQWkBfBVkH2fh4vkpzIluSlmFgVowdVJXGxT2lZYuU5/XS+akfP+shMuIKPHy+tMBueVhxtROLlaEYqFAwwAQrvF3LTC+uiDqFzF8mNqRzGfiiyqrcbbHW0oGckb2tBwIOzZdPDGgZm2Fn6noCeifhFynkb13dYpLFCywRZM/yelentvtzDNpaY5V1fB1NNiqCDc/zyFgerLKnD9172JF8Vb1JQPqdgAgwEXzPz6aI7YKSqhVKTx6Gnicb2NKPPwGojobK404MkXcn/mM0jR3tNsMVypjBiz0n4xqFCwNmLgFsizI27pqK88aWXg/tzyvOnw9qw82hskvsvO4wy1wS6Wiyz8iX7rubPu9TB3N7b3FQVQ3juUJ387LaFEzC/Fs0flw2rs2BnBu8VMJmcYZsibvNxzYnDprwubV2npiAijPsKalJeqbElqV32y+N0qeJ8oMvaAigKwz0dwfogS2Q3n3NKtJvdnudyhVUPEFDKbFW68/v3G9gVWcBRlvMK5h58H4Ot/gDcnnQDr7AAoCRDocSloC+++WNlx6mHrBCJb+mqoaVrD5NMfwM3I0QUmPbAze2ANheomz0ahAnnSIduLeuwBhCv1+MyietaAgsRNAYPR63xu0yoK1K+asc3PYqBbghXslXyd+pEYx3mYLxycH2ld7VOvRpzKN4uMG/pBhWgnVuMFBZVEUolyDX1TX11KFaQjgw56tkvDUNj0fTWrACpbEhK3I8+ykzj+WXrvgvLfLGdM+jdPje/qLv7XHsm3qXk6+8Q+Xxb3LnwY6VNzWppIZIL89VdjhAtc4pdYaTUJiz1THqa/aDFESP1TLBZRn6hw3ZZroK56chdhKXKh5FOv88MIixryUq4ZGXDOB3BGVDD4TdcPBti9hWyShKU2w1oVuhtKy5B1ZDp8UCreUU03ftmvqtkH0bJqq2Or2kKKhqUDUrl9NeZoO9MpsetLqQDVeO1VhABPhHBlKcRzDsducVH/ozlCQrH/5R9+L+0MSGT3wt3MvzFmA8LcxxUtm77nCMt8elpNDKFBxMWVwokR6tKTzfBLm2NXfIEx99j8c+ftyaRHblihiXgbFbv2egV8UVlg12O/8s9vqBGlgNZ01fL2StWD3SJAIUUbBRQEosy/MNp3gGdcGgj/beLKNguz5c703da2O1t0UgDNMSdeqxszfxw9jlw4c+DqfqDKjhzgYQej5XeXUtKCMYR9q5iN/aKLhz48OZzUpCIlIaTw445wdTtveZv3lKd8TyHABz/sP6h6rA6aQlfnP8oLYZBfuhu/SZ2M8xdw8kWGIoZvAeywNl6+EtykSdajCiBT0uK5+C548k50wfmXH8VysaCVxhdeWl6YdYGKgMlQKx8GmB1OjZKObnN2IMTV5/nmtxZjBfYYovRXAaxvXgPcBrREzzgvI X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 14:49:49.4256 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7dd343f-34f7-4f65-7acf-08dc96b8651e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002316.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4380 The argument is not used by these functions except to propagate it for ultimately no purpose. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- .../selftests/drivers/net/mlxsw/mirror_gre.sh | 12 ++++---- .../selftests/net/forwarding/mirror_gre.sh | 12 ++++---- .../net/forwarding/mirror_gre_changes.sh | 24 +++++++-------- .../net/forwarding/mirror_gre_flower.sh | 13 ++++---- .../net/forwarding/mirror_gre_lib.sh | 25 +++++++--------- .../net/forwarding/mirror_gre_neigh.sh | 4 +-- .../selftests/net/forwarding/mirror_gre_nh.sh | 6 ++-- .../forwarding/mirror_gre_vlan_bridge_1q.sh | 30 +++++++++---------- .../selftests/net/forwarding/mirror_lib.sh | 25 +++++----------- .../selftests/net/forwarding/mirror_vlan.sh | 8 ++--- 10 files changed, 69 insertions(+), 90 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh b/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh index 76f1ab4898d9..47be3b269088 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh @@ -119,11 +119,11 @@ test_span_gre_ttl_inherit() ip link set dev $tundev type $type ttl inherit mirror_install $swp1 ingress $tundev "matchall $tcflags" - fail_test_span_gre_dir $tundev ingress + fail_test_span_gre_dir $tundev ip link set dev $tundev type $type ttl 100 - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress log_test "$what: no offload on TTL of inherit ($tcflags)" @@ -139,10 +139,10 @@ test_span_gre_tos_fixed() ip link set dev $tundev type $type tos 0x10 mirror_install $swp1 ingress $tundev "matchall $tcflags" - fail_test_span_gre_dir $tundev ingress + fail_test_span_gre_dir $tundev ip link set dev $tundev type $type tos inherit - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress log_test "$what: no offload on a fixed TOS ($tcflags)" @@ -158,9 +158,9 @@ test_span_failable() mirror_install $swp1 ingress $tundev "matchall $tcflags" if ((should_fail)); then - fail_test_span_gre_dir $tundev ingress + fail_test_span_gre_dir $tundev else - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev fi mirror_uninstall $swp1 ingress diff --git a/tools/testing/selftests/net/forwarding/mirror_gre.sh b/tools/testing/selftests/net/forwarding/mirror_gre.sh index 0266443601bc..00def4b04145 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre.sh @@ -91,17 +91,17 @@ test_two_spans() mirror_install $swp1 ingress gt4 "matchall $tcflags" mirror_install $swp1 egress gt6 "matchall $tcflags" - quick_test_span_gre_dir gt4 ingress - quick_test_span_gre_dir gt6 egress + quick_test_span_gre_dir gt4 + quick_test_span_gre_dir gt6 mirror_uninstall $swp1 ingress - fail_test_span_gre_dir gt4 ingress - quick_test_span_gre_dir gt6 egress + fail_test_span_gre_dir gt4 + quick_test_span_gre_dir gt6 mirror_install $swp1 ingress gt4 "matchall $tcflags" mirror_uninstall $swp1 egress - quick_test_span_gre_dir gt4 ingress - fail_test_span_gre_dir gt6 egress + quick_test_span_gre_dir gt4 + fail_test_span_gre_dir gt6 mirror_uninstall $swp1 ingress log_test "two simultaneously configured mirrors ($tcflags)" diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh b/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh index 5ea9d63915f7..3796f4256c9c 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh @@ -99,11 +99,11 @@ test_span_gre_tun_up() ip link set dev $tundev down mirror_install $swp1 ingress $tundev "matchall $tcflags" - fail_test_span_gre_dir $tundev ingress + fail_test_span_gre_dir $tundev ip link set dev $tundev up - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress log_test "$what: tunnel down/up ($tcflags)" @@ -119,7 +119,7 @@ test_span_gre_egress_up() ip link set dev $swp3 down mirror_install $swp1 ingress $tundev "matchall $tcflags" - fail_test_span_gre_dir $tundev ingress + fail_test_span_gre_dir $tundev # After setting the device up, wait for neighbor to get resolved so that # we can expect mirroring to work. @@ -127,7 +127,7 @@ test_span_gre_egress_up() setup_wait_dev $swp3 ping -c 1 -I $swp3 $remote_ip &>/dev/null - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress log_test "$what: egress down/up ($tcflags)" @@ -145,10 +145,10 @@ test_span_gre_remote_ip() ip link set dev $tundev type $type remote $wrong_ip mirror_install $swp1 ingress $tundev "matchall $tcflags" - fail_test_span_gre_dir $tundev ingress + fail_test_span_gre_dir $tundev ip link set dev $tundev type $type remote $correct_ip - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress log_test "$what: remote address change ($tcflags)" @@ -166,9 +166,9 @@ test_span_gre_tun_del() RET=0 mirror_install $swp1 ingress $tundev "matchall $tcflags" - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev ip link del dev $tundev - fail_test_span_gre_dir $tundev ingress + fail_test_span_gre_dir $tundev tunnel_create $tundev $type $local_ip $remote_ip \ ttl 100 tos inherit $flags @@ -177,7 +177,7 @@ test_span_gre_tun_del() # and verify it works for the follow-up tests. mirror_uninstall $swp1 ingress mirror_install $swp1 ingress $tundev "matchall $tcflags" - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress log_test "$what: tunnel deleted ($tcflags)" @@ -193,13 +193,13 @@ test_span_gre_route_del() RET=0 mirror_install $swp1 ingress $tundev "matchall $tcflags" - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev ip route del $route dev $edev - fail_test_span_gre_dir $tundev ingress + fail_test_span_gre_dir $tundev ip route add $route dev $edev - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh b/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh index 6efdd944f59f..c7d532e6f31e 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh @@ -65,20 +65,18 @@ cleanup() test_span_gre_dir_acl() { local tundev=$1; shift - local direction=$1; shift local forward_type=$1; shift local backward_type=$1; shift - test_span_gre_dir_ips "$tundev" "$direction" "$forward_type" \ + test_span_gre_dir_ips "$tundev" "$forward_type" \ "$backward_type" 192.0.2.3 192.0.2.4 } fail_test_span_gre_dir_acl() { local tundev=$1; shift - local direction=$1; shift - fail_test_span_gre_dir_ips "$tundev" "$direction" 192.0.2.3 192.0.2.4 + fail_test_span_gre_dir_ips "$tundev" 192.0.2.3 192.0.2.4 } full_test_span_gre_dir_acl() @@ -94,13 +92,12 @@ full_test_span_gre_dir_acl() mirror_install $swp1 $direction $tundev \ "protocol ip flower $tcflags dst_ip $match_dip" - fail_test_span_gre_dir $tundev $direction - test_span_gre_dir_acl "$tundev" "$direction" \ - "$forward_type" "$backward_type" + fail_test_span_gre_dir $tundev + test_span_gre_dir_acl "$tundev" "$forward_type" "$backward_type" mirror_uninstall $swp1 $direction # Test lack of mirroring after ACL mirror is uninstalled. - fail_test_span_gre_dir_acl "$tundev" "$direction" + fail_test_span_gre_dir_acl "$tundev" log_test "$direction $what ($tcflags)" } diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh index da2fd028e2e3..2bed2a4013aa 100644 --- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh @@ -5,33 +5,30 @@ source "$net_forwarding_dir/mirror_lib.sh" quick_test_span_gre_dir_ips() { local tundev=$1; shift - local direction=$1; shift local ip1=$1; shift local ip2=$1; shift - do_test_span_dir_ips 10 h3-$tundev "$direction" "$ip1" "$ip2" + do_test_span_dir_ips 10 h3-$tundev "$ip1" "$ip2" } fail_test_span_gre_dir_ips() { local tundev=$1; shift - local direction=$1; shift local ip1=$1; shift local ip2=$1; shift - do_test_span_dir_ips 0 h3-$tundev "$direction" "$ip1" "$ip2" + do_test_span_dir_ips 0 h3-$tundev "$ip1" "$ip2" } test_span_gre_dir_ips() { local tundev=$1; shift - local direction=$1; shift local forward_type=$1; shift local backward_type=$1; shift local ip1=$1; shift local ip2=$1; shift - test_span_dir_ips h3-$tundev "$direction" "$forward_type" \ + test_span_dir_ips h3-$tundev "$forward_type" \ "$backward_type" "$ip1" "$ip2" } @@ -48,7 +45,7 @@ full_test_span_gre_dir_ips() RET=0 mirror_install $swp1 $direction $tundev "matchall $tcflags" - test_span_dir_ips "h3-$tundev" "$direction" "$forward_type" \ + test_span_dir_ips "h3-$tundev" "$forward_type" \ "$backward_type" "$ip1" "$ip2" mirror_uninstall $swp1 $direction @@ -70,7 +67,7 @@ full_test_span_gre_dir_vlan_ips() mirror_install $swp1 $direction $tundev "matchall $tcflags" - test_span_dir_ips "h3-$tundev" "$direction" "$forward_type" \ + test_span_dir_ips "h3-$tundev" "$forward_type" \ "$backward_type" "$ip1" "$ip2" tc filter add dev $h3 ingress pref 77 prot 802.1q \ @@ -87,17 +84,15 @@ full_test_span_gre_dir_vlan_ips() quick_test_span_gre_dir() { local tundev=$1; shift - local direction=$1; shift - quick_test_span_gre_dir_ips "$tundev" "$direction" 192.0.2.1 192.0.2.2 + quick_test_span_gre_dir_ips "$tundev" 192.0.2.1 192.0.2.2 } fail_test_span_gre_dir() { local tundev=$1; shift - local direction=$1; shift - fail_test_span_gre_dir_ips "$tundev" "$direction" 192.0.2.1 192.0.2.2 + fail_test_span_gre_dir_ips "$tundev" 192.0.2.1 192.0.2.2 } test_span_gre_dir() @@ -149,15 +144,15 @@ full_test_span_gre_stp_ips() RET=0 mirror_install $swp1 ingress $tundev "matchall $tcflags" - quick_test_span_gre_dir_ips $tundev ingress $ip1 $ip2 + quick_test_span_gre_dir_ips $tundev $ip1 $ip2 bridge link set dev $nbpdev state disabled sleep 1 - fail_test_span_gre_dir_ips $tundev ingress $ip1 $ip2 + fail_test_span_gre_dir_ips $tundev $ip1 $ip2 bridge link set dev $nbpdev state forwarding sleep 1 - quick_test_span_gre_dir_ips $tundev ingress $ip1 $ip2 + quick_test_span_gre_dir_ips $tundev $ip1 $ip2 mirror_uninstall $swp1 ingress diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh b/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh index fc0508e40fca..0f2c38eca2a3 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh @@ -66,9 +66,9 @@ test_span_gre_neigh() ip neigh replace dev $swp3 $addr lladdr 00:11:22:33:44:55 mirror_install $swp1 $direction $tundev "matchall $tcflags" - fail_test_span_gre_dir $tundev ingress + fail_test_span_gre_dir $tundev ip neigh del dev $swp3 $addr - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev mirror_uninstall $swp1 $direction log_test "$direction $what: neighbor change ($tcflags)" diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh b/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh index 6f9ef1820e93..2011dad06cf4 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh @@ -81,10 +81,10 @@ test_gretap() # the traffic to tunnel remote address. Then add it and test that # mirroring starts. For IPv6 we can't test this due to the limitation # that routes for locally-specified IPv6 addresses can't be added. - fail_test_span_gre_dir gt4 ingress + fail_test_span_gre_dir gt4 ip route add 192.0.2.130/32 via 192.0.2.162 - quick_test_span_gre_dir gt4 ingress + quick_test_span_gre_dir gt4 ip route del 192.0.2.130/32 via 192.0.2.162 mirror_uninstall $swp1 ingress @@ -96,7 +96,7 @@ test_ip6gretap() RET=0 mirror_install $swp1 ingress gt6 "matchall $tcflags" - quick_test_span_gre_dir gt6 ingress + quick_test_span_gre_dir gt6 mirror_uninstall $swp1 ingress log_test "mirror to ip6gre with next-hop remote ($tcflags)" diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh index c8a9b5bd841f..b49b70416e32 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh @@ -154,16 +154,16 @@ test_span_gre_forbidden_cpu() # Run the pass-test first, to prime neighbor table. mirror_install $swp1 ingress $tundev "matchall $tcflags" - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev # Now forbid the VLAN at the bridge and see it fail. bridge vlan del dev br1 vid 555 self sleep 1 - fail_test_span_gre_dir $tundev ingress + fail_test_span_gre_dir $tundev bridge vlan add dev br1 vid 555 self sleep 1 - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress @@ -188,17 +188,17 @@ test_span_gre_forbidden_egress() RET=0 mirror_install $swp1 ingress $tundev "matchall $tcflags" - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev bridge vlan del dev $swp3 vid 555 sleep 1 - fail_test_span_gre_dir $tundev ingress + fail_test_span_gre_dir $tundev bridge vlan add dev $swp3 vid 555 # Re-prime FDB $ARPING -I br1.555 192.0.2.130 -fqc 1 sleep 1 - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress @@ -225,24 +225,24 @@ test_span_gre_untagged_egress() mirror_install $swp1 ingress $tundev "matchall $tcflags" - quick_test_span_gre_dir $tundev ingress - quick_test_span_vlan_dir $h3 555 ingress "$ul_proto" + quick_test_span_gre_dir $tundev + quick_test_span_vlan_dir $h3 555 "$ul_proto" h3_addr_add_del del $h3.555 bridge vlan add dev $swp3 vid 555 pvid untagged h3_addr_add_del add $h3 sleep 5 - quick_test_span_gre_dir $tundev ingress - fail_test_span_vlan_dir $h3 555 ingress "$ul_proto" + quick_test_span_gre_dir $tundev + fail_test_span_vlan_dir $h3 555 "$ul_proto" h3_addr_add_del del $h3 bridge vlan add dev $swp3 vid 555 h3_addr_add_del add $h3.555 sleep 5 - quick_test_span_gre_dir $tundev ingress - quick_test_span_vlan_dir $h3 555 ingress "$ul_proto" + quick_test_span_gre_dir $tundev + quick_test_span_vlan_dir $h3 555 "$ul_proto" mirror_uninstall $swp1 ingress @@ -268,13 +268,13 @@ test_span_gre_fdb_roaming() RET=0 mirror_install $swp1 ingress $tundev "matchall $tcflags" - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev while ((RET == 0)); do bridge fdb del dev $swp3 $h3mac vlan 555 master 2>/dev/null bridge fdb add dev $swp2 $h3mac vlan 555 master static sleep 1 - fail_test_span_gre_dir $tundev ingress + fail_test_span_gre_dir $tundev if ! bridge fdb sh dev $swp2 vlan 555 master \ | grep -q $h3mac; then @@ -292,7 +292,7 @@ test_span_gre_fdb_roaming() # Re-prime FDB $ARPING -I br1.555 192.0.2.130 -fqc 1 sleep 1 - quick_test_span_gre_dir $tundev ingress + quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh index b5b0a6545d75..ee0fd71ad2fd 100644 --- a/tools/testing/selftests/net/forwarding/mirror_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh @@ -59,7 +59,6 @@ do_test_span_dir_ips() { local expect=$1; shift local dev=$1; shift - local direction=$1; shift local ip1=$1; shift local ip2=$1; shift @@ -72,11 +71,10 @@ do_test_span_dir_ips() quick_test_span_dir_ips() { local dev=$1; shift - local direction=$1; shift local ip1=$1; shift local ip2=$1; shift - do_test_span_dir_ips 10 "$dev" "$direction" "$ip1" "$ip2" + do_test_span_dir_ips 10 "$dev" "$ip1" "$ip2" } fail_test_span_dir_ips() @@ -92,13 +90,12 @@ fail_test_span_dir_ips() test_span_dir_ips() { local dev=$1; shift - local direction=$1; shift local forward_type=$1; shift local backward_type=$1; shift local ip1=$1; shift local ip2=$1; shift - quick_test_span_dir_ips "$dev" "$direction" "$ip1" "$ip2" + quick_test_span_dir_ips "$dev" "$ip1" "$ip2" icmp_capture_install $dev "type $forward_type" mirror_test v$h1 $ip1 $ip2 $dev 100 10 @@ -120,11 +117,10 @@ fail_test_span_dir() test_span_dir() { local dev=$1; shift - local direction=$1; shift local forward_type=$1; shift local backward_type=$1; shift - test_span_dir_ips "$dev" "$direction" "$forward_type" "$backward_type" \ + test_span_dir_ips "$dev" "$forward_type" "$backward_type" \ 192.0.2.1 192.0.2.2 } @@ -133,7 +129,6 @@ do_test_span_vlan_dir_ips() local expect=$1; shift local dev=$1; shift local vid=$1; shift - local direction=$1; shift local ul_proto=$1; shift local ip1=$1; shift local ip2=$1; shift @@ -151,36 +146,31 @@ quick_test_span_vlan_dir_ips() { local dev=$1; shift local vid=$1; shift - local direction=$1; shift local ul_proto=$1; shift local ip1=$1; shift local ip2=$1; shift - do_test_span_vlan_dir_ips 10 "$dev" "$vid" "$direction" "$ul_proto" \ - "$ip1" "$ip2" + do_test_span_vlan_dir_ips 10 "$dev" "$vid" "$ul_proto" "$ip1" "$ip2" } fail_test_span_vlan_dir_ips() { local dev=$1; shift local vid=$1; shift - local direction=$1; shift local ul_proto=$1; shift local ip1=$1; shift local ip2=$1; shift - do_test_span_vlan_dir_ips 0 "$dev" "$vid" "$direction" "$ul_proto" \ - "$ip1" "$ip2" + do_test_span_vlan_dir_ips 0 "$dev" "$vid" "$ul_proto" "$ip1" "$ip2" } quick_test_span_vlan_dir() { local dev=$1; shift local vid=$1; shift - local direction=$1; shift local ul_proto=$1; shift - quick_test_span_vlan_dir_ips "$dev" "$vid" "$direction" "$ul_proto" \ + quick_test_span_vlan_dir_ips "$dev" "$vid" "$ul_proto" \ 192.0.2.1 192.0.2.2 } @@ -188,9 +178,8 @@ fail_test_span_vlan_dir() { local dev=$1; shift local vid=$1; shift - local direction=$1; shift local ul_proto=$1; shift - fail_test_span_vlan_dir_ips "$dev" "$vid" "$direction" "$ul_proto" \ + fail_test_span_vlan_dir_ips "$dev" "$vid" "$ul_proto" \ 192.0.2.1 192.0.2.2 } diff --git a/tools/testing/selftests/net/forwarding/mirror_vlan.sh b/tools/testing/selftests/net/forwarding/mirror_vlan.sh index 0b44e148235e..074165f46a9d 100755 --- a/tools/testing/selftests/net/forwarding/mirror_vlan.sh +++ b/tools/testing/selftests/net/forwarding/mirror_vlan.sh @@ -64,7 +64,7 @@ test_vlan_dir() RET=0 mirror_install $swp1 $direction $swp3.555 "matchall $tcflags" - test_span_dir "$h3.555" "$direction" "$forward_type" "$backward_type" + test_span_dir "$h3.555" "$forward_type" "$backward_type" mirror_uninstall $swp1 $direction log_test "$direction mirror to vlan ($tcflags)" @@ -85,10 +85,8 @@ test_tagged_vlan_dir() RET=0 mirror_install $swp1 $direction $swp3.555 "matchall $tcflags" - do_test_span_vlan_dir_ips 10 "$h3.555" 111 "$direction" ip \ - 192.0.2.17 192.0.2.18 - do_test_span_vlan_dir_ips 0 "$h3.555" 555 "$direction" ip \ - 192.0.2.17 192.0.2.18 + do_test_span_vlan_dir_ips 10 "$h3.555" 111 ip 192.0.2.17 192.0.2.18 + do_test_span_vlan_dir_ips 0 "$h3.555" 555 ip 192.0.2.17 192.0.2.18 mirror_uninstall $swp1 $direction log_test "$direction mirror tagged to vlan ($tcflags)" From patchwork Thu Jun 27 14:48:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13714517 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2072.outbound.protection.outlook.com [40.107.92.72]) (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 BC273197A76; Thu, 27 Jun 2024 14:50:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499808; cv=fail; b=KyzMyjZGGbbhP7ugrGSh1iflSaSr2JAlhWrIfn5Z1pbhVRb1UB55hqYDoLBKdoj8czjboMAD1wh/8xN+Pxx4Ho1UlxdMUh1ms4V5fiP3z6jCWItcYfOktZEk9QyyvZXEetklRcxkrjqyVZKxPd+G2NBEGdG7HykDGgyrx4Q1k6s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499808; c=relaxed/simple; bh=IBt53dQFWK0fsTlitBdBN5neeAw9SH3yL0E2ZGMCtjU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Yg5h0zDLKMsajcX009oR+3+S0aSmU5/Uh8G+9tdQcN7bOC2+ZXmVCLMao6SJtnFIp2k+LGDvcQtuaORahdxjyDnD4oCiOtRj9gMU0fH+i4Aux9BQsSisjRGQqeAfiEHh3T56PFTNDHa3ZXr3hB4qQ8P5uW6T4BqZM81EuELgyh0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=jSJMWNQc; arc=fail smtp.client-ip=40.107.92.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="jSJMWNQc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f+JwcJCshiRjVTxouNECLyE+bKLLlYg3/kW+S6MwNHj48ZXbs6PyRyIXXSjxhzWidAueXxAK2+vkdSfuDl4GcupEugp9uoaitD3Ywz5wiCVBX/jGuGa332mmY/N2gbGl1uVA+avQFSAZPAcbGFvZkYYQ95mbfBH74oaJLBx9+zrNX8VVYtXhn1oF1cIpdf9OyKvbobBNICWJGKLi7pEPCXw3ppqQBWuZzqRg9ysxgr4EpOfOjym+EA3NzlfM2/ou0s/e793HfLPCz1auoDv4ZT/0aoqNmnAW+02K8Wj/gN0m1cBIP4jtHll4qPKC3X/oF34qNfXpG4ey8pLMua7nbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AHyemR1XBxjhoD+uljJx6z1V9I0KMA+YMdoU67P2a5M=; b=Y2a7ShWP5MpvMc+yKHPqE+T7qRtlVK3XZbP0G+s/Ms/JIXcJwx1QMQudB+1trcsHQYQJFHZrB24KeZtQeOkVdI9Zxis2mdfckpZWIuwBwOVg91Nk07a5Q2Wrw6XS46Z4c1NpM+PFvx0tcvWnG2XMhDU4KceXs1VZicBvBq2IwZQnaKJ/RoT029IAZgu4aV73p37tpDJ9obfJ418wONw6DmRd5V8NIYHtBIV4M8YgyT7ZcrDlRTWB4MafbRbGHWTkdaaHTv2kgSj/PfljPdG6HLZE3sPdUCW2GGXPbMOsfmQtM7+M35IAjrpNbX9K3BZPrQcI2krDYIWZ8ZPT91uaZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AHyemR1XBxjhoD+uljJx6z1V9I0KMA+YMdoU67P2a5M=; b=jSJMWNQcSYAjkUeirualxQktQnGhLAZtnU6MgcicvY0ChRkdJx2vpilA73gPKW5q/ZPkUtHpn9lkcgNc86TeLOUv3nze5ZHeVUYKmvUPIRo984C992fkGxVPVSv1HDadCI8Ww2LIdPKQh7k3xlgDQGz1HJVZTjydkMuxGZSQ6zy00Nbt7GX5wU+Asnp2+y5X4LmiBklzFxMzkYVYyd4G1DaygV2KujwnDknlpQq6BMMNtbH5/YtEtDbLFuBPPrN0TGiDNxBZJwtHivcAE19xBiPa1QEI2iCaBIJa5b2rEklS3IQuyTdZ6TmDocNdto480uyUgAm0iqPTXCVhXJRlCw== Received: from BY5PR16CA0010.namprd16.prod.outlook.com (2603:10b6:a03:1a0::23) by PH7PR12MB7914.namprd12.prod.outlook.com (2603:10b6:510:27d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Thu, 27 Jun 2024 14:49:57 +0000 Received: from SJ1PEPF00002310.namprd03.prod.outlook.com (2603:10b6:a03:1a0:cafe::7) by BY5PR16CA0010.outlook.office365.com (2603:10b6:a03:1a0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.20 via Frontend Transport; Thu, 27 Jun 2024 14:49:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002310.mail.protection.outlook.com (10.167.242.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 14:49:57 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:49:42 -0700 Received: from yaviefel.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:49:37 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Danielle Ratson , Petr Machata , Ido Schimmel , Hangbin Liu , Benjamin Poirier , Shuah Khan , , Simon Horman , Subject: [PATCH net-next 03/12] selftests: lib: tc_rule_stats_get(): Move default to argument definition Date: Thu, 27 Jun 2024 16:48:40 +0200 Message-ID: <18d1da8cf474d76e7934d06c546a22e6561392b3.1719497773.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002310:EE_|PH7PR12MB7914:EE_ X-MS-Office365-Filtering-Correlation-Id: fba73336-6792-40df-faf2-08dc96b86a16 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: dw2oYCJCus6XPVM0L0el63ltScoQyuBhcMijOgBb99e1iTueoT1JAW56M++MW+fDsZg+teaHpMl8JWlbx6jWLMcaO8380htFRECrTjmMO70xlcofa5c7kXF6zlWcl3bhcDT6MQ2Qh7t8c6SvhUQoh871UF75kShv7uIBCq8yqAyFRJMM8QHYz/S7SnYn2BSvkhMTCa13Jv6on9YX4fyV/xEBXLL4hmCX9P6opwfYuyAqMDbqeUinaaJEPidbXNzkWnFix48FDK3gzgUcBgEr/fO3WIzMHGQdEftiyiS1G9j1tF3GHx9Slqhb+TCyuEmIBL4QNMpHe0oD7K0COzUPP9PlIz/9pBoOnbJh3pdrtbk0uqLAS9sEr9Mo9XPDyx2q3bgzqYqhdSLRRNtDQYUXKcjfb+uAHU2lsG0nRDTneKf7BUTACijENQLIaVLgaoVFDFDoAag71p5LXDScMuOrMbtTnBHyhjCInDoSIdhXX4F9eYomqg06vXai/KoHtQMy0ctvubnI5954JJ1KU7EW5v/Zng5dmHy/eM+FtnGHmSHGpJakNyANW2RU/0T7FS74av8PDGq4vuWUCLNj22Oup7k5dqyZl/4odAUXzNyRx6OBZEUS2KhkSPBjikm6hjXsUNIBASkVU/WcnCaQM8L4xopR638jaZESjSeyxQw01mGz4zVkC7bv1YlQxbOlHR3SZxIZPE4G7xCZa6YZM1tljghC7vwLuZDzI3nPEg5M1hj6j4p45iRu8C/aYdicwSWfnWH5HJPosvXWEmBZP2E81XbIG0eQH4j+Bbx/VnUBo6qssFjdeW/7FzBDm5j/+FCJbFua6Xc61V0qtAQU+8bgMcm7Uj8eO7uPmTwub+hRED6kidb1DRJ5ck89kngJ+RgT1HexQEKFobDW65SjDDiLyeKuSyv3g5sVqdAu19DB3ELMnTMh2WXfo+gY1bHSodqbo92iehcwM+6yU41GTSBqTHlzJOfD+wBCKblnVQqd4xdNl3UA+pQDwOcm+Y45smR4MpOTcla8Ys4wnFOMeHl6ozLBDQsO1vgzxdw7LpBZ7O74D2r3P/cydbJlTqeGbMmQyFq+mRPgnLR3QS1AWGopkEkFk56cNMWryY6WMrSrIfqgvC3t3lDCqk/evij0ORH6nbQdPQ+VYFPX9XiHDOg8EjDO7213YGIe5HOjkuadnoI+nbUJowrolyxXDHglAi80W01g3r8ENCkkSjWL8CZTxbMOGeAYSO9gGh8UVB08RC+JV6ltxewLl3DY04QbgoeZavdv49/BDB9hAEIklY+MsuaNSyB4mmEV/HyRWahulNP+oD7DLQPHPiYtgHHZEIrY1B2T/OJWUP2AJa0eqc/OFXiFJEpVdcqSwzsW0L3tnPmZXD9rWp3M9HRVsOcAvV22+hLvbm3hGNYSHtHOQU8KVvgryZOtVNJZhxGst6i4nIcTlPSlyEODic5Jj4UZ+jn5 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 14:49:57.7651 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fba73336-6792-40df-faf2-08dc96b86a16 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002310.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7914 The argument $dir has a fallback value of "ingress". Move the fallback from the usage site to the argument definition block to make the fact clearer. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- tools/testing/selftests/net/lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/lib.sh b/tools/testing/selftests/net/lib.sh index 915f319bcc8b..d0219032f773 100644 --- a/tools/testing/selftests/net/lib.sh +++ b/tools/testing/selftests/net/lib.sh @@ -199,10 +199,10 @@ tc_rule_stats_get() { local dev=$1; shift local pref=$1; shift - local dir=$1; shift + local dir=${1:-ingress}; shift local selector=${1:-.packets}; shift - tc -j -s filter show dev $dev ${dir:-ingress} pref $pref \ + tc -j -s filter show dev $dev $dir pref $pref \ | jq ".[1].options.actions[].stats$selector" } From patchwork Thu Jun 27 14:48:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13714516 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2045.outbound.protection.outlook.com [40.107.94.45]) (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 C9A8D198828; Thu, 27 Jun 2024 14:50:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499807; cv=fail; b=r5D87bA7FafxI8lUMfc2I/xbXj7VIfzdjp6zRfDlQakhxuIYuBjgoXneOzAfEXgWD/E8+m4rSWp8P2GcPTRKLOQcT8SsrfMJlf2lFjfWWtJKpXjipW22SMlIOBwhHvUc9aMtvKXaNO3h8rqfX2Y4gJQjvRUqLxZkaFLec25/OVo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499807; c=relaxed/simple; bh=1BjHwPmL8fvoM1tpzSt8+Bto1/LmiGAQK3d8DndtU48=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DV+eF2VotIK9NC62STFIlhtyDziqJU/R30B9KQU/17OjDD/QUpfdPPrhOkub5435ClBHytUuTxA8m3V22TznLTbOBGgdq0HAWt5EEIauRL8KDrcg9f9BlfVUeK4SdpQlbw0RcVYkRrcWZqVvh9qU2Q64fQ9inx9OuAJ7fqInV64= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=AwEpss1a; arc=fail smtp.client-ip=40.107.94.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="AwEpss1a" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sv5WlgiJoMoO5DWrum/FgbL2/awOWZCtkbgYcN8Rm3un1HnfmKumz6WkyWbNs0xKRloc0/uVfW2CGlAaz/xhohvQiZPNGex/ZPfLq/CVYlYHKlLU0MhE89L90RuvEEYL+hB0K/HlpN1/+/4dEyhyTw3CvQv46xmvFjNL/QeGVctFLEk5whNQKs1E3EdTTUiIjkp4Iuerg/RcoMho6pUY2MANMtcBgg+GmUNYWrus4Zkcx3fTszfDVgcod43t2KRA3hM0ZR6QHSmFBcTtdgdrx5rhXyOH55LLrOuhuH3eph4i3cSxvfNkcas+d7/qLf76iieNSoaG7+qZHkpHo3FyuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GZsLAkPU+gS/0LN29X3WN+YZg0pJDDg+8IDmqYdaPUk=; b=MTzutjGGceiIFIJNoNptKbudLUmae2E7WKFi+TOy9150BfJwN68vmq6CKqdc55WIaFVbJJkKLGQ4PzmU4t/BNXFj2as97QEQ/PhLAaPM+2+HRzfuHRitYJHaeG2sUJlORDnZ0CCGAuuqCg9i70EC1fIvkPn3skEyWxh7mtoH7+XacW5JevccCJOHCLJ7rilRIlS38+dDqkmyP2VNW18fkEvu4p8ptPzMyv+SUW5/WrVQgHJ8jlRK9GFRJMKiR53zv0BD52CI92CclK3cxFx/FPJKGs80qw+ni6nwobYR9xUUpWwNtp8FPzmwqiIIJLfHbNCwN/CeHrSKicKDxARXBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GZsLAkPU+gS/0LN29X3WN+YZg0pJDDg+8IDmqYdaPUk=; b=AwEpss1aedvq1UzQDZWIGFtfD5dHd1P3eEOC+r6Eaw5VGlXp6j7X0tlenqr66T6WqEkP4U//aGDeI39qJ9tr/84ajXfwCqtqZNgZ7ViVTZmOcF8hCt2iL5o13Xt0aJMhH+Cqbisg0fZDuyai94LBR3WKQBhqfk44G1nL8UpuQxt7lzvoCZ6BRLzaLIvr9bU3/Z6jW3ph7hg44Y9pGaq7zCa/22tSDbU3YvpVxUiICkwYsCdF6iE8sUFA1dQ5QxETXB5+IP+x+wqw7NX8f8jsAhc5BciqJoiD0rXrvhaKjXK5nXwF1ibM6aNuKQmd3Kw7h0RQ7zFVcRilVqxFMaRZTw== Received: from BY5PR16CA0029.namprd16.prod.outlook.com (2603:10b6:a03:1a0::42) by BL1PR12MB5946.namprd12.prod.outlook.com (2603:10b6:208:399::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Thu, 27 Jun 2024 14:50:02 +0000 Received: from SJ1PEPF00002310.namprd03.prod.outlook.com (2603:10b6:a03:1a0:cafe::5b) by BY5PR16CA0029.outlook.office365.com (2603:10b6:a03:1a0::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.26 via Frontend Transport; Thu, 27 Jun 2024 14:50:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002310.mail.protection.outlook.com (10.167.242.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 14:50:01 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:49:48 -0700 Received: from yaviefel.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:49:42 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Danielle Ratson , Petr Machata , Ido Schimmel , Hangbin Liu , Benjamin Poirier , Shuah Khan , , Simon Horman , Subject: [PATCH net-next 04/12] selftests: mirror_gre_lag_lacp: Check counters at tunnel Date: Thu, 27 Jun 2024 16:48:41 +0200 Message-ID: <06fbe94a8526cc770fa19bb30ade85c9534f1e8d.1719497773.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002310:EE_|BL1PR12MB5946:EE_ X-MS-Office365-Filtering-Correlation-Id: c1a84bc5-bdfc-4ff3-ba3b-08dc96b86c7b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: VrEcUz4Nbgcl//fUvnjrWy3hd8ZEAcG2/g+kfmZJ1SL/Ew/b9YPmbyuf2ta6QDPSYB/z6pY2/e5ib0PIBrzlllt+AyBQgFsnDkFmhm46yHpNO+AK+FFq7kieMgW9YVXfKK5EnTOCj9Zf/KBiaT3sZTnMOVrm96rfeeqKi9OaWcEHLCdB+LTmo+k2R7Iu65FrfA4fMTZoIm3YHpjVjcY87Cf87G4/J26HR5beUK1Lz5uMUemJsxuQVAz2PEISLi6yRjSzVUh3P2qeNiukMAjtzbgRN2n5QoS4L4kj+Cm2j7f714VK3dEBPd3CaFgGMvOe4IOD2kuzGHXxrk7nsj5uSfDu9u2Tg/OHmep02zsYgEJyAb05fPZTz0LdCLaa3jnyJ0eUYxASIm9VfWsxE2bpDdN4nHb3ckFzJ5TlzTCUu2cT6m23GqP0Bgn3mEgP+8bjW/B6Ir69IbHD7JGh1QNw440I9ZIBBWqT3EMOMI0ZlcsznO48WDQhsjnbcGWZVnvkqmZGFkJpnX239lFqLqSvqG+vjGgPSEMigXSIb+YNDDvuDWXPV7bMmNJ9ovcn/Ua9/f5yskVyt/yXezcp7v5K+xayMn3sAaSR/117MrFS6aT7nR8HuTbN8tCzIv9mgVh5wUFmBAv945O5sCdDSvcAF/3lpAX5cgrdVRdhrx4s/5Q4Zo7A8VIbWWaQPs8OFSGDn3yXy0dNZ1lCYqm34Dt4slTP3z0BkSIzd5obGPRjsFPUCW1Ucc778BcFifwgMoExqOQwZ1wKFKuI4RyEcFnV4PQOt3gUK8GkaUl4HXLGrLqofIUSF6kF+PAILtedBSEH11C8BO/iJIoszaAQCKF0O7xPkwU7qys78DKxq8WUZ4cEdugwDdSGwbjlbTQR/exOwS+MadVKEuJ9pfj2gsJThDa6DRzynNKG0yB5/uLQAxuJHqTgPzROoZu6HNag8Gewy62vG43c5B1jn1SRWYsiK7SGDE/83RtOO3yldRF/qFml82TYjCLAq6nCOSaS1ds0GHzked2Xnjmz14ekXxL5ncw4fWv/d42jALW6MHCtXrFkKPAweqvxJXiczE2ocXlwXenqjHjLjL7m+LBc00ckwIHXLHD+VA8EjrPvbEEaO/Q48TmWCf1jlmq81nqXDd3YMNlErwB5BB4FUpyPGDMfbVB6adczSGcR5i1zi/avBs3MvbpcjF/m3ahSBxYVxDeIuotzsXJ0RG7jsBqNRk1XhgslJ+cYFSjE6gEpKc5tl/1Bgwm9Ixksc29rGd4srLdmZBfBr0YN0wmfiX6jXgadpmJtqzP9GlM59jMRV1Q6mfNTTGRMQfEzNY4gajLKrfZy/WnajkPY6qxQcYzsXOzeQ2ict79DSyWIQU8QkRBS2/Qt8SDkLSdZzKg8DMXKzzWz4bLbqC6IusgwJiXty9mDmlMFWEtjVvNin7DoG2XxIjTgvg643kljrNUvUEnY6Gi8 X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 14:50:01.7808 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1a84bc5-bdfc-4ff3-ba3b-08dc96b86c7b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002310.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5946 The test works by sending packets through a tunnel, whence they are forwarded to a LAG. One of the LAG children is removed from the LAG prior to the exercise, and the test then counts how many packets pass through the other one. The issue with this is that it counts all packets, not just the encapsulated ones. So instead add a second gretap endpoint to receive the sent packets, and check reception counters there. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- .../net/forwarding/mirror_gre_lag_lacp.sh | 37 +++++++++++-------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh index 9edf4cb104a8..f521648682bf 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh @@ -37,8 +37,14 @@ # | \ / | # | \____________________________________________/ | # | | | -# | + lag2 (team) | -# | 192.0.2.130/28 | +# | + lag2 (team) ------> + gt4-dst (gretap) | +# | 192.0.2.130/28 loc=192.0.2.130 | +# | rem=192.0.2.129 | +# | ttl=100 | +# | tos=inherit | +# | | +# | | +# | | # | | # +---------------------------------------------------------------------------+ @@ -122,16 +128,21 @@ h3_create() { vrf_create vrf-h3 ip link set dev vrf-h3 up - tc qdisc add dev $h3 clsact - tc qdisc add dev $h4 clsact h3_create_team + + tunnel_create gt4-dst gretap 192.0.2.130 192.0.2.129 \ + ttl 100 tos inherit + ip link set dev gt4-dst master vrf-h3 + tc qdisc add dev gt4-dst clsact } h3_destroy() { + tc qdisc del dev gt4-dst clsact + ip link set dev gt4-dst nomaster + tunnel_destroy gt4-dst + h3_destroy_team - tc qdisc del dev $h4 clsact - tc qdisc del dev $h3 clsact ip link set dev vrf-h3 down vrf_destroy vrf-h3 } @@ -188,18 +199,12 @@ setup_prepare() h2_create h3_create switch_create - - trap_install $h3 ingress - trap_install $h4 ingress } cleanup() { pre_cleanup - trap_uninstall $h4 ingress - trap_uninstall $h3 ingress - switch_destroy h3_destroy h2_destroy @@ -219,6 +224,7 @@ test_lag_slave() mirror_install $swp1 ingress gt4 \ "proto 802.1q flower vlan_id 333 $tcflags" + vlan_capture_install gt4-dst "vlan_ethtype ipv4 ip_proto icmp type 8" # Move $down_dev away from the team. That will prompt change in # txability of the connected device, without changing its upness. The @@ -226,13 +232,14 @@ test_lag_slave() # other slave. ip link set dev $down_dev nomaster sleep 2 - mirror_test vrf-h1 192.0.2.1 192.0.2.18 $up_dev 1 10 + mirror_test vrf-h1 192.0.2.1 192.0.2.18 gt4-dst 100 10 # Test lack of connectivity when neither slave is txable. ip link set dev $up_dev nomaster sleep 2 - mirror_test vrf-h1 192.0.2.1 192.0.2.18 $h3 1 0 - mirror_test vrf-h1 192.0.2.1 192.0.2.18 $h4 1 0 + mirror_test vrf-h1 192.0.2.1 192.0.2.18 gt4-dst 100 0 + + vlan_capture_uninstall gt4-dst mirror_uninstall $swp1 ingress # Recreate H3's team device, because mlxsw, which this test is From patchwork Thu Jun 27 14:48:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13714518 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2045.outbound.protection.outlook.com [40.107.220.45]) (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 314D91514EE; Thu, 27 Jun 2024 14:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499817; cv=fail; b=V7KZN9ou5LIAjLPg/c4POaTM+E9uA0Xt7Jo6ReN3BCjUH+Z7TXtnx3C2w9DLAQU07g0FvGwaP0s9GJkwis+xefD+5TBzTlHEB4alFK3FJs+VELWPsUYm68f1F2oGXekVmRRKiL8J2NP7G1AYp2bnRRaCWHUZqp9Cfip+4kk1UDY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499817; c=relaxed/simple; bh=1ER9F8Nc6O25JXIqbiwPmmMnw5hG2w9Xbs+Pn9AbN1A=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Q/EojjRNnfO9sV01ujvoHwG221MKXd9YUA++xraSQxRSVYp7l+P5FuO55jQRVWuznvT3arUrwGZzAqoIuuWstLmzpDxCGMMFlqehhiBTwuxTkzbMa7onAwNPI20AwcOU9eefFrHO6jIFxvQ7icy0grMunagYxk6EAJwJGB1aN8g= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=B1DbU8VJ; arc=fail smtp.client-ip=40.107.220.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="B1DbU8VJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DtNze17arHjcSXD4yCyCH1BYqZy0f+WXPsf+LcEQSpAUOgw0k9GWxSElOqM1jH7LyHfmFt+WSt9fU0hAS79yNtJnh4Iar76Iq/pwVtvtBXa07KcVfZmUgCAWpQvVXLt/xTvr3naxlMrsxC+8hIs1yabUrBY/3Ey3WbQblVscIX9uuJCEaUwcVVN3tJAUSF7O4kOetKDCQAapj4pCcKuOENTnng2qs+iOs9xjddtripbRCuTrQHYBdfptjb830ePTzHlCpcVfz2dC25udtkb/CWKH91RSMA6P74YeBJRWLOqo9sMEM2XkRO5JKnrXKQCnN3wwFWtcGwa0EV2cpLfcgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0hDTKGw+NIaZglVPeNcnnWDO83EzK1dFhVkge87ZpHQ=; b=WeZrlHELMUNrfaVERcQMWBUpGk6GDZzoVGa5x2pgMcvfZ3KmJTyZo7auGiWEzGP+a3T8kPo3sJ/PnqGeMNMSs0EdnL4tMneHvr897Z5IV87LYKp4E4E6pbLKRJwGoPTsyBvtyf33kRE0rBAYW5SeDjh8GZfQ9Cd87BLuoUNXGxRCfKCxxsNHeyYLWwmFqbZqM/nDeuMXQdXprWuLKH7yeBHrARn82WYhvFf/MJfrx/VkhXxCP1SD3K74ZjqdnA/q6nqH/q6zal4rrXevVqKasBOUvFro6k4RipK0/xruUqwkgPwVc+4OPMoCmL2zn2RwucjC2Z3iK23JH/E8xOcD/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0hDTKGw+NIaZglVPeNcnnWDO83EzK1dFhVkge87ZpHQ=; b=B1DbU8VJbHoiDyLN2CZ/nUuXL4NvTuhhP2XVKWpRF0ON8LUAiy1EOMFQC26lDMRPzHEEL/iV+Pvfjrlhfb9Sn+yNx86GiKgPGd4V3lK3wK07NYuYPzw4kiAni4F8vWfoRljGnBKzC9rKOhljGoCt7CZZYIGUc3hCkMpkH/UUOntBNrbOu08hVeBWudp+V1dnEdBLeZtFDyPL9TFg3IVwhnrdGklJ+XXK2YfkAXKJXwTe/EeijHJ7fis49UE+Tf3uCPQ8WODC3+MWZkglDwHZstuVjjDNaRHmpEiOT861yEKAUJNSSS8rOwziHYZWEmxGAinWJoSwMxMID3h6yEl3oA== Received: from BYAPR21CA0016.namprd21.prod.outlook.com (2603:10b6:a03:114::26) by LV2PR12MB5991.namprd12.prod.outlook.com (2603:10b6:408:14f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.26; Thu, 27 Jun 2024 14:50:05 +0000 Received: from SJ1PEPF00002311.namprd03.prod.outlook.com (2603:10b6:a03:114:cafe::eb) by BYAPR21CA0016.outlook.office365.com (2603:10b6:a03:114::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.8 via Frontend Transport; Thu, 27 Jun 2024 14:50:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002311.mail.protection.outlook.com (10.167.242.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 14:50:04 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:49:54 -0700 Received: from yaviefel.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:49:48 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Danielle Ratson , Petr Machata , Ido Schimmel , Hangbin Liu , Benjamin Poirier , Shuah Khan , , Simon Horman , Subject: [PATCH net-next 05/12] selftests: mirror: do_test_span_dir_ips(): Install accurate taps Date: Thu, 27 Jun 2024 16:48:42 +0200 Message-ID: X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002311:EE_|LV2PR12MB5991:EE_ X-MS-Office365-Filtering-Correlation-Id: fa7c1fec-cfb0-4576-7bce-08dc96b86e30 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: 6+rYVa5x8YtUx+z3VQtyb2A2CQV62SirzKPkUW8mExts/Nuo8iYTbpQuY+nkLeVDNRm9ecqwaWmiHF/wQY3UK/adkTbjtdnlkps71ClbMqrwB21NV9DVSg8GVHwEa6xPB+mLvpxi/vmTuhmAyB6FIhAH1p5V97bXyvQcfv888oOUb3f87xa0zibf1PbRcLc/50f+uIP/FegvuE1utqepsbpfjtirXu0K7gNYMDF8GTzd6PfyIvJ4rL3B1tMiCoXTTMIxGH0/yyG5kq5Mk+rmVleHfNfxkqrstize3lB1+3iljJD+uGhLW4fBBOUOrlNDe3ohO97JyXSFuxFYRdivXBt/nFfivv2p2ZEwXf8eeY/Bq8su44kIEVABWBTpUfFc901YyIP5C7dIy4cEmvew3c/zzW8i0K6T40qribmMDAixZZT/hG5XDJSN444hcyT/1bUhX7vhc9mH4kK4mVWfa50OGW0xG03PgFparceNut4HE6YlcvqUEKea/bhIoN6n0FomG6iswPAau141aW9f6lZS46tJCs3vRopE2wTIf6aNCMfn+7q2y0Y7yOagS5Zom3miz9/6YNJ8f40/mKrMGXiOWXXR3gR88Nm0sXx9aU0iNUfZdr3A+EUj3YuYvvqIRwImSnrJfMCm5mW/3cDWxPYSXv1OkYAlcDVIiiBz6kLuE6THbkzgYgsBqoqikCUXtT/wyIdG/b7xp3KyNYGc1ly9gveitmIQGWyFw2jR6idTJiEAOeOG8YiEXnyqoOioUpKLFjeLkJtRCMO4gb3v5CrBtYlZ7HKLD/4HvGuknnDf9iCjYF8VANDg0siEhcz5a+KY0fm3wGKQns6JZAmDzZ34LHSUBL+t1UHv41PgyNP9fMVhgl/QdRVlSmQi6kzcS/0r76Ghg8iHLZ8BG+pmS2SzvE+H4gSNVRFyJin4I4lLxOCoEfIqP3JVAGl+Ocr9GT38dF4LDNZVfZwzplfpB06LHqDfjZ/cFAFY1KvgRvYh7Jc/RKdHzRxUQmzDatm+kOkDFDAOpZrNGvLZWkru45mDpDTdMga3sRjgxVjphkyhunH5UB32l633LJWWVZlrmo7cqlIX5j3REoDidXhSgcRfBRZ9R9QXqlPv8hz1KOAECp/rVYNl9ttrclv3zmWUjkSdPy7VkEe99cAIPE268DtRX8j6cYhDD2Xzx+4tQ4Mn5nfGtIBfLiWns+WabDUd0aPXfEt95gvoCZNl9cM5OgSm22IE1dnS5lqAnoG0Em8Xv2xbgF/BI9CzIp74FEob7BfNfbaWIMzL0iSVdizJ6o5GSI6u1lB29hCuSCbUBKkC5qVJCLWwBVq1JfCazUAlpcp5TE790g2oR519ZcRiKE7TX7C77oV8Psrwe5K90xEoPP1/yojzsFxBb8oz5nLkPH0f+4PvpCF7/l28LLBqUEw31lsj4+8hKy4kqNCIrKYrRCuxZv+VzJ9qOJMR7bJA X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 14:50:04.6431 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa7c1fec-cfb0-4576-7bce-08dc96b86e30 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002311.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5991 The mirroring selftests work by sending ICMP traffic between two hosts. Along the way, this traffic is mirrored to a gretap netdevice, and counter taps are then installed strategically along the path of the mirrored traffic to verify the mirroring took place. The problem with this is that besides mirroring the primary traffic, any other service traffic is mirrored as well. At the same time, because the tests need to work in HW-offloaded scenarios, the ability of the device to do arbitrary packet inspection should not be taken for granted. Most tests therefore simply use matchall, one uses flower to match on IP address. As a result, the selftests are noisy, because besides the primary ICMP traffic, any amount of other service traffic is mirrored as well. However, often the counter tap is installed at the remote end of the gretap tunnel. Since this is a SW-datapath scenario anyway, we can make the filter arbitrarily accurate. Thus in this patch, add parameters forward_type and backward_type to several mirroring test helpers, as some other helpers already have. Then change do_test_span_dir_ips() to instead of installing one generic tap and using it for test in both directions, install the tap for each direction separately, matching on the ICMP type given by these parameters. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- .../selftests/net/forwarding/mirror_gre.sh | 12 +++++----- .../net/forwarding/mirror_gre_lib.sh | 23 +++++++++++++++---- .../net/forwarding/mirror_gre_neigh.sh | 14 ++++++----- .../selftests/net/forwarding/mirror_lib.sh | 15 +++++++++--- 4 files changed, 44 insertions(+), 20 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/mirror_gre.sh b/tools/testing/selftests/net/forwarding/mirror_gre.sh index 00def4b04145..b645cb8d696a 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre.sh @@ -91,17 +91,17 @@ test_two_spans() mirror_install $swp1 ingress gt4 "matchall $tcflags" mirror_install $swp1 egress gt6 "matchall $tcflags" - quick_test_span_gre_dir gt4 - quick_test_span_gre_dir gt6 + quick_test_span_gre_dir gt4 8 0 + quick_test_span_gre_dir gt6 0 8 mirror_uninstall $swp1 ingress - fail_test_span_gre_dir gt4 - quick_test_span_gre_dir gt6 + fail_test_span_gre_dir gt4 8 0 + quick_test_span_gre_dir gt6 0 8 mirror_install $swp1 ingress gt4 "matchall $tcflags" mirror_uninstall $swp1 egress - quick_test_span_gre_dir gt4 - fail_test_span_gre_dir gt6 + quick_test_span_gre_dir gt4 8 0 + fail_test_span_gre_dir gt6 0 8 mirror_uninstall $swp1 ingress log_test "two simultaneously configured mirrors ($tcflags)" diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh index 2bed2a4013aa..e49535ce1cdd 100644 --- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh @@ -7,8 +7,11 @@ quick_test_span_gre_dir_ips() local tundev=$1; shift local ip1=$1; shift local ip2=$1; shift + local forward_type=$1; shift + local backward_type=$1; shift - do_test_span_dir_ips 10 h3-$tundev "$ip1" "$ip2" + do_test_span_dir_ips 10 h3-$tundev "$ip1" "$ip2" \ + "$forward_type" "$backward_type" } fail_test_span_gre_dir_ips() @@ -84,8 +87,11 @@ full_test_span_gre_dir_vlan_ips() quick_test_span_gre_dir() { local tundev=$1; shift + local forward_type=${1-8}; shift + local backward_type=${1-0}; shift - quick_test_span_gre_dir_ips "$tundev" 192.0.2.1 192.0.2.2 + quick_test_span_gre_dir_ips "$tundev" 192.0.2.1 192.0.2.2 \ + "$forward_type" "$backward_type" } fail_test_span_gre_dir() @@ -139,12 +145,15 @@ full_test_span_gre_stp_ips() local what=$1; shift local ip1=$1; shift local ip2=$1; shift + local forward_type=$1; shift + local backward_type=$1; shift local h3mac=$(mac_get $h3) RET=0 mirror_install $swp1 ingress $tundev "matchall $tcflags" - quick_test_span_gre_dir_ips $tundev $ip1 $ip2 + quick_test_span_gre_dir_ips $tundev $ip1 $ip2 \ + "$forward_type" "$backward_type" bridge link set dev $nbpdev state disabled sleep 1 @@ -152,7 +161,8 @@ full_test_span_gre_stp_ips() bridge link set dev $nbpdev state forwarding sleep 1 - quick_test_span_gre_dir_ips $tundev $ip1 $ip2 + quick_test_span_gre_dir_ips $tundev $ip1 $ip2 \ + "$forward_type" "$backward_type" mirror_uninstall $swp1 ingress @@ -164,7 +174,10 @@ full_test_span_gre_stp() local tundev=$1; shift local nbpdev=$1; shift local what=$1; shift + local forward_type=${1-8}; shift + local backward_type=${1-0}; shift full_test_span_gre_stp_ips "$tundev" "$nbpdev" "$what" \ - 192.0.2.1 192.0.2.2 + 192.0.2.1 192.0.2.2 \ + "$forward_type" "$backward_type" } diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh b/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh index 0f2c38eca2a3..0615f9244406 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh @@ -60,15 +60,17 @@ test_span_gre_neigh() local addr=$1; shift local tundev=$1; shift local direction=$1; shift + local forward_type=$1; shift + local backward_type=$1; shift local what=$1; shift RET=0 ip neigh replace dev $swp3 $addr lladdr 00:11:22:33:44:55 mirror_install $swp1 $direction $tundev "matchall $tcflags" - fail_test_span_gre_dir $tundev + fail_test_span_gre_dir $tundev "$forward_type" "$backward_type" ip neigh del dev $swp3 $addr - quick_test_span_gre_dir $tundev + quick_test_span_gre_dir $tundev "$forward_type" "$backward_type" mirror_uninstall $swp1 $direction log_test "$direction $what: neighbor change ($tcflags)" @@ -76,14 +78,14 @@ test_span_gre_neigh() test_gretap() { - test_span_gre_neigh 192.0.2.130 gt4 ingress "mirror to gretap" - test_span_gre_neigh 192.0.2.130 gt4 egress "mirror to gretap" + test_span_gre_neigh 192.0.2.130 gt4 ingress 8 0 "mirror to gretap" + test_span_gre_neigh 192.0.2.130 gt4 egress 0 8 "mirror to gretap" } test_ip6gretap() { - test_span_gre_neigh 2001:db8:2::2 gt6 ingress "mirror to ip6gretap" - test_span_gre_neigh 2001:db8:2::2 gt6 egress "mirror to ip6gretap" + test_span_gre_neigh 2001:db8:2::2 gt6 ingress 8 0 "mirror to ip6gretap" + test_span_gre_neigh 2001:db8:2::2 gt6 egress 0 8 "mirror to ip6gretap" } test_all() diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh index ee0fd71ad2fd..6a0c66d7ba7f 100644 --- a/tools/testing/selftests/net/forwarding/mirror_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh @@ -61,9 +61,14 @@ do_test_span_dir_ips() local dev=$1; shift local ip1=$1; shift local ip2=$1; shift + local forward_type=${1-8}; shift + local backward_type=${1-0}; shift - icmp_capture_install $dev + icmp_capture_install $dev "type $forward_type" mirror_test v$h1 $ip1 $ip2 $dev 100 $expect + icmp_capture_uninstall $dev + + icmp_capture_install $dev "type $backward_type" mirror_test v$h2 $ip2 $ip1 $dev 100 $expect icmp_capture_uninstall $dev } @@ -73,8 +78,11 @@ quick_test_span_dir_ips() local dev=$1; shift local ip1=$1; shift local ip2=$1; shift + local forward_type=${1-8}; shift + local backward_type=${1-0}; shift - do_test_span_dir_ips 10 "$dev" "$ip1" "$ip2" + do_test_span_dir_ips 10 "$dev" "$ip1" "$ip2" \ + "$forward_type" "$backward_type" } fail_test_span_dir_ips() @@ -95,7 +103,8 @@ test_span_dir_ips() local ip1=$1; shift local ip2=$1; shift - quick_test_span_dir_ips "$dev" "$ip1" "$ip2" + quick_test_span_dir_ips "$dev" "$ip1" "$ip2" \ + "$forward_type" "$backward_type" icmp_capture_install $dev "type $forward_type" mirror_test v$h1 $ip1 $ip2 $dev 100 10 From patchwork Thu Jun 27 14:48:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13714519 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2075.outbound.protection.outlook.com [40.107.236.75]) (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 841A51514EE; Thu, 27 Jun 2024 14:50:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499825; cv=fail; b=RscF1Z2eGDwdA+DWSYsvZ9zT2cYvhdqdoeiclsBxjuKAItLwaTG7XXoqaDAFHm94PPU9apWDHmQrletrMKvtz5897kK9aBwsSuKdXbPLPdd13lWVQ+6u4c+B5yuAyFZi0uL0EnNxeYfIYlnOPtiVBaBRHR0BCdQ/Rfe7UFVwKek= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499825; c=relaxed/simple; bh=3BiBV6z3cZVF8huW0vjaKRGbRfsyIaJlYAqZ2timINA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=C1fthqPxK6cc7RspHdC4v7AEja265s57JeE3YLYj4jmbe3mo9KTWQ3VFmvx6bp5kFBtPltSG4A5mLuCUvAmCOBwph/XB2h67WjJ2DjeudrliscAObfxTtxgkaP0jCYHbks8MXtNjIsn5rQ0MTYkDmlVpriD5sxZKefjVU8Uugbw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=gczdeiNf; arc=fail smtp.client-ip=40.107.236.75 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="gczdeiNf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UxhYHr1FWwdRoV/ELkLw3yngWoumwozwNbGXz1j508+OwHB8jmGMFOR2lJwQ9bDbFInRezdhn1CgQDdjqiofLBSAqsZ1sb5O0t07uMrb9BlXax+N1+evSnzRcDhOQPykaRLlHKQU5s00r9hnkAvbQKnrVQJxthlUJ7WK5CBK4KiBcAhVz2WQfwkl0XdDdMxHLFDN/x5SAckAymcUVI3/npuw2YddmHJwV3ZUYqYDcRfS64nvPjNqJ80SCZAPgaVjwhkap0zHDKMcXD7E8MleuLvI6XLTfqZKHyFhKX9c1fZNFnPklcby2ZjIEpFEDI9SmgGJJl0NcaTUEQ4X923RAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=O+Ja5Q7JldMDAIgiy+s7yGatQJaSNmspwBWVPgmTcAs=; b=cLOgR36Aye2kTD0n2sj30/AGnAAj0sRsIOL52Hq82XRHfzHe0eDPZk1EUTUPcd04GwhHNk7JVObLnSapNd3nS9dY8wNbp4Y/uFExCepKwkzHjTnYKd9KU3nJF9eGPgNtZN1AgX+NfF5h8e70X1JnMCYi/iQZ5+gXESDLBp07OGG/mzCbWskSi7mxa67Xc7vnyzymGPk3v2Qj40LAYlx4r6cFJ7n3guwxDE9LQcWb57CTGppv7RfWdjRqVPQhHHP58Q7zvECCep2CrcbYQunBbqWNMXZwZu0xxhtdrv+QEXvjMtm/UMjo7+BmcDPveYioo+XLUu8IcpZC/Dp5V/0q/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O+Ja5Q7JldMDAIgiy+s7yGatQJaSNmspwBWVPgmTcAs=; b=gczdeiNfY4HxeX8aSmIxSKU+hgUSkGaan24qLpD6MyJLCo7M+Xp4tDSZjfzKeGfazlHkZB0VNH04M9YymkgJDmoxAYcIniV/5+tDZt1xZgC+AY/BMtfDe3S5DlpMMzQIOZQoU4ShIbOiRNjkjdaCPbIZievAr4aIe26ZL6VPty0stXGm4YpN9MoeDKKpEIyoSivKxsppyyD8jO53/GKjwyQ0dpFMrXxq6e7JWbD4ZuXK8GWGUIZjCyYN51JoU1EwZchcT9CpxG0zFoW37YRxsGbGvZtScBdCW/dCQPGeCSbV+okE6hyvpx1jZF9P0DZizjDdKP4mljId8ZZu4JxtRQ== Received: from CH0PR04CA0054.namprd04.prod.outlook.com (2603:10b6:610:77::29) by SJ0PR12MB6759.namprd12.prod.outlook.com (2603:10b6:a03:44b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.34; Thu, 27 Jun 2024 14:50:18 +0000 Received: from DS3PEPF000099DC.namprd04.prod.outlook.com (2603:10b6:610:77:cafe::1f) by CH0PR04CA0054.outlook.office365.com (2603:10b6:610:77::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.26 via Frontend Transport; Thu, 27 Jun 2024 14:50:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS3PEPF000099DC.mail.protection.outlook.com (10.167.17.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 14:50:18 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:00 -0700 Received: from yaviefel.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:49:54 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Danielle Ratson , Petr Machata , Ido Schimmel , Hangbin Liu , Benjamin Poirier , Shuah Khan , , Simon Horman , Subject: [PATCH net-next 06/12] selftests: mirror: mirror_test(): Allow exact count of packets Date: Thu, 27 Jun 2024 16:48:43 +0200 Message-ID: X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099DC:EE_|SJ0PR12MB6759:EE_ X-MS-Office365-Filtering-Correlation-Id: a401c448-5f77-421c-1a81-08dc96b87669 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: Y7Iz+9YipxK2yPYO9KVBdCK/skBIbSOR5EjjyGcu0QFKGJKDhPg0BpgNYE4Jz+4JTl5Ny4gRRKNJcVKhUHgvDoAf4Z7cwik2H2dTIEKxw2MSgywhcFoHYe13ZxbFCIgF4i19jG62FfbMb3tnhLWQB1/+7JKuyK2kURv7FoLTgR1ZxRZVRdDFVVZOdnIxITtVT/64+ddA+4G2jB1NfbMXXWUXtk89mk6IMRyrnmI71NvXVhapbECKcUviW6dnKXKqGOGNkN4YWcNZjCc+K5EIc1KZX04ltwySZLkDRt2OCkKeNIFnSXquESiGVJt2O4unrSt0IhNQmXg4QR3WrQYxmI2J67CcBC4MVhqKJibmVWAeVehxx4jm4prNj8HC8jnCpN9ZcjiRMtUBncieZs1qY6voM7+SXcMfVYDPhIbVELIk0LMCEIeZb29CyT1IvckgaMn2Wm6NRRx/ZSXCE3q/lJksNzSzsw/ZHJ9FmmvaISMXnBsgQd5SFv20cQaSoLrFZEEJsZRmV9gTRUpqKEwsAIgh8jcyL97t6r5MWwc5jr04Wh7YcMI8zSggWfBai6NGBNjJtU21vEtPTQK+jwxYskliWEXCPkFU2SAZwZkuHcw6daHSudOIjGlZQTjFiot12mzULdK4S4tSc72Gy11JzLucMmINaAsvqmAWPGuGQ35mM4q+Ym4mqlk2/hmWAVFhzz9n+G6MdTwuN7YI4dCnFQDH7/jdJSpdlnTmMYlATvly+MBH8nV3Pl6wENQuVzLCJvRwPEpH6G8eUNPB1Nb6MkkFUdDOiGeyap07VA/QccQhHUnoQf07967htZOJyy/PCICyDZoTvQhH1CrNPOd039j1nzQkaFkgv59DyKp+NdqYEi2J7ZWzDnNOPndjLyN61yRjLN855eRlaH7CGm6Cg2Tlv3FAIKWuh3h1fOk5mb3uh3fEy5l6MzjWgVnsnsf0x9yM4OK5YkQqnDF5sJw1Jxr/xLdzJliCDdiNxggZbUJKSUCJxPADhbeH70T/M2hcNKdmuT6oOTeTugxA2wumiwOYUZRkIJtaOJz/WRYWD4SdPMAdUpRQBSus0hI7rARqy6J2mQ8anudi1ugBI9Iz2nKNhfEhmGkJVZvjD+4kF7Nxcxzbse23Bwqm4M9MXfwsxYjttBwbmxu6cu0sNxZe0d4xgjf+87Q4vjYkI1ffIAAohGJwief6Gv1fXtNN4zpWK7QvLWky/SfS2Wq6nL+30lEY43XzCQBbHHNzE8Uq9Vk8RPKrtnRCdAb9R4w3V6Y4UXcQ2RJtxYmUpf4Go/VTg0Xqn6o9thzwwUbx+nGc6SLhZkIZrsPf/O84WHGK8E35fIRsxkxQx8qMk0WWw23cLY14FdVG6f4j2NyUawhujMRdwvA++X/3VckzB4p1aKRfaLlBvKNZNk9AKximWElYOECTWneNNMmBWMSVuvrGEGfJDUTyyf0FX059xjOlcbgt X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 14:50:18.2953 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a401c448-5f77-421c-1a81-08dc96b87669 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099DC.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6759 The mirroring selftests work by sending ICMP traffic between two hosts. Along the way, this traffic is mirrored to a gretap netdevice, and counter taps are then installed strategically along the path of the mirrored traffic to verify the mirroring took place. The problem with this is that besides mirroring the primary traffic, any other service traffic is mirrored as well. At the same time, because the tests need to work in HW-offloaded scenarios, the ability of the device to do arbitrary packet inspection should not be taken for granted. Most tests therefore simply use matchall, one uses flower to match on IP address. As a result, the selftests are noisy, because besides the primary ICMP traffic, any amount of other service traffic is mirrored as well. mirror_test() accommodated this noisiness by giving the counters an allowance of several packets. But in the previous patch, where possible, counter taps were changed to match only on an exact ICMP message. At least in those cases, we can demand an exact number of packets to match. Where the tap is installed on a connective netdevice, the exact matching is not practical (though with u32, anything is possible). In those places, there should still be some leeway -- and probably bigger than before, because experience shows that these tests are very noisy. To that end, change mirror_test() so that it can be either called with an exact number to expect, or with an expression. Where leeway is needed, adjust callers to pass a ">= 10" instead of mere 10. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- .../net/forwarding/mirror_gre_bridge_1q_lag.sh | 2 +- .../selftests/net/forwarding/mirror_gre_changes.sh | 2 +- .../selftests/net/forwarding/mirror_gre_lib.sh | 2 +- .../testing/selftests/net/forwarding/mirror_lib.sh | 14 +++++++++----- .../selftests/net/forwarding/mirror_vlan.sh | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh index c53148b1dc63..b719d24a4ae5 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh @@ -239,7 +239,7 @@ test_lag_slave() setup_wait_dev $host_dev $ARPING -I br1 192.0.2.130 -qfc 1 sleep 2 - mirror_test vrf-h1 192.0.2.1 192.0.2.18 $host_dev 1 10 + mirror_test vrf-h1 192.0.2.1 192.0.2.18 $host_dev 1 ">= 10" # Test lack of connectivity when both slaves are down. ip link set dev $up_dev down diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh b/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh index 3796f4256c9c..b57fb9f069f4 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh @@ -81,7 +81,7 @@ test_span_gre_ttl() ip link set dev $tundev type $type ttl 50 sleep 2 - mirror_test v$h1 192.0.2.1 192.0.2.2 $h3 77 10 + mirror_test v$h1 192.0.2.1 192.0.2.2 $h3 77 ">= 10" ip link set dev $tundev type $type ttl 100 tc filter del dev $h3 ingress pref 77 diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh index e49535ce1cdd..cc3a0a3f83ba 100644 --- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh @@ -76,7 +76,7 @@ full_test_span_gre_dir_vlan_ips() tc filter add dev $h3 ingress pref 77 prot 802.1q \ flower $vlan_match \ action pass - mirror_test v$h1 $ip1 $ip2 $h3 77 10 + mirror_test v$h1 $ip1 $ip2 $h3 77 '>= 10' tc filter del dev $h3 ingress pref 77 mirror_uninstall $swp1 $direction diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh index 6a0c66d7ba7f..1fc8545da6e0 100644 --- a/tools/testing/selftests/net/forwarding/mirror_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh @@ -44,14 +44,17 @@ mirror_test() local type="icmp echoreq" fi + if [[ -z ${expect//[[:digit:]]/} ]]; then + expect="== $expect" + fi + local t0=$(tc_rule_stats_get $dev $pref) $MZ $proto $vrf_name ${sip:+-A $sip} -B $dip -a own -b bc -q \ -c 10 -d 100msec -t $type sleep 0.5 local t1=$(tc_rule_stats_get $dev $pref) local delta=$((t1 - t0)) - # Tolerate a couple stray extra packets. - ((expect <= delta && delta <= expect + 2)) + ((delta $expect)) check_err $? "Expected to capture $expect packets, got $delta." } @@ -146,8 +149,8 @@ do_test_span_vlan_dir_ips() # The traffic is meant for local box anyway, so will be trapped to # kernel. vlan_capture_install $dev "skip_hw vlan_id $vid vlan_ethtype $ul_proto" - mirror_test v$h1 $ip1 $ip2 $dev 100 $expect - mirror_test v$h2 $ip2 $ip1 $dev 100 $expect + mirror_test v$h1 $ip1 $ip2 $dev 100 "$expect" + mirror_test v$h2 $ip2 $ip1 $dev 100 "$expect" vlan_capture_uninstall $dev } @@ -159,7 +162,8 @@ quick_test_span_vlan_dir_ips() local ip1=$1; shift local ip2=$1; shift - do_test_span_vlan_dir_ips 10 "$dev" "$vid" "$ul_proto" "$ip1" "$ip2" + do_test_span_vlan_dir_ips '>= 10' "$dev" "$vid" "$ul_proto" \ + "$ip1" "$ip2" } fail_test_span_vlan_dir_ips() diff --git a/tools/testing/selftests/net/forwarding/mirror_vlan.sh b/tools/testing/selftests/net/forwarding/mirror_vlan.sh index 074165f46a9d..bc3297846511 100755 --- a/tools/testing/selftests/net/forwarding/mirror_vlan.sh +++ b/tools/testing/selftests/net/forwarding/mirror_vlan.sh @@ -85,7 +85,7 @@ test_tagged_vlan_dir() RET=0 mirror_install $swp1 $direction $swp3.555 "matchall $tcflags" - do_test_span_vlan_dir_ips 10 "$h3.555" 111 ip 192.0.2.17 192.0.2.18 + do_test_span_vlan_dir_ips '>= 10' "$h3.555" 111 ip 192.0.2.17 192.0.2.18 do_test_span_vlan_dir_ips 0 "$h3.555" 555 ip 192.0.2.17 192.0.2.18 mirror_uninstall $swp1 $direction From patchwork Thu Jun 27 14:48:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13714520 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2062.outbound.protection.outlook.com [40.107.220.62]) (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 C0A83198A04; Thu, 27 Jun 2024 14:50:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499833; cv=fail; b=oB6eenV1UbZP0FAZU4Is8R4NSkScshWr7Lq4pe5mKFaLCiDH/9pL9ENpg0tzN3lhc8EkjxMCtxfcXd4OtWKAXqiUYF7XT8BscLCqRDnN4K7RY7fexzsyHxjWP+Z/Tbrin+UPBCIXP2n+zkIe016Ni8cGdvZRa5sR+Nx7p+ZuvWo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499833; c=relaxed/simple; bh=iDxezbEXrNU38vvjLYqT6/ktYQDkunY2UTPN8gKompA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VUJ4KQzCb0vGjJXgQT+CCf9hf3DU8h58uJtbEPlgI4eADkjbE7THsyn7ARUvSBj4gxCW5bhNiyZr8Nr666FLp/7qMRugxeFyPAtZ4/iYpcSldRMHihiBow1VkRdL33TdT6vySo9c0gn2Zti+YRLmwo3riA41YQXWkV87QQ4SWgU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=oFJMBYXy; arc=fail smtp.client-ip=40.107.220.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="oFJMBYXy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j944HSGGZyxK3kUA0VADatNwh4d4MRh7DCGDMxItlOonfq3NQ1RAaWjberaKIr+3woB21AAQiKr4jepCrpEbU3zCpMPXjO1K1De6GEd9iqttzQQl6uWYvwNcWPhtinfC3EEdOQ+AoLMFmmCwenZArs9IQYSfMNbM45Qyw8jDIk+oPJpKT/g1gh5GAi1qPRysJRnf1c28a6eolfRtKqZbbSVjIdm9O+QPTTCGdiT6elTJjq9ZTyn+1Zn1t4Ev2/J3r/GDyqnnudh/DuNTcj0WXZAwSDRvjcqapBIQk2xlXGWonxDzZRB5mCmWX3vBSNcw+v/OEGjgXJxPy/POI/BadA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=g4dy/ePcL/Oih6dbpuz6kKJZBKotNDZwC+rQ0IorWrg=; b=TRzZ/b6lWjjbAMtXK8yufBAgVF3q0AKKYx0TqQHNrdQTbwd8hrdv2cduRaP3eV8jATIcxSkQB1/3Mm7poWn3Bzo4YmuOf3K2gy08VeTwmm00Bgo0gg9leanSZ6Tc8sP/1iZo5H+qYLat9+tOUsMyNYNvwogWRSuutlxVUSILwdWfoIVW9PeBElyVRZ+w5VOeCmlA4T04u676OiR1MM3FN43tWzq4QJae+Tfngok2vPdRXmrp3YB37wNG7jpzVjkXJ+WLDvUR6J12URfiPJ/L1GT3ON3K+E8Frjn65njDYV2h7vNSSzzXTJPLl9BqJEcoPn6H7wb5JRrqhes6/J21dA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=temperror action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g4dy/ePcL/Oih6dbpuz6kKJZBKotNDZwC+rQ0IorWrg=; b=oFJMBYXyOXKAOg+bKaRaQCu3ZdW9+ZUklvHlExJF7ml4ZZAvkoyXQHirzFh74wlNlB+YhJBNfCFEmyY2B4aylmjZN9b4qanr06QeY7CAjcWPpTOKwpboxeQx3ZLX7G74rEMVbWkj/XbTBnouaDka9cS6jFlUNO1IolQTXZwAKZtL9G28Jh9XH15dkPzlHFC40Sc72co6AvDbEkh4xhs8aYD3rsbcX3yizrUHQ6kC/UcJgv3gtg73bue1InZHeLVH9PpSKt/WV/a61Zz+IcCTtG9FWIDlpx1DhNnA3Te4CF61Qo8Ek/5AKmWAHlnIRUob11LBBl/P9q7ZESIH7l83Hg== Received: from MW4PR04CA0227.namprd04.prod.outlook.com (2603:10b6:303:87::22) by LV8PR12MB9407.namprd12.prod.outlook.com (2603:10b6:408:1f9::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Thu, 27 Jun 2024 14:50:18 +0000 Received: from SJ1PEPF00002315.namprd03.prod.outlook.com (2603:10b6:303:87:cafe::1a) by MW4PR04CA0227.outlook.office365.com (2603:10b6:303:87::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.26 via Frontend Transport; Thu, 27 Jun 2024 14:50:18 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=temperror action=none header.from=nvidia.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of nvidia.com: DNS Timeout) Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002315.mail.protection.outlook.com (10.167.242.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 14:50:17 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:06 -0700 Received: from yaviefel.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:00 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Danielle Ratson , Petr Machata , Ido Schimmel , Hangbin Liu , Benjamin Poirier , Shuah Khan , , Simon Horman , Subject: [PATCH net-next 07/12] selftests: mirror: Drop dual SW/HW testing Date: Thu, 27 Jun 2024 16:48:44 +0200 Message-ID: X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002315:EE_|LV8PR12MB9407:EE_ X-MS-Office365-Filtering-Correlation-Id: 8d9fceb3-b482-4575-5004-08dc96b875cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: R19IeaAsoCeHCOktUDIwBMMkFx9cibu6QZeXT3btkQlnQkVQv4jCmJK716S9A/51KcErIh4R7kuBZzsOhfZA6UEMyGEO2LQHOFpPZCppYlcPBaPNFQD0TnVz7FtTA0pgMz1egbBxK/yDH/NhQsD5/7JLYNe7d5fnm5/NZ/Ekp7AQmgdKp5L2CdtYIBldpf1AuEkus3bweBErGu41dRZqVO3zn0GTWCqljB7sr7xgifZvn0CI4h0Zbs4YevOoHgRVy08OHEtBjIA0CR33kF8DXuie+SqNegptClj5phhIgJ6OT1CJSoS9lFKUCXp8eUyk6gdi7hQ0fp72qj1U9+HS95JBMb/UOhdOo9LAsUnVDf5Yu1ZWJ5eGyyw4jjgFkPWQn6xljKiwNNHn/tHx5LOmbg6zGtlrGfE2PE+LNPZ6xvrKT/kYT95qWdxry41kFZmxHlk7BoAuE6BR6cZHXab7XqQNDPvf9/QcWL5f5tP3zQj+ycMqi9NghgGYoKWlRf+UKSNNVK0iA2+Inw+RRR4FxLMutfU8/uO1ypEC7ebAKakGPwMaoU37r/RfoNobtAS5r4g3eejlUXsZoGh5ZjmtN+R/XD7DAYKPZiYeuwfcP4OWy8J4xfbl1rRl7XsyLa9vB3KSdXOT1fJ/H5G9zhanGis8h52ziBo1+hMsuLSSspJ0I38f7oHl8jN/n43TDflNxL5nLr9jpsEgQD5DQqYCJWDAsHUmmFI+Xz0jxjS1y3vG4vvrGjtuFscGtXrqb32wTJCMxNoq3ON+AA23QpGyvZnYJ1QjoQbKf5oGXiiCc29hed1dDai/O1IIG/ekRYHP5mSO6NA6YJIBBm63YWI2BBy9kdtRTrTPlT0LQFgTrBUGv9D4/gxuw0JostetTlcIHnRioh6qv5uwgzBBcOKhmc2KU9VA2pUMBEYoI0BlHlMb8Om9pkA6pjfs91Lto/hijgyLN6GSz7RndCOo9VzlznsboA6jr7+sEYQ7KFtNZ/qSVZIjsGQpAaYqlN6OSt7NnpdgXR7d/g+0VUvV2aiOtKBXtgOYEXQi+HH91W2gEYIKfuu6YfOEWTzcGz3mN7HbSx11WfUAEW8l4B4MbhoMMGtrildrJtO5Trp0UNK9lnrjw2KfusyjeDIGlmuG9JLyX5gDuIArK6seiXUWZVyJD0Nd41pXPj2P6c9QyJKLKMS7JXyPFHqbfU+Fv7wlTy1Z8tnInGjHjXiE+XpGcn0u8kSMr0sWOdObJMDk0BVfxaccERHW9FIgaqkQ9HkEb53YokWsq5n77ubtDPv7UKoxoVxKBd+trl7B17CVMRo7LxxWK+PYYvdRB+V9uHgloPfUoih13PLJlG8fNQ/nnebOrkI0wy7dqEmpvJyyhxX8S27BDx6gnXLkEA2RHMe0qcf3/cqdv27Drz2s3BrxN/5nYbViww6srLOuLF5AW3gpb/z2lgZN0T80QyltNURKYNcV X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 14:50:17.4084 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8d9fceb3-b482-4575-5004-08dc96b875cc X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002315.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9407 The mirroring tests are currently run in a skip_hw and optionally a skip_sw mode. The former tests the SW datapath, the latter the HW datapath, if available. In order to be able to test SW datapath on HW loopbacks, traps are installed on ingress to get traffic from the HW datapath to the SW one. This adds an unnecessary complexity when it would be much simpler to just use a veth-based topology to test the SW datapath. Thus drop all the code that supports this dual testing. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- .../selftests/drivers/net/mlxsw/mirror_gre.sh | 33 +++---------- .../drivers/net/mlxsw/mirror_gre_scale.sh | 18 +------ .../selftests/net/forwarding/mirror_gre.sh | 33 +++---------- .../net/forwarding/mirror_gre_bound.sh | 23 +-------- .../net/forwarding/mirror_gre_bridge_1d.sh | 21 +-------- .../forwarding/mirror_gre_bridge_1d_vlan.sh | 21 +-------- .../net/forwarding/mirror_gre_bridge_1q.sh | 21 +-------- .../forwarding/mirror_gre_bridge_1q_lag.sh | 27 ++--------- .../net/forwarding/mirror_gre_changes.sh | 47 ++++++------------- .../net/forwarding/mirror_gre_flower.sh | 25 ++-------- .../net/forwarding/mirror_gre_lag_lacp.sh | 25 ++-------- .../net/forwarding/mirror_gre_lib.sh | 12 ++--- .../net/forwarding/mirror_gre_neigh.sh | 25 ++-------- .../selftests/net/forwarding/mirror_gre_nh.sh | 29 ++---------- .../net/forwarding/mirror_gre_vlan.sh | 21 +-------- .../forwarding/mirror_gre_vlan_bridge_1q.sh | 39 ++++----------- .../selftests/net/forwarding/mirror_vlan.sh | 35 ++++---------- 17 files changed, 77 insertions(+), 378 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh b/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh index 47be3b269088..8cf06fcd724c 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh @@ -118,7 +118,7 @@ test_span_gre_ttl_inherit() RET=0 ip link set dev $tundev type $type ttl inherit - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" fail_test_span_gre_dir $tundev ip link set dev $tundev type $type ttl 100 @@ -126,7 +126,7 @@ test_span_gre_ttl_inherit() quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress - log_test "$what: no offload on TTL of inherit ($tcflags)" + log_test "$what: no offload on TTL of inherit" } test_span_gre_tos_fixed() @@ -138,14 +138,14 @@ test_span_gre_tos_fixed() RET=0 ip link set dev $tundev type $type tos 0x10 - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" fail_test_span_gre_dir $tundev ip link set dev $tundev type $type tos inherit quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress - log_test "$what: no offload on a fixed TOS ($tcflags)" + log_test "$what: no offload on a fixed TOS" } test_span_failable() @@ -156,7 +156,7 @@ test_span_failable() RET=0 - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" if ((should_fail)); then fail_test_span_gre_dir $tundev else @@ -164,7 +164,7 @@ test_span_failable() fi mirror_uninstall $swp1 ingress - log_test "$what: should_fail=$should_fail ($tcflags)" + log_test "$what: should_fail=$should_fail" } test_failable() @@ -175,17 +175,6 @@ test_failable() test_span_failable $should_fail gt6-soft "mirror to gretap w/ soft underlay" } -test_sw() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - test_failable 0 - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - test_hw() { test_failable 1 @@ -202,16 +191,6 @@ trap cleanup EXIT setup_prepare setup_wait -if ! tc_offload_check; then - check_err 1 "Could not test offloaded functionality" - log_test "mlxsw-specific tests for mirror to gretap" - exit -fi - -tcflags="skip_hw" -test_sw - -tcflags="skip_sw" test_hw exit $EXIT_STATUS diff --git a/tools/testing/selftests/drivers/net/mlxsw/mirror_gre_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/mirror_gre_scale.sh index e5589e2fca85..d43093310e23 100644 --- a/tools/testing/selftests/drivers/net/mlxsw/mirror_gre_scale.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/mirror_gre_scale.sh @@ -79,7 +79,7 @@ mirror_gre_tunnels_create() cat >> $MIRROR_GRE_BATCH_FILE <<-EOF filter add dev $swp1 ingress pref 1000 \ protocol ipv6 \ - flower $tcflags dst_ip $match_dip \ + flower skip_sw dst_ip $match_dip \ action mirred egress mirror dev $tun EOF done @@ -107,7 +107,7 @@ mirror_gre_tunnels_destroy() done } -__mirror_gre_test() +mirror_gre_test() { local count=$1; shift local should_fail=$1; shift @@ -131,20 +131,6 @@ __mirror_gre_test() done } -mirror_gre_test() -{ - local count=$1; shift - local should_fail=$1; shift - - if ! tc_offload_check $TC_FLOWER_NUM_NETIFS; then - check_err 1 "Could not test offloaded functionality" - return - fi - - tcflags="skip_sw" - __mirror_gre_test $count $should_fail -} - mirror_gre_setup_prepare() { h1=${NETIFS[p1]} diff --git a/tools/testing/selftests/net/forwarding/mirror_gre.sh b/tools/testing/selftests/net/forwarding/mirror_gre.sh index b645cb8d696a..921c733ee04f 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre.sh @@ -74,7 +74,7 @@ test_span_gre_mac() RET=0 - mirror_install $swp1 $direction $tundev "matchall $tcflags" + mirror_install $swp1 $direction $tundev "matchall" icmp_capture_install h3-${tundev} "src_mac $src_mac dst_mac $dst_mac" mirror_test v$h1 192.0.2.1 192.0.2.2 h3-${tundev} 100 10 @@ -82,15 +82,15 @@ test_span_gre_mac() icmp_capture_uninstall h3-${tundev} mirror_uninstall $swp1 $direction - log_test "$direction $what: envelope MAC ($tcflags)" + log_test "$direction $what: envelope MAC" } test_two_spans() { RET=0 - mirror_install $swp1 ingress gt4 "matchall $tcflags" - mirror_install $swp1 egress gt6 "matchall $tcflags" + mirror_install $swp1 ingress gt4 "matchall" + mirror_install $swp1 egress gt6 "matchall" quick_test_span_gre_dir gt4 8 0 quick_test_span_gre_dir gt6 0 8 @@ -98,13 +98,13 @@ test_two_spans() fail_test_span_gre_dir gt4 8 0 quick_test_span_gre_dir gt6 0 8 - mirror_install $swp1 ingress gt4 "matchall $tcflags" + mirror_install $swp1 ingress gt4 "matchall" mirror_uninstall $swp1 egress quick_test_span_gre_dir gt4 8 0 fail_test_span_gre_dir gt6 0 8 mirror_uninstall $swp1 ingress - log_test "two simultaneously configured mirrors ($tcflags)" + log_test "two simultaneously configured mirrors" } test_gretap() @@ -131,30 +131,11 @@ test_ip6gretap_mac() test_span_gre_mac gt6 egress "mirror to ip6gretap" } -test_all() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bound.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bound.sh index 6c257ec03756..e3cd48e18eeb 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_bound.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_bound.sh @@ -196,32 +196,11 @@ test_ip6gretap() full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap w/ UL" } -test_all() -{ - RET=0 - - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d.sh index 04fd14b0a9b7..6c7bd33332c2 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d.sh @@ -108,30 +108,11 @@ test_ip6gretap() full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap" } -test_all() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh index f35313c76fac..909ec956a5e5 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh @@ -104,30 +104,11 @@ test_ip6gretap_stp() full_test_span_gre_stp gt6 $swp3.555 "mirror to ip6gretap" } -test_all() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh index 0cf4c47a46f9..40ac9dd3aff1 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh @@ -104,30 +104,11 @@ test_ip6gretap() full_test_span_gre_dir gt6 egress 0 8 "mirror to ip6gretap" } -tests() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -tests - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - tests -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh index b719d24a4ae5..fe4d7c906a70 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q_lag.sh @@ -227,10 +227,10 @@ test_lag_slave() RET=0 tc filter add dev $swp1 ingress pref 999 \ - proto 802.1q flower vlan_ethtype arp $tcflags \ + proto 802.1q flower vlan_ethtype arp \ action pass mirror_install $swp1 ingress gt4 \ - "proto 802.1q flower vlan_id 333 $tcflags" + "proto 802.1q flower vlan_id 333" # Test connectivity through $up_dev when $down_dev is set down. ip link set dev $down_dev down @@ -252,7 +252,7 @@ test_lag_slave() mirror_uninstall $swp1 ingress tc filter del dev $swp1 ingress pref 999 - log_test "$what ($tcflags)" + log_test "$what" } test_mirror_gretap_first() @@ -265,30 +265,11 @@ test_mirror_gretap_second() test_lag_slave $h4 $swp4 $swp3 "mirror to gretap: LAG second slave" } -test_all() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh b/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh index b57fb9f069f4..65ae9d960c18 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh @@ -73,7 +73,7 @@ test_span_gre_ttl() RET=0 mirror_install $swp1 ingress $tundev \ - "prot ip flower $tcflags ip_prot icmp" + "prot ip flower ip_prot icmp" tc filter add dev $h3 ingress pref 77 prot $prot \ flower skip_hw ip_ttl 50 action pass @@ -87,7 +87,7 @@ test_span_gre_ttl() tc filter del dev $h3 ingress pref 77 mirror_uninstall $swp1 ingress - log_test "$what: TTL change ($tcflags)" + log_test "$what: TTL change" } test_span_gre_tun_up() @@ -98,7 +98,7 @@ test_span_gre_tun_up() RET=0 ip link set dev $tundev down - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" fail_test_span_gre_dir $tundev ip link set dev $tundev up @@ -106,7 +106,7 @@ test_span_gre_tun_up() quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress - log_test "$what: tunnel down/up ($tcflags)" + log_test "$what: tunnel down/up" } test_span_gre_egress_up() @@ -118,7 +118,7 @@ test_span_gre_egress_up() RET=0 ip link set dev $swp3 down - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" fail_test_span_gre_dir $tundev # After setting the device up, wait for neighbor to get resolved so that @@ -130,7 +130,7 @@ test_span_gre_egress_up() quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress - log_test "$what: egress down/up ($tcflags)" + log_test "$what: egress down/up" } test_span_gre_remote_ip() @@ -144,14 +144,14 @@ test_span_gre_remote_ip() RET=0 ip link set dev $tundev type $type remote $wrong_ip - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" fail_test_span_gre_dir $tundev ip link set dev $tundev type $type remote $correct_ip quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress - log_test "$what: remote address change ($tcflags)" + log_test "$what: remote address change" } test_span_gre_tun_del() @@ -165,7 +165,7 @@ test_span_gre_tun_del() RET=0 - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" quick_test_span_gre_dir $tundev ip link del dev $tundev fail_test_span_gre_dir $tundev @@ -176,11 +176,11 @@ test_span_gre_tun_del() # Recreating the tunnel doesn't reestablish mirroring, so reinstall it # and verify it works for the follow-up tests. mirror_uninstall $swp1 ingress - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" quick_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress - log_test "$what: tunnel deleted ($tcflags)" + log_test "$what: tunnel deleted" } test_span_gre_route_del() @@ -192,7 +192,7 @@ test_span_gre_route_del() RET=0 - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" quick_test_span_gre_dir $tundev ip route del $route dev $edev @@ -203,7 +203,7 @@ test_span_gre_route_del() mirror_uninstall $swp1 ingress - log_test "$what: underlay route removal ($tcflags)" + log_test "$what: underlay route removal" } test_ttl() @@ -244,30 +244,11 @@ test_route_del() test_span_gre_route_del gt6 $swp3 2001:db8:2::/64 "mirror to ip6gretap" } -test_all() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh b/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh index c7d532e6f31e..3a84f3ab5856 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_flower.sh @@ -91,7 +91,7 @@ full_test_span_gre_dir_acl() RET=0 mirror_install $swp1 $direction $tundev \ - "protocol ip flower $tcflags dst_ip $match_dip" + "protocol ip flower dst_ip $match_dip" fail_test_span_gre_dir $tundev test_span_gre_dir_acl "$tundev" "$forward_type" "$backward_type" mirror_uninstall $swp1 $direction @@ -99,7 +99,7 @@ full_test_span_gre_dir_acl() # Test lack of mirroring after ACL mirror is uninstalled. fail_test_span_gre_dir_acl "$tundev" - log_test "$direction $what ($tcflags)" + log_test "$direction $what" } test_gretap() @@ -114,30 +114,11 @@ test_ip6gretap() full_test_span_gre_dir_acl gt6 egress 0 8 192.0.2.3 "ACL mirror to ip6gretap" } -test_all() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh index f521648682bf..1e4f0887724d 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh @@ -223,7 +223,7 @@ test_lag_slave() RET=0 mirror_install $swp1 ingress gt4 \ - "proto 802.1q flower vlan_id 333 $tcflags" + "proto 802.1q flower vlan_id 333" vlan_capture_install gt4-dst "vlan_ethtype ipv4 ip_proto icmp type 8" # Move $down_dev away from the team. That will prompt change in @@ -250,7 +250,7 @@ test_lag_slave() # Wait for ${h,swp}{3,4}. setup_wait - log_test "$what ($tcflags)" + log_test "$what" } test_mirror_gretap_first() @@ -263,30 +263,11 @@ test_mirror_gretap_second() test_lag_slave $h4 $h3 "mirror to gretap: LAG second slave" } -test_all() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh index cc3a0a3f83ba..aa96644e3866 100644 --- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh @@ -47,12 +47,12 @@ full_test_span_gre_dir_ips() RET=0 - mirror_install $swp1 $direction $tundev "matchall $tcflags" + mirror_install $swp1 $direction $tundev "matchall" test_span_dir_ips "h3-$tundev" "$forward_type" \ "$backward_type" "$ip1" "$ip2" mirror_uninstall $swp1 $direction - log_test "$direction $what ($tcflags)" + log_test "$direction $what" } full_test_span_gre_dir_vlan_ips() @@ -68,7 +68,7 @@ full_test_span_gre_dir_vlan_ips() RET=0 - mirror_install $swp1 $direction $tundev "matchall $tcflags" + mirror_install $swp1 $direction $tundev "matchall" test_span_dir_ips "h3-$tundev" "$forward_type" \ "$backward_type" "$ip1" "$ip2" @@ -81,7 +81,7 @@ full_test_span_gre_dir_vlan_ips() mirror_uninstall $swp1 $direction - log_test "$direction $what ($tcflags)" + log_test "$direction $what" } quick_test_span_gre_dir() @@ -151,7 +151,7 @@ full_test_span_gre_stp_ips() RET=0 - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" quick_test_span_gre_dir_ips $tundev $ip1 $ip2 \ "$forward_type" "$backward_type" @@ -166,7 +166,7 @@ full_test_span_gre_stp_ips() mirror_uninstall $swp1 ingress - log_test "$what: STP state ($tcflags)" + log_test "$what: STP state" } full_test_span_gre_stp() diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh b/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh index 0615f9244406..2cbfbecf25c8 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh @@ -67,13 +67,13 @@ test_span_gre_neigh() RET=0 ip neigh replace dev $swp3 $addr lladdr 00:11:22:33:44:55 - mirror_install $swp1 $direction $tundev "matchall $tcflags" + mirror_install $swp1 $direction $tundev "matchall" fail_test_span_gre_dir $tundev "$forward_type" "$backward_type" ip neigh del dev $swp3 $addr quick_test_span_gre_dir $tundev "$forward_type" "$backward_type" mirror_uninstall $swp1 $direction - log_test "$direction $what: neighbor change ($tcflags)" + log_test "$direction $what: neighbor change" } test_gretap() @@ -88,30 +88,11 @@ test_ip6gretap() test_span_gre_neigh 2001:db8:2::2 gt6 egress 0 8 "mirror to ip6gretap" } -test_all() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh b/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh index 2011dad06cf4..34bc646938e3 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_nh.sh @@ -75,7 +75,7 @@ cleanup() test_gretap() { RET=0 - mirror_install $swp1 ingress gt4 "matchall $tcflags" + mirror_install $swp1 ingress gt4 "matchall" # For IPv4, test that there's no mirroring without the route directing # the traffic to tunnel remote address. Then add it and test that @@ -88,29 +88,18 @@ test_gretap() ip route del 192.0.2.130/32 via 192.0.2.162 mirror_uninstall $swp1 ingress - log_test "mirror to gre with next-hop remote ($tcflags)" + log_test "mirror to gre with next-hop remote" } test_ip6gretap() { RET=0 - mirror_install $swp1 ingress gt6 "matchall $tcflags" + mirror_install $swp1 ingress gt6 "matchall" quick_test_span_gre_dir gt6 mirror_uninstall $swp1 ingress - log_test "mirror to ip6gre with next-hop remote ($tcflags)" -} - -test_all() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress + log_test "mirror to ip6gre with next-hop remote" } trap cleanup EXIT @@ -118,14 +107,6 @@ trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_vlan.sh b/tools/testing/selftests/net/forwarding/mirror_gre_vlan.sh index 88cecdb9a861..63689928cb51 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_vlan.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_vlan.sh @@ -63,30 +63,11 @@ test_gretap() full_test_span_gre_dir gt4 egress 0 8 "mirror to gretap" } -test_all() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh index b49b70416e32..1b902cc579f6 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh @@ -153,7 +153,7 @@ test_span_gre_forbidden_cpu() RET=0 # Run the pass-test first, to prime neighbor table. - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" quick_test_span_gre_dir $tundev # Now forbid the VLAN at the bridge and see it fail. @@ -167,7 +167,7 @@ test_span_gre_forbidden_cpu() mirror_uninstall $swp1 ingress - log_test "$what: vlan forbidden at a bridge ($tcflags)" + log_test "$what: vlan forbidden at a bridge" } test_gretap_forbidden_cpu() @@ -187,7 +187,7 @@ test_span_gre_forbidden_egress() RET=0 - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" quick_test_span_gre_dir $tundev bridge vlan del dev $swp3 vid 555 @@ -202,7 +202,7 @@ test_span_gre_forbidden_egress() mirror_uninstall $swp1 ingress - log_test "$what: vlan forbidden at a bridge egress ($tcflags)" + log_test "$what: vlan forbidden at a bridge egress" } test_gretap_forbidden_egress() @@ -223,7 +223,7 @@ test_span_gre_untagged_egress() RET=0 - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" quick_test_span_gre_dir $tundev quick_test_span_vlan_dir $h3 555 "$ul_proto" @@ -246,7 +246,7 @@ test_span_gre_untagged_egress() mirror_uninstall $swp1 ingress - log_test "$what: vlan untagged at a bridge egress ($tcflags)" + log_test "$what: vlan untagged at a bridge egress" } test_gretap_untagged_egress() @@ -267,7 +267,7 @@ test_span_gre_fdb_roaming() RET=0 - mirror_install $swp1 ingress $tundev "matchall $tcflags" + mirror_install $swp1 ingress $tundev "matchall" quick_test_span_gre_dir $tundev while ((RET == 0)); do @@ -279,7 +279,7 @@ test_span_gre_fdb_roaming() if ! bridge fdb sh dev $swp2 vlan 555 master \ | grep -q $h3mac; then printf "TEST: %-60s [RETRY]\n" \ - "$what: MAC roaming ($tcflags)" + "$what: MAC roaming" # ARP or ND probably reprimed the FDB while the test # was running. We would get a spurious failure. RET=0 @@ -296,7 +296,7 @@ test_span_gre_fdb_roaming() mirror_uninstall $swp1 ingress - log_test "$what: MAC roaming ($tcflags)" + log_test "$what: MAC roaming" } test_gretap_fdb_roaming() @@ -319,30 +319,11 @@ test_ip6gretap_stp() full_test_span_gre_stp gt6 $swp3 "mirror to ip6gretap" } -test_all() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - - tests_run - - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS diff --git a/tools/testing/selftests/net/forwarding/mirror_vlan.sh b/tools/testing/selftests/net/forwarding/mirror_vlan.sh index bc3297846511..2f150a414d38 100755 --- a/tools/testing/selftests/net/forwarding/mirror_vlan.sh +++ b/tools/testing/selftests/net/forwarding/mirror_vlan.sh @@ -40,12 +40,16 @@ setup_prepare() vlan_create $h2 111 v$h2 192.0.2.18/28 bridge vlan add dev $swp2 vid 111 + + trap_install $h3 ingress } cleanup() { pre_cleanup + trap_uninstall $h3 ingress + vlan_destroy $h2 111 vlan_destroy $h1 111 vlan_destroy $h3 555 @@ -63,11 +67,11 @@ test_vlan_dir() RET=0 - mirror_install $swp1 $direction $swp3.555 "matchall $tcflags" + mirror_install $swp1 $direction $swp3.555 "matchall" test_span_dir "$h3.555" "$forward_type" "$backward_type" mirror_uninstall $swp1 $direction - log_test "$direction mirror to vlan ($tcflags)" + log_test "$direction mirror to vlan" } test_vlan() @@ -84,12 +88,12 @@ test_tagged_vlan_dir() RET=0 - mirror_install $swp1 $direction $swp3.555 "matchall $tcflags" + mirror_install $swp1 $direction $swp3.555 "matchall" do_test_span_vlan_dir_ips '>= 10' "$h3.555" 111 ip 192.0.2.17 192.0.2.18 do_test_span_vlan_dir_ips 0 "$h3.555" 555 ip 192.0.2.17 192.0.2.18 mirror_uninstall $swp1 $direction - log_test "$direction mirror tagged to vlan ($tcflags)" + log_test "$direction mirror tagged to vlan" } test_tagged_vlan() @@ -98,32 +102,11 @@ test_tagged_vlan() test_tagged_vlan_dir egress 0 8 } -test_all() -{ - slow_path_trap_install $swp1 ingress - slow_path_trap_install $swp1 egress - trap_install $h3 ingress - - tests_run - - trap_uninstall $h3 ingress - slow_path_trap_uninstall $swp1 egress - slow_path_trap_uninstall $swp1 ingress -} - trap cleanup EXIT setup_prepare setup_wait -tcflags="skip_hw" -test_all - -if ! tc_offload_check; then - echo "WARN: Could not test offloaded functionality" -else - tcflags="skip_sw" - test_all -fi +tests_run exit $EXIT_STATUS From patchwork Thu Jun 27 14:48:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13714521 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2041.outbound.protection.outlook.com [40.107.243.41]) (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 41F6E199240; Thu, 27 Jun 2024 14:50:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499835; cv=fail; b=H9hllQJE8yfoxXI1pMSa0Us1S0ulTa29/NzUMZRV5cuLqR+kM1O6vUrKvJnpnl5zN9kCb88Skmy96fim5bvL6LaWmWgaT1ug1rO3y8swhRlesLwnXMGkkBYciDQue0dM0tZCAbQMod1uaSLsNn5q0uGa7VrXHU8GPYgKS9fV9zY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499835; c=relaxed/simple; bh=6AScj6W+fnSZEJFWnrMEwtgF29LpByLPRMcn0e8QKbI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gyGwAshvNLOyQmYIflUYqBdCdZ7fWvQuYib8sQzD0nOL7h12aAuQ9s+mTxyw1kQqyaHCJ2iXxuVbjCsPFJaT8xkzKzZLATz1D3Fp2wCohsDzazLraDRFyHIIaree2wh3m61beIj6iYuah1z/HKr9Rlh08ajTLCx3mQCk05rAAH8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=sF8hLz0P; arc=fail smtp.client-ip=40.107.243.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="sF8hLz0P" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yezexam3KTejNJSiilHWHbEYSWBsvfkjslV7QF6cZfNSSQp/4EprdN4mvvg1JJkGXy/nedS5TVB0NgJUN8NIxBgWjThPcFN0rYOXn2crN8UJabkcSNiRUgPURo5cI8skvOdytNOY7cinzpzKuL2DWgPyIM7uj/H+GSk4o0q91vKKiAFU423mpJmhsNNi7dVqW5Yr+wT8la2l0fvzl7cN0yAmvlq72E3vNxHJjCnUM9SAaBGjOCDAvUsyoMFo5hlPZXUx3zQslWO8lHTVjUh8uo5qpE44Ze6MOfsPnvXH4HB+MwKG91rk1vDyBI4w3DezfIwFIsG+W58JSSyNed5jag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kNRvR5Iv7INnN/fS8zZ0uOIGcQ414ESGwBYcW/MQ2lg=; b=By/gORN6UpbRrryudWwJORVY2pJ3QCVBFgLplK1oK4q7SVfB2lHW+h4veIwEy1rBJpD8r1zu6DnqNiu52QcoZfETssjwIK373DVKiloaugIZCGgF8MFjDSYLD+ukC8S7vODbJtHM+ITPcdo+XxcsTkmLxZtmEDiO64EQxnwPBxNt2RZBNX266m5iobBQm2GSRrZm8S6ybE21mxrS14RSksR0n4rMR24DtHMYCklK0wFIzSpj9v34UnfW9JOk+dD1V5KaMbKLT5eqqwyHk4CiBryurD/V/A9yvcaTXHooDtOFVTt/VBM2oAY2gfJky26Y/+k4nESv4Aqjq0Bkg9BdFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kNRvR5Iv7INnN/fS8zZ0uOIGcQ414ESGwBYcW/MQ2lg=; b=sF8hLz0PMmHlu5oCYIvbMBNP8RZYYncf74LsRBEEWPQAIdUfYrbNwstSI3I6QiP6mjMmPny1vdkp8twbP1K1isDyovvfiXLyP0besb6H4sveZnmMQ1kDFCdbY+vBSgHkH3yboM8+xRWd+hmYdzlIZKnXPPl9l7fUt+rTIPXuxlY8VALLsPUMSX3oj9lykvwhcnQh7f90UTEAbTZNxgTBi/UwrXL2QPNzh8ca6c7+BWCsQLtZ/jjmtvPJNNQfSK5G1HzRsrJFasL8kLmAq/6Y9Phvf0DDGd6ZhLVz6ce6Nj5/QES4G+U6ndDZ8OY4+vuDWIxxeu5Q62p5m9lv5b3vJA== Received: from CH0PR03CA0112.namprd03.prod.outlook.com (2603:10b6:610:cd::27) by CH2PR12MB4070.namprd12.prod.outlook.com (2603:10b6:610:ae::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.33; Thu, 27 Jun 2024 14:50:31 +0000 Received: from DS3PEPF000099E1.namprd04.prod.outlook.com (2603:10b6:610:cd:cafe::2a) by CH0PR03CA0112.outlook.office365.com (2603:10b6:610:cd::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.26 via Frontend Transport; Thu, 27 Jun 2024 14:50:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS3PEPF000099E1.mail.protection.outlook.com (10.167.17.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 14:50:31 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:11 -0700 Received: from yaviefel.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:06 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Danielle Ratson , Petr Machata , Ido Schimmel , Hangbin Liu , Benjamin Poirier , Shuah Khan , , Simon Horman , Subject: [PATCH net-next 08/12] selftests: mlxsw: mirror_gre: Simplify Date: Thu, 27 Jun 2024 16:48:45 +0200 Message-ID: <218b4ba7961a0f26e1dcadf0a8eb93468542552a.1719497773.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099E1:EE_|CH2PR12MB4070:EE_ X-MS-Office365-Filtering-Correlation-Id: ada6a732-830d-4247-7f70-08dc96b87e13 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: 2rE6mCMvI3+J+ZzXA4k0lgfkexts2qcBuBvCeegBUXs+9S15zeev7P2FFZwME5mEDcI/YquB3RulwHJwx39+i4oSKXj5NwEXZkV4LW53bw5qJWE+TjJ31icvRJBil6B/QixT8Oa/y1U/azTTZ+twTFJFXaRVCkD53nypRn35Pc0Csn0b4OguurlKvV9H2j56OwSIHfhgOgXRW9KpWAr6tZyYaAD18dXT7AZ7HgkaAbL0QIQfk7hNV0cYtIurOIpAhF6pbkUu4Gd7Do8YoVczxrhU2aOfIjPYxOM2bAymOtrb/7rYaI64SKUx2XqK5Bc9np7kR5YObV/jkwiLE+xk2U3vQhvWHcKrUvnEv/OpVGD0itJnAKb42/coY8AjYUKIcwcG22g5J/AWlfpJsHvanEEGT99XA8JTKGxFR2lKivpLNbiGIuN/P7lQWKw59XNhJgS/+kLlWFfE3z2cWcmenbqpscT1neDae0PtmoxBupLQHuuSv4x+ea66j0AIR93ULBDjPdwe/9mZEusnT4nmAV8nMYKXKv8R0mcYZqZWLqtoru+wOgUE54AcjSo5h+wG56Z/4DOmjkNUVyR7zTPbQEREFekt6MNrQYk67vl8D87+oXo13pPGsMmrMA85/K86Eoc8PimM/fso19Yjn6fOUwtMq33Al84fe5GS2bRaApPwYoVf/DX67HAQXLpR4JFGfzXIcn++qwlEMFlbVfpA7TwLALPg3h/uQqjw4lFgP+XZO7k/53GGKuFCVXqg8HYAsl1pB1pAGDHsDhZzNjoYq3hFIuHFG+SDT/vqeabrAtnj84zscL8/NhyhHtnt9nhF+Aiu043NIicctFF/GB5nBRZj6kNDmIrEV1brMyPS3mIxtI+LZsEol7GrQyjxW97AWwUrC6DBYen/oLUR6zkbqIPuzAaJ6jgvpIDMtPJDj8k9aE0LFAprn+SzD/ajXRWm4idUvfE/m3wqxcCRSEUstQ4On9dPHnj0bDws0XPsFPKwseEPBc3tIT3eyAB0pDn1ZWEUJXKxmqjxkkPox3jCvs6tVRVRhpDFj7xo3kkkfk3fvR1Ue0vrBQj72vXbK7lVdWgAgwT+ZeTAKcn8auGo2gd2KCDwLwnRWHH7FNDSc9qjKurbLGngD/ZiG/bxkAOExnBweQS30JeroCK1Ea+aTs8XNV8QPHJ7GOFxGNFDPhBrA/DxnJhm81oOKaUUUeR27e4ZzmoKmceZl6EATK6NCmeby5/rm2vpxwMAjsKTtaEb7THTHzOxCOiXlbwK/0pbzvPxYRPGlcuQZfyIKRAfXULYupa8V50wJFTtpxoyS2sLhWhYnmsabt3HsDhcDQ05nGOYHfqZJCd/+n1zI62vYKNobS1GrdStOOgF88RcZpc58JtPmnQwMqR+tiB2CV8ShwXwzg3HU96pUCIzRaL69QhKAfjyblHzAnMTqQt3nak8M+sGVSd0yaCw3GQ4JwGE X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 14:50:31.1404 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ada6a732-830d-4247-7f70-08dc96b87e13 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099E1.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4070 After the previous patch, the function test_span_failable() is always called with should_fail=1. Drop the argument and streamline the code. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- .../selftests/drivers/net/mlxsw/mirror_gre.sh | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh b/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh index 8cf06fcd724c..b9326baeb43e 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh @@ -150,34 +150,27 @@ test_span_gre_tos_fixed() test_span_failable() { - local should_fail=$1; shift local tundev=$1; shift local what=$1; shift RET=0 mirror_install $swp1 ingress $tundev "matchall" - if ((should_fail)); then - fail_test_span_gre_dir $tundev - else - quick_test_span_gre_dir $tundev - fi + fail_test_span_gre_dir $tundev mirror_uninstall $swp1 ingress - log_test "$what: should_fail=$should_fail" + log_test "fail $what" } test_failable() { - local should_fail=$1; shift - - test_span_failable $should_fail gt6-key "mirror to keyful gretap" - test_span_failable $should_fail gt6-soft "mirror to gretap w/ soft underlay" + test_span_failable gt6-key "mirror to keyful gretap" + test_span_failable gt6-soft "mirror to gretap w/ soft underlay" } test_hw() { - test_failable 1 + test_failable test_span_gre_tos_fixed gt4 gretap "mirror to gretap" test_span_gre_tos_fixed gt6 ip6gretap "mirror to ip6gretap" From patchwork Thu Jun 27 14:48:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13714523 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2085.outbound.protection.outlook.com [40.107.95.85]) (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 E6CE4198A1A; Thu, 27 Jun 2024 14:50:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.85 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499848; cv=fail; b=ExFL6MfWQj35o8EkqXkZ1LqKNLyt3Rb/L6tAEpolsIBbyqWqrkTB9AYDdoCC55m9CGbBzjy5nTkLKLjywu0n2nTgN7imIe9Q1oo1UX2+kt/2DX471KeH20fAINmc/sJTtQAJkKJm+jxO9zEJhjB6Wq/MhREXIH8VQwSizYF2Aro= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499848; c=relaxed/simple; bh=95QWJggfc1+MVRJg2bprzXGymzj+FlxgRnERcaWZaB0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qBrotBPler9FEQ/QxB7yfoxlyCKTyGQYzwmv7hDKGWhl/v3m6qyZGutTgLEudvbvjMcx1xNFM2v5ahJGVTbccozMKfnNKPsUn4lhX/AkkCVOcY/mHQh5vV1tIWISf7mLqENEnJwX0Fu86NQaa6Rqvm39nY0vxNMpPgJHJyZBHpo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=gC3eTjTo; arc=fail smtp.client-ip=40.107.95.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="gC3eTjTo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RANPbZxdt44TeiYdtpOdX0hH606mpKNfGLmHTZo45lhBJICa/oIZvYIj2su7WlEKwAAeSqOEB2plNm589/4q6M2UcpvPzQbJOv+jTXQiZpM1OSHol99I3InCghcHdX2x3uxxcA1v06SvlmXksU3RolATOSJPLLu8TFEYN71t+VQoZaMh2DDfNTVEke1e910dw8vMTVda9XtGqZPnIbMB76h4v3zBePY139ISHeg8e9PVbnSGIFondABJ/MuDn8EH0NWZ3wDkOMYfFjFrY+cDt3kD1pfnqmwxZnRHBkQ8oZp1oD87UrzDAi7lOQg4gyg39BPsnuK1AF3fE48osgkFnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=v0714QI4kdTfxP4nDjNXsrBm81ba4vXmDfC3Tb0tH8g=; b=NfeLmafxlLci5BC23B7xVSBHaaWTz6SoN3OZzHXlYtoSCFrAu6DaQoj8hXnFBtDufaLoMtzMRnBX52re5XQ4b2YcY5hCAq/kQlXBdNW3INNE2YQwaOQfowSu9X54Kv+6KPyi4NSTM6TjxyxOICraZ6gBx1z/DAxGLAL21HBbYXI+iYq53RZVtqRIYGttoxIezv4AvqtWeO2sMSL7m1fR7hnBVoiPr+YGlUD0+0tWv8fmcb09hngHGrgWaleDqI0ack6ahndk4qpn32x/4twGwpmJDcCB0XQIkw/QaTgBLjBuUrMNfJy3Dth4VhvfdQ2+so2V8x5q7obghb5qNUGi5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v0714QI4kdTfxP4nDjNXsrBm81ba4vXmDfC3Tb0tH8g=; b=gC3eTjTowaz9cWnV6BWgtjxIOWrraFLMtW1UqTOUAxsFatmoqJP4TKn0XAWmViAy+NuQ/cSe+4IVyttDRTo1fzCp9sDN1E2EeoMu3whyY0lvknIqQw6jpyknGIJyQ1pdTU2SD8iYwdyJBd+XfTqVTrSf8cCaq74V3zeo9rbVBkj0WkllF/OF8mySvNEKQDzSZuIStL/OjYKGca3W440p6RtKjMjrKrhmj95odhfbCQBgUZNyQrNij8w3IpYXPRx7o1TqZEpTYvHIboANrO+YDKsyZvFlGs+L4YZqenPO7pG5bpEcounNaXMlxVNzEekHdP8txxVafmkuWqxwAC4oCQ== Received: from CH2PR07CA0013.namprd07.prod.outlook.com (2603:10b6:610:20::26) by CH2PR12MB4213.namprd12.prod.outlook.com (2603:10b6:610:a4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.37; Thu, 27 Jun 2024 14:50:37 +0000 Received: from DS3PEPF000099E2.namprd04.prod.outlook.com (2603:10b6:610:20:cafe::52) by CH2PR07CA0013.outlook.office365.com (2603:10b6:610:20::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.26 via Frontend Transport; Thu, 27 Jun 2024 14:50:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DS3PEPF000099E2.mail.protection.outlook.com (10.167.17.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 14:50:37 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:17 -0700 Received: from yaviefel.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:12 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Danielle Ratson , Petr Machata , Ido Schimmel , Hangbin Liu , Benjamin Poirier , Shuah Khan , , Simon Horman , Subject: [PATCH net-next 09/12] selftests: mirror_gre_lag_lacp: Drop unnecessary code Date: Thu, 27 Jun 2024 16:48:46 +0200 Message-ID: <9779daebb3b84320e5fa7c767ce9a2bf51e18a42.1719497773.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099E2:EE_|CH2PR12MB4213:EE_ X-MS-Office365-Filtering-Correlation-Id: 97aa578b-e764-4677-32b7-08dc96b88198 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: Qp79hMkDSIqRxEeq9CxKDanN/AKsni76CKFEa3HIxORPg4vTGMnu2FJwZuMTFjUzAEcrgtCBR8PyA/ILb6ZlEajbv97pf6l9KmOnOH0ptBG1yo9Gd80s/vTXGWL+V6y1LDHQb0CpeD4bUe4LAgY665sur4gn+2f992wj1kiM7ua8qmhTfFRU3h1JZBB10Uh0LUI3TqMu7iiVZIbTQtJU1kB5849AYuXceciseYl2OvIwqZef890NLyH4qHQ7PHVEati+9jILmVgJ4frHTFCdEdLJNf/9SbXOHMlz4zepRXph5JrnsEAsgn29wIPWJBpah3HwnSvkNOVR4lM6CVEQMWpGG/rHbsYXjKLS4nfvpFfoJxEDOdcFEAYtgsV84zUC5aHyxDmz14iu1muUUffa7L3cRPkA/yqlQzC5rSxFIbLtl4tm/7L+2xbwerXH7dk9zOTfRRyynXZ74Q/8PJo0VzHLkgsvpSmxu1FIgK0sdhgFeS4sIMle40GYH7acxzULxKzxgOut8ISwQziltktZCzrzeo70hLGMR/Dvp+AtqELp6d8GqFNxY/9wEbmh7rC9miygA2BW+sv26zHeLFO5pMrOwDcwM4C25eBvS9bquBzlyDbQ4tsARFCaOGLXZXm2XeRNkRCyPHjf/dhXxDN4eUOWe5grNMUJM5myuQQtcQ71cVVq1bhX/CAjEYg2YwwtUVB0+cMR7fefO9G59IcXAu/YmtOCmHGMU0NhbFoEGLU7U1U6jXw+GT/XgjV4+9Ywr+ameWgTOCtGlYlbLkaRAARR7P1ZocMUNYUIX0yp60IPMtPaonuue8WJtSxqnQ+dp/xmJtf4eOZjLfMZ628yV1KGOqBEeB3AZ2WWoqUZuh93Q8hvUlzofYEpDInXstkv8IEdkUrgbgdOS07qqC4RUvB0jGkMneSFxkonGHnq+LV92kCKSDqVRfaSQ0n68p8/Tw7+mg9XlCM3iU2TvilGBBICogj9x/3RV1R3M1rFIiTW6RC/DH5q1IWBCnxvIf2uFsM5id15IjNgQkHKyS+zDUc/q8ZzA4nGSuxVxN4SrAAYzN1cTMVwYG2VvPV9wGjX4Nt8qUFcdzjwX39l1I1KCArxK201IQZJ7vrEFoNibNVV92jdTHmNwTOnC1xJh1K26C0/t2p6mGppannJ0xsTubFIQYYDCbQuZsc3U1O5wKpmz0Rd/TgEGbLMnpVIBdTIosqGawApEgC2gowRgxRITbRzENPypRAVrQwnh83kkg2jM7RCSJnoDaKnTXRxeuvJjStQq7aBpKIKneBc6pVhwOc2aWhPeWIWWSfrgkXKu47urp3/UxHSBksn7n/2NY8i11UcrnkANPjCjtOeuls1xPevYBKnZJZJX7/mOIvxXiHHS4Ztm1Vo08zKzgO3tQm/WJ1A0PoIYhSNB9gZdJwgq8M8C2IgBgsdti+Qkwjzfa5EFEVtUpzsykVsqKrDr7Yl X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 14:50:37.0589 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97aa578b-e764-4677-32b7-08dc96b88198 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099E2.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4213 The selftest does not use functions from mirror_gre_lib, ditch the import. It does not use arping either, so drop the require_command as well. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh index 1e4f0887724d..1261e6f46e34 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh @@ -56,9 +56,6 @@ ALL_TESTS=" NUM_NETIFS=6 source lib.sh source mirror_lib.sh -source mirror_gre_lib.sh - -require_command $ARPING vlan_host_create() { From patchwork Thu Jun 27 14:48:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13714522 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2083.outbound.protection.outlook.com [40.107.244.83]) (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 4D50B198A1A; Thu, 27 Jun 2024 14:50:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499843; cv=fail; b=qvBGNCxzrG28ZMDfTjoBu5D+7gFXgMTRu9szWw7H7EyZKemauWkoC8m+vwsWmfqbh2upqOrmX3LL0ham9pAqN+AIrDf7P/zh8WwwIyvYW1lKNOXrFO3BqGtpkvkVythNSPc9IxgdKDxA4piSZ/aD1I6H039MN6bg4sg9OL+nH0o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499843; c=relaxed/simple; bh=XdSwYFx6Zj63miu+x2NoH5DKXPAPvSTUoiRk+Qg4Tqc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cu4Tr2ZaCyCiF3gVjOCe/97PbQ6qi0BLBTCj9/aCLMEFRQWHtNXRIXNDqWW4P5nixtiIIuON4XVh9adXZf4drJOQTx08y8Oxpf2ftDzOIA9Zt2khfIBwsOQpzyTFdU1inrnCBpsA7H2etZcH/txRGF7foL70aCWB8quUMCdsgNQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=pPIvX5hg; arc=fail smtp.client-ip=40.107.244.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="pPIvX5hg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JpGZoagByPiKLXvurhiijyfPSpeVy9OV9okBO8cUMVYmIgtYfPCv9WOUrXhFbpD5Lwwmja6dOU+EinG4AeJ8ofKW5oT444xCfaFOkqjMLX1ZIfGv9goJqVPIYT8nkZkhXgmqVm0ktx5Xl+jw9quCUmU7GilePdCOrHuAYbzzPAf9H7fWCvbZdk1EDGePj3mhyECCeOSjUkNd8tbHNYoyj2RSWwLve9u6tU8fPk8mdvKi/T15AmasmWtj3I7qVB8VaaSxhJAClwW3Jj8fg5PPLWgi+9/chLAJtnO8XDE0+4vC6qN9Nmw6Ji81XLkJ2IzUGczvs7G8jcujg/BMPmZ8Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5sCvBz6sOlEF3baMVIn++BDjoVMVRxM1yAIlgQ8lGLk=; b=ArSwGcZ7LLxJw+mU934VRf3XUlshaUgyON8omhff5T/TN8sDk/qYQcRgM5d1+D9mTF6N2+0HD06nfRxkgOdirgBF50y1ADUEY4kyMRpLCBJuxp3ezej1598r4zoRtJ1aRF2vWzNBYvOzSEUR8kJXtgTHwcBBtlL0wdNKNLVdn8qXAA5xe1yS/A5CUo2VBid+asVikCebXG25tjeIQhQXzegLhSwOFa+BWUftzvTHLCzvuFDLm7OrLHIyHy95OTaE1kbPlkI4Z6kyDAr0XprcW8Az+t4rnPZQEsNPdPcFTrI10c2+jjqMrW/IMDZPhpqnsb2yJYWvopPI6zu/BHqNwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5sCvBz6sOlEF3baMVIn++BDjoVMVRxM1yAIlgQ8lGLk=; b=pPIvX5hgmgYvn4QlFMSRVBI6TH+vhPzZoVRH1D1wpSd1H4Rem+Zjt0GMWAykHc0CENT3brbD9afLCPnZWw3j3aUjBmzGRMniWcOX++1iVrXm+zTQj6t7WGqusLSc05NBDpZcBpHR2/HhETFxNyMbWDTg4mVMdl92hbKZMUdIYsOBZnMOOsvMVAIyOOfir4oG7gugrsN+52KVxXsBIjTPlPYABeHUpqUaob8dVHoDmIwcQuVAaSZan5kQRkj5vYxcBYfOT6G9q/5kcyLNAGAYyK021lVMnOEDDVlHebhIFlXXDRy9uxZvbM4ElwxfYb/SMKP/1U0Bg9i90TLpPKR3QQ== Received: from BYAPR02CA0071.namprd02.prod.outlook.com (2603:10b6:a03:54::48) by BL1PR12MB5708.namprd12.prod.outlook.com (2603:10b6:208:387::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.28; Thu, 27 Jun 2024 14:50:38 +0000 Received: from SJ1PEPF00002314.namprd03.prod.outlook.com (2603:10b6:a03:54:cafe::95) by BYAPR02CA0071.outlook.office365.com (2603:10b6:a03:54::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.25 via Frontend Transport; Thu, 27 Jun 2024 14:50:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002314.mail.protection.outlook.com (10.167.242.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 14:50:38 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:23 -0700 Received: from yaviefel.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:17 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Danielle Ratson , Petr Machata , Ido Schimmel , Hangbin Liu , Benjamin Poirier , Shuah Khan , , Simon Horman , Subject: [PATCH net-next 10/12] selftests: libs: Drop slow_path_trap_install()/_uninstall() Date: Thu, 27 Jun 2024 16:48:47 +0200 Message-ID: <914df583a21daadc04ba8fc9dccc45de3435bcf9.1719497773.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002314:EE_|BL1PR12MB5708:EE_ X-MS-Office365-Filtering-Correlation-Id: 84d0ab74-ecaa-4ab4-ab8c-08dc96b8821d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: 3JUm/RAr6LBFgPQmfaKZRVABRMpEG451kf0kFsr2zbm4NRGs+f2aZ6rcB+NpicuR5pMLMp9+Uh/74+LOOQ9sdIWBRQm9r+louaIZ/zIngFjnbx6B3MXnZHOngG5M6QUFEDUa5k3cyZQJNuLLZMa5kOqU/v4rIS2NWc2T4nbqR8mc0BqLB08kD269IyoqhErXqvL2WRcjq3uIjRHxah5kzXVJn1ntVjGI86e5kFLXFc5c/M3Y0MHvW1l409ENSXn/0F5Cs03rA/kt79WE941WLB6bWPbX4Bu4sBwO8vc/hxj30hihP6AKVgxqo8mvse/YUVmJ8Dfhj3ft0ejV7baKYrBRQ6YWWy15aoKDohg1d48dhr0/EgiVBtkRT0zQOghRIf4ebZMwW0IV7AaL6tIlcLzMxMv1RAA0Qz9CffsA3MXygOl/Kxnooc6CnTrmoBELmliX257cVjIys/EPeXZvkuvhyFJKu0ZuBMVJ9g9HVPGm4CUIElq2EtHYovZmhDl4JCKpTfGCs/QN0WucMTh3jrwACHiK/DJsdw+0E78i0eSdFDoh49jXqxe42vwl3gWfyAsVoyZn21GvuQ2Pk4gT5Q7TfY/N4vLr9+M6CMTrKEiuTz58xLQ9atXXAKOkbS7+slisd2rcVUcEJ1KF/1HwmBA13yXutG3lfnti728j6nT4giSIevaQT9WSU1yI76PKiA4tT/Z3iNAnC/CtuGi43cd0YZPy+LriVVak36MwrJDSrCzpMsnW5e5yjVxsRq3sxcVPH+V1o0X823kgaLTG6ee2b4KlWQC4PaymEjh9BLXDXwqdf+eg4Gn28PIs4w3OcdcMAQqOPNyYhF4RPysHQkj2cihptShxsptt5hzKrcwAOyFTZqCbyrNUhsucQ5XUJ50fjqplxrxOhd7inyePMZy4SQPxiyX1+k8GZQFaiWUGFyRlPn97TgkS9ovE69YUXVfN9pVWDSygtDhqZw4JlHqqZ2iskKHZnM234bnfnAxyIaeqdbu6/LfbUFZXxUN/9toHxyN18jY5/O5uhkHJpd9trXPC7S66n8s5jyosMnLLlvg13mLwoV2/KkwkKffcn/ko7fK90I6F5k9TWhh4CTLkMFDs7SkglukkLiGf86YoqQlstoNOGgNy4BsBE5rpKmyYWdybl8nbppVOa8yDtqT7eOxsuP/VX4TeK1rb8JHBRMVGOxrEn85cJPxCAfE4DBqaNKsw6R4zoaTrWunoLZWybz+oT2OBEPS701S9/fNaUWqAoRCBQj9m/M8KJwJDcY5jrM5LY2GGTDe6MgrpWY6IsJUNM6EBO2x8gSwU8NOkugNsIOKNcieCYgCRQN2lb8TNS42Kq1VYDLG0jRgIwA4H2W3K4/5zaVg4us+ihHJOA43v+x6urbFiyjVrcHekhy/Nl6ya5sSxa09f740bbumsP56B69QgO3H3iQC+Vb9HtpvQAxPzn/rnkJvpaSBH X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 14:50:38.0742 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84d0ab74-ecaa-4ab4-ab8c-08dc96b8821d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002314.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5708 These functions are not used anymore. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- tools/testing/selftests/net/forwarding/lib.sh | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index df7cacb29160..ff96bb7535ff 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -1225,22 +1225,6 @@ trap_uninstall() tc filter del dev $dev $direction pref 1 flower } -slow_path_trap_install() -{ - # For slow-path testing, we need to install a trap to get to - # slow path the packets that would otherwise be switched in HW. - if [ "${tcflags/skip_hw}" != "$tcflags" ]; then - trap_install "$@" - fi -} - -slow_path_trap_uninstall() -{ - if [ "${tcflags/skip_hw}" != "$tcflags" ]; then - trap_uninstall "$@" - fi -} - __icmp_capture_add_del() { local add_del=$1; shift From patchwork Thu Jun 27 14:48:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13714524 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2086.outbound.protection.outlook.com [40.107.220.86]) (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 C7D8A198E79; Thu, 27 Jun 2024 14:50:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499851; cv=fail; b=nEax1coVggUGgzwpHRc31EqcYjWQh15BuyXKiOrfvFH8mHw1jhbdPj4I3yfUI25LTxrjqHFAymO8AlTMuxCpGMZuQGTQeTeFPxQWP2/9L7DH7IIi+PXCet+r4yJaNop5W1mub7REA6Bn8jy//oE+uTCvfrEUVi4+fW+ZKLxBonA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499851; c=relaxed/simple; bh=2L3xI1/Gu8A6m4KIPrTfZVISpxMkYWfbihh60wwVf78=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CsWSplu5l7qYxaREnbWGncWro1hMHKr05G9TTutxVuvJYmA0hZtTOSuG+hC1clU1rK3yKGjf6dgigY63pdw+W0rgsssPtO7pimY9kUC4+lhvApUoQA/SRZ/4wdaVMIw4GaAb8BuuN6+rDVIsWoWvtpurGzzvmrI+bRl7FuGp2aQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=ctVMS7ic; arc=fail smtp.client-ip=40.107.220.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="ctVMS7ic" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X6/i+weRDRYm+wB5jNkH3PIqo6S/+8EsUMqNmeautV59EWYIPDRDYTcOWWq8j4JVL8CrfxmqdZqzxNZ4dXxLqG49uqqHYbC60TPpQC1gpI+cCc9K0wIDMPiZfzZe1NBtYuvk/ID+BW1AQJNxVPWBernZhKYMQ73ZxfOjzbqnXLbVKkWphpciyLmssDnYXXNjiV3Ck6dC0Ukr+V+dbWQYMRbNn7LHAzxwgsfxxJ30GIGsjFi34razZyLRoNr0vQYVeAom6lWYQZT4hWNibFUnUg/zsa4iT7eRFLhErWnyNjl75MGgISy2vGD6JBU8+/PG2w2QnptbHhy6ceHw9Vl6Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KYl1+mCsJjcZehIbzlkMWmZmxE958q7n/tYNYtPRSL8=; b=aJ/cBInraZAfJa1xToyKoXdQQTr9cUe1H1faAVe0o8Tw5viZW1zNxTAqXAPmQwjzIVFFELYCgPHsO2oj3ZtmB7zmRp5g6XIqQKmXn8+oVG2Jm9bbTayw71piXNcA5e/R+VzSWiUdQdX9jN7ft1tQR6iEfa6cZKJssZ0s/pXpLDJZvG4L8QFTwfGz3Vy6FiTPzixpZDdMIyQAaUx37gcj00X4Kg6Avt2eiKIM4XFzLP3kEqbk4V2tminDJsNjlbQg4IQztyTDtoiWVBaipETtruvTX2NFscbKD95mjN+e5UZ2OXbR2R6bIk8RB5+iCGKkcTzBvExL/TUtBkXchxesug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KYl1+mCsJjcZehIbzlkMWmZmxE958q7n/tYNYtPRSL8=; b=ctVMS7icMMvW4jUWiK2hzYwut0zeSCk/Np4yTeqfY8Ga1c6ZeZ0KxKhUAeSEKOTE39MvGK2OdPuw2yJTVf5K/mTwmSJL7MCC3qSJkkp8bUqqQ4t/YNxPHk2rtfqbua6pgJlylNdGFM5mToONBsX+lq7z3v7E22DV4qgk8u8nn4aajqAYgappkJPgJIX1ooiTsuQNokDOZyc21YmdUaMmibyoaxCpUGTS4sZ5J6TPVyDwU6R2BDaFxFotDZGjor9NePcnlDEePyn7PDtcTbNWxVL2tSXqPZ6xq2rcgu26o8Qz2OW3EQjtWsNlbUI9C3ElxgRptwQVuayMhh6gglPGqQ== Received: from BYAPR02CA0050.namprd02.prod.outlook.com (2603:10b6:a03:54::27) by CH2PR12MB4119.namprd12.prod.outlook.com (2603:10b6:610:aa::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Thu, 27 Jun 2024 14:50:46 +0000 Received: from SJ1PEPF00002314.namprd03.prod.outlook.com (2603:10b6:a03:54:cafe::26) by BYAPR02CA0050.outlook.office365.com (2603:10b6:a03:54::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.26 via Frontend Transport; Thu, 27 Jun 2024 14:50:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002314.mail.protection.outlook.com (10.167.242.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 14:50:46 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:29 -0700 Received: from yaviefel.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:23 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Danielle Ratson , Petr Machata , Ido Schimmel , Hangbin Liu , Benjamin Poirier , Shuah Khan , , Simon Horman , Subject: [PATCH net-next 11/12] selftests: libs: Drop unused functions Date: Thu, 27 Jun 2024 16:48:48 +0200 Message-ID: X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002314:EE_|CH2PR12MB4119:EE_ X-MS-Office365-Filtering-Correlation-Id: 88a8e1ee-9faf-4270-ecb7-08dc96b88729 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: xLtqLsSsFEwtzddWBJ+DVov4yro9dj20rSY67UhbMW7c76hoqtpYE5oMFnqOB/CtufRZNu+iFhnDMczGnRcU9a9tUbmAIs4CkmoiAbUQ+ygkMX6MznyS1toHOz8X1fH5hX9T8W0VgMTBp3q5NQ7ZMBYL80eIqU1pac71RddRN4EOSE5Qi1QAYDdEAl4BU/NOkMRZNkZ0GlYxutva7Qcg0z0Vn95h0DcLw2/Oc9TjsxOXaX9VPQdCZrotKdWDYkQe5gd3BwqHNXTKNSMcsR45O6ewo8Fi36NFuss2Chj0OM6IWbzMb2+rGoL0b71ScLH21ncGu4oagF7i6MRCGALaBhJfkRkd6eJt6yc0Aflf5g7i3JvQbDi9BxKfUeHBftRGkikuTZDBDw7IqAG2+65hFQF+Ho2eT1242xb5wxk6dSIY16qn9176QPjB8IOIf7arFkO+a+kr2f7gE+0ZZ0bVzhlImLnQ/z4VUOZwbk0M/7an4CnCXaBQmS2QgV0UlRXa9Xt30KgwBkK3srNZiG0dQq1y+C0y8cF2/peMju8zrFPXEYjZCKskOLm3PCEN17cDVKcuxm9wVPO2az/s5YVy1EFuO0vU87yf2+ylqiNQz3JS1ZUeOfD1sUiMO14lPOHSlWToCDn7qkL5Kp2tNZSvguc+SJslFLOqIoRykQRc7ncUFdnKcAfsAIR19I8cyEAclf6jSeMdi10yy3vbWrf2MRXX6vVLFqsWd5mhRsZqviYvWa0GylsWA6fPc9fUcazkVl1/uisDTyee0m/UenY0x8BFO4Bk3L6llP6y6i+XNLLUevryO5XoyJPcTrhYBgfKZSClYJw9AAKRtxwEl7RUtBGRRf29ZsxpBOr1wFkRsMXysJ9MR2RZpukHDoOr2z+wk3ufBW+WassgFp/bgbTsMf8fm9A7RT/GYHp1b4g9sPvSyMNoPvGmZOc4fKyBjowXD+QmyO/hknBb9VmFfgl24WR9z0GGoV+qPVomqSx+jjLCsnzw1idpl75EQYJh/rvIMAO/GP4pxzv9p/SsEgHizqRUgmGM9rOetYKjXKj9EcVgBCZ1ufnLQkTHtxyGs7gQEJid7qRO1ILRqfzUjKYB7EAYDedbz97yCZGktdoCOI1hjgD8bL16MZ1ptNOWGKWDIC0apevWf2rd6PdnJYsiXxdJx/s6oO83cMXf55VRUvVJwQRYehJFi00Cz9DReyq7gAQQEEqyUJMwTLvkAtPA0mDEhiK7JJ5zbtlBjv4kHp8IjUDlaR+RpkYamdMi+ZA91mCyK36bwGcyTplvaXfFOg/KtbUsXIwIG6LU7GY/GWQ3BnYiBOyaux4nXlfTsSrZlISImqafeOe3KsX32IaQBDv3pYtaYkIczULSpveTECsoqmxyz/wZojvsIMCMlggZNzULyqVUrL/PpwR5BxqNk9mVC0/36b3fF44l2j5ZZI9BbuCGsRbssXH3gP21DA4h X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 14:50:46.5432 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88a8e1ee-9faf-4270-ecb7-08dc96b88729 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002314.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4119 Nothing calls these. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- .../selftests/net/forwarding/mirror_gre_lib.sh | 11 ----------- .../selftests/net/forwarding/mirror_lib.sh | 18 ------------------ 2 files changed, 29 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh index aa96644e3866..20078cc55f24 100644 --- a/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_lib.sh @@ -101,17 +101,6 @@ fail_test_span_gre_dir() fail_test_span_gre_dir_ips "$tundev" 192.0.2.1 192.0.2.2 } -test_span_gre_dir() -{ - local tundev=$1; shift - local direction=$1; shift - local forward_type=$1; shift - local backward_type=$1; shift - - test_span_gre_dir_ips "$tundev" "$direction" "$forward_type" \ - "$backward_type" 192.0.2.1 192.0.2.2 -} - full_test_span_gre_dir() { local tundev=$1; shift diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh index 1fc8545da6e0..6bf9d5ae933c 100644 --- a/tools/testing/selftests/net/forwarding/mirror_lib.sh +++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh @@ -88,16 +88,6 @@ quick_test_span_dir_ips() "$forward_type" "$backward_type" } -fail_test_span_dir_ips() -{ - local dev=$1; shift - local direction=$1; shift - local ip1=$1; shift - local ip2=$1; shift - - do_test_span_dir_ips 0 "$dev" "$direction" "$ip1" "$ip2" -} - test_span_dir_ips() { local dev=$1; shift @@ -118,14 +108,6 @@ test_span_dir_ips() icmp_capture_uninstall $dev } -fail_test_span_dir() -{ - local dev=$1; shift - local direction=$1; shift - - fail_test_span_dir_ips "$dev" "$direction" 192.0.2.1 192.0.2.2 -} - test_span_dir() { local dev=$1; shift From patchwork Thu Jun 27 14:48:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 13714525 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2043.outbound.protection.outlook.com [40.107.223.43]) (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 14496198E6C; Thu, 27 Jun 2024 14:50:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499857; cv=fail; b=t8VbTb6hurEK5w0jIS2L1oP3WdrRwlLR1sGdsiROzfTgARyEttdrtilaRW2cGFUpRw79Dk90Rq770jp+5gFl6OiSevm7kt7fUwL26w6qg7bI5f8qN3YsW4rG0RatfkAU8vQ35jgdvxdtZoqvEWdDRgO8NtoztxnDotRSQyc/uNg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719499857; c=relaxed/simple; bh=qjMFUlhyyAf3bpLCpYxik3d8wmTpoSVnkg3E4NqEV2M=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Aeg0xpbUy8Z4DTld5MDcEvOEa8vrl2sYPMyCI8ESTNljnUfESCQRlk83u0vzfnED1GcYQT1MkeQdNqKPS+SSWp+kBNUaC5bksjvaFMhoviOPWjKmQxnyjWFwoeEQkFrhT8BevkTqyvTQJ7uOMabOVgP0RLbtNghENN0ZTbITyg0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=XnrRCNV7; arc=fail smtp.client-ip=40.107.223.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="XnrRCNV7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TY2N4TXSuwYMV3ibNu5r9clmYHOPcFUWGjmLmF9NOxryM/5sxeGnvBht6MkWd2K+CHtluvlWRpef9QPeT1bzeLONogPYD6RV7MboHZmvaJt/lCsZtQaulcfORBROoOVw/CGgOxpm86uS9J2+4QNU5nt30+oKN8Zl9hGYOBnTCEDeyerw2IY+1xHqoSi7CfXigIfCjVqRVCPpIlMNdJqu7YL2NXAivliZpXQdA/NGpbj2LCES8Ddb+yNE+As0bZizrsz1zQhwA88gmibeTjgO1MmoKEv6Rl6IXQiYeToPPS07apR/JuHu9mi1D7rt4VicjsYkj6yAbT9S+FiEwPKzEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SKgxkJmZc+rXtAW/Fn686WAz8ITy0ZU7NXGUlwA3zwU=; b=MyC+dvb9nJQDb/XyFhicYOsy4cQ6nN3Yn24ROYHebmoolnQJPybSZP2qWGaXUJUbAqwVnH7cTPvfKx9pObFus/BRX3x9tta+g/LTAzVKaC+G6shRWynH+sgAIXraO5EVB8VCqdefBYw2LYKJMlGhNPkSzbS4rbtIODNKxb7yjvZsatqpH6qj5/I5h4WgmanBZMgu5DKvOO4Kvzt7X+rxq838np+X4dxRvsGg84aNt387WWcAorH1eJTnc2oek6SpxOesme58JapoG3o6OPqtXTvNc24BpHaBMKLDUObSrerYauMpMNPvFESsSoW1R+yQoRfZH7x/wTeI7YtNlexVHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=davemloft.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SKgxkJmZc+rXtAW/Fn686WAz8ITy0ZU7NXGUlwA3zwU=; b=XnrRCNV7QuVx0iqMyQkJMhNJm8m/rGw7ZVCq+hsoUiuSCJQ9OqJG2P3DrXdId9iY6d9+Y3v7oJQASAFfh/vREB6Dpbic7bh5Toc1wuAyDGJeBTMWzrMfx4SBPf2XEUSl+p+hMo2HaxFfkuVvlbrpYjns583FeC2z5mtA/Qd0w+nbBD61HrkW2olMbM+ygSTNBAt3oOGRU2I2wfRzjRvNawTtx+3xiRsrC0RC41YZ1/xwX64/vgMiF+4xYaYrHQoab+vteos7ocd4hOQzHkQ1v7JxuSVVm9fX+qzJ5kZXXaG7KIalGal4hkF38j7pUmmJ268asnkip5XpayjzJJnqtg== Received: from BYAPR11CA0072.namprd11.prod.outlook.com (2603:10b6:a03:80::49) by PH0PR12MB7486.namprd12.prod.outlook.com (2603:10b6:510:1e9::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.35; Thu, 27 Jun 2024 14:50:51 +0000 Received: from SJ1PEPF00002311.namprd03.prod.outlook.com (2603:10b6:a03:80:cafe::ee) by BYAPR11CA0072.outlook.office365.com (2603:10b6:a03:80::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.25 via Frontend Transport; Thu, 27 Jun 2024 14:50:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002311.mail.protection.outlook.com (10.167.242.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 14:50:51 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:34 -0700 Received: from yaviefel.mtl.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 27 Jun 2024 07:50:29 -0700 From: Petr Machata To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , CC: Danielle Ratson , Petr Machata , Ido Schimmel , Hangbin Liu , Benjamin Poirier , Shuah Khan , , Simon Horman , Subject: [PATCH net-next 12/12] selftests: mlxsw: mirror_gre: Obey TESTS Date: Thu, 27 Jun 2024 16:48:49 +0200 Message-ID: <415d4940ec50b6520650d22636365d42fd931b17.1719497774.git.petrm@nvidia.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002311:EE_|PH0PR12MB7486:EE_ X-MS-Office365-Filtering-Correlation-Id: 8b12b8ed-be50-4d17-f9f4-08dc96b889ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: cZD00vVw3ZpziG/BmhjqqWWXTNRjQtxpwpHayKVe1xoNVBMas9elEckbRxgkLAPq8qPERdjksSJG9GdiqW0/hYsfUvVNriTwcV0Ry/lfZRwz/iKevmvBfBXNjZ36rCtzcdv18hxnsLsrIE1owQToJpaFwoqwqDiLPya8rt6+ImoXS3g0QQJroXNVtyfAx+PV4WCCfTFr5D6fj2DSariXS+jo4pqiZxTR/pNFIF6qp4q7vg6VnQoY0GwPuxUpfY7ucVDudQK8dmm0Vf7Dnn13XBcOFYV/Sucd6cxhxLEMP9N/DPcAw0JLOl8cNPz4ltH5INIqwfOz70u8rGtImAcPGgE1ZqvUlVGm4+4nncOGeo9LbAYVGQ8jMS13m/RRMufD92Clh6GSQ3y1nIJ9G7WI39vcLbZcow5F15QYvoAl/D4D99u4qjbC22vXZLPVd6rHci666q0ttU8rFNG8EqlFb3eyvh1NhA9io7WQAT1jd4VfUpUI171xQCMqTo62YvmCF1ujdMCP6VlEn4tp2TPgz1XmFOjzb3wPdmYqap91ig9zxS80RctfQUGGpEcdmBJ/9lNRfI05t+yb6zUGdjq9T8VxC48LjRFF+mPDQZEo/gQU3M+p8L97Z+okt1fwYFL0B5dkBuBUadZVOYZoPh8aZdFFlgQKO4VXVjU7EyooV0z1H/xLQbq3W5BB5jcJF8YJ/04cE9Us4IOcDdrQ6tkkFZSkO0h27WCHbwzOt8YklUGGjW3Q2LiUV7XhDZYHxvnjOX4GUL2ixJ2LDuvfMMQGVGg2HHD+XeBSvyjz2t46Pn6oL5Py8KcWJ5uBRSpH5cb1YG5MNIOOn26LbpHY5WZrnhY2TAWBq5RRJgNz/8pD8c8rj1NENJMhNkFD+lPOlXGwQYthq9Qvn0ANstR8Ge8dUlvdnkNwLnEUkGfebaDxAN41phYoUV2r0pTD4YN+eU+g4ah7nDxue5a42s+bJuOwbcrFCxhNg5eiBGM6x1CbhVoebtg/aO+kiVlidRhCUZuChjEjbG6YKgTKvVtKHt4qxjOE00g1xcwJuq28iNJi4OqbGUFxFpAgOTu328rh4afjOWySv1X/bRYI/hMG3b+EedG9KRk/hwuEC2Xpm4/JtMl0zlRU9ubU8G5pqsCqYWqhZ/65gTRzv0ZRAjY3vxMijKlcKiRqv4LIlf6xdaORSobgou5hw97vhM+yqAKhe9UhdJk7R8xyqJIwrG79m/lqiQGdiUgjvWi+YWx2Ju4jsh/8BD9mENbgDCy67/T/I9ouZcBkO90iCRQYwCZJ1hZWs8uP7YZgz3kekJxcubxz7MBru/LrEAV+MMTAYy+CCeWgQs8HaqmIPa8Uf38zI2gAgAGzsug+xzmmhRlrlrot+JAS3HTYDRREEcLC4FM3eBHi8XFFCz9iPqsco3W+ERkVnZ/3vmeF1Sr0SgO31dPpcPSQ98J8RnCakHAsMzZIwBHS X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 14:50:51.1900 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8b12b8ed-be50-4d17-f9f4-08dc96b889ee X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002311.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7486 This test is unusual in that overriding TESTS does not change the tests to be run. Split the individual tests into several functions and invoke them through tests_run() as appropriate. Signed-off-by: Petr Machata Reviewed-by: Danielle Ratson --- .../selftests/drivers/net/mlxsw/mirror_gre.sh | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh b/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh index b9326baeb43e..e1ad623146d7 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/mirror_gre.sh @@ -15,6 +15,13 @@ source $lib_dir/mirror_lib.sh source $lib_dir/mirror_gre_lib.sh source $lib_dir/mirror_gre_topo_lib.sh +ALL_TESTS=" + test_keyful + test_soft + test_tos_fixed + test_ttl_inherit +" + setup_keyful() { tunnel_create gt6-key ip6gretap 2001:db8:3::1 2001:db8:3::2 \ @@ -162,19 +169,25 @@ test_span_failable() log_test "fail $what" } -test_failable() +test_keyful() { test_span_failable gt6-key "mirror to keyful gretap" +} + +test_soft() +{ test_span_failable gt6-soft "mirror to gretap w/ soft underlay" } -test_hw() +test_tos_fixed() { - test_failable - test_span_gre_tos_fixed gt4 gretap "mirror to gretap" test_span_gre_tos_fixed gt6 ip6gretap "mirror to ip6gretap" +} + +test_ttl_inherit() +{ test_span_gre_ttl_inherit gt4 gretap "mirror to gretap" test_span_gre_ttl_inherit gt6 ip6gretap "mirror to ip6gretap" } @@ -184,6 +197,6 @@ trap cleanup EXIT setup_prepare setup_wait -test_hw +tests_run exit $EXIT_STATUS