From patchwork Thu Aug 15 00:06:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13764277 X-Patchwork-Delegate: kuba@kernel.org Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011030.outbound.protection.outlook.com [52.101.70.30]) (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 B502B2F36; Thu, 15 Aug 2024 00:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.30 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723680573; cv=fail; b=bjG53WzkUMOQYr4JuZKbe97N/XzVHG/Ruur1TW2OxglhUjsyxAYNx0GeV7o3vp694yP6ySA/34jFh00b+EwSmtpctAunKdd9HfGobbtILh/DCvylOVYUJnEhT8TeMiHXUchyU0tv2KkHWCaN4XJ3aSWeAk4xdY4CNqmHLsw13K0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723680573; c=relaxed/simple; bh=G4pwKGe+WsX1UC+GBdHvGckleB48mtCEHy0usf9zCKs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=h9deLhcFckPfuoyHLfe14ecP31Ju3Wgefm2A/BT40985Dbzh4wbpr41jf5dBmRqOHnw8LS73Ns5jYHocho7FOJ+txmkF+DXR/HD4LqXR8ggHoriEHp+sQkOcQJXhrmx0w/q3Y84X4UvY88SDaWWig33Jym7IdlSqak2TsPSo8wM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=L3qsk6yr; arc=fail smtp.client-ip=52.101.70.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="L3qsk6yr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HvGY3wRr+EKKj/sR9WQOExrn2ufDLOKwgMShvtBnm+Wao78sGB2KSc7lDbTTgPCJ748qKNfgPFx0kjWgXz+44SkYdJsx6utEBggSRQ/+0NkOh4vArMDLEmZDfiGnTtibStXNYu1yxw8Q6a4kvs9la5ZaphNme4HOPCzFGP1V/QOtjLkTCmXWmo1XRkuixs4qWVAqXvF6c2NFS8x/m/fQoRRb9H6mUKKxb05fgf78Jvz/PjRMhWHzcc+j8ePKM3amgkF+YlG2ZzJ5MgUpNOmISpRwtplO1oim+XiRsX8zymKHetlSOhzwl9kgbVgqa8I8VpHuVT231vOW3/i4OFJhmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=zEvSFc1lQI1uob82+ImRUmyxFZAv+rGlxzitzLcdjQQ=; b=R2cvMwQJl+giNImdf4kJcEkkH9kylMZxTqqW6rB2DX7fB4N7d/wTVS2R6askiCv+BwkxLJ5z0Tu0N2YjhOQ6EPXIAEeZlJ2prWkwwnZ33M/9wcj1qxqMhlgUYtsP3EcFREnuy1YzIZRxFAKlzqkZQiShzoFg9V5aD4ufu1fOE5YDGstmb8MEaWLesFApWLlVIKYD9MEshIrqznIGRXW+GWxUQWYH9DVosV6j9azLTHoAVCvsHLOEbt+Ll7w9a0fwLJJLuzOobS24DebMeBQ+LSuRrqW6bI+VR6u0GW1oB5TIkZpSo91pEIo8NPSLWADNYQ1CZJwkTRqF2h9t2m2lmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zEvSFc1lQI1uob82+ImRUmyxFZAv+rGlxzitzLcdjQQ=; b=L3qsk6yrEjDC981uzjA9E7hknTRR+nZNd9zMWJbWbyrnKGOyKJgiPFdNgzHftJxWORS5u5x/ochIf/NsvNrm42M4KVIO6GuWZS21B4xEwfR1o23r//Ozi3eesaZb0+rLDmYtI82JoZqY/HXMBU37JaRlKbDdjQgLOt9j3LmyZS1DzVm3TQWWdXFCkgZIltVpRe19Xl2x4U9m5UDTK5JLLWClB1NJ3jGkM3cfAt+4E83IwYXeOT99UXkh9I3iMKmknRMqVFpDmnIHc6O5ySIVSx+Fm7HZFcNG0N9UQuPbbqpgitR5bV72V7EQomQJyy0wa456b9d4stDfSlwBsLgbfQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14) by VI2PR04MB10285.eurprd04.prod.outlook.com (2603:10a6:800:21e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Thu, 15 Aug 2024 00:09:27 +0000 Received: from AM8PR04MB7779.eurprd04.prod.outlook.com ([fe80::7417:d17f:8d97:44d2]) by AM8PR04MB7779.eurprd04.prod.outlook.com ([fe80::7417:d17f:8d97:44d2%4]) with mapi id 15.20.7875.016; Thu, 15 Aug 2024 00:09:27 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , Antoine Tenart , UNGLinuxDriver@microchip.com, Hongbo Wang , Xiaoliang Yang , Andrew Lunn , Florian Fainelli , Colin Foster , Horatiu Vultur , Hangbin Liu , Petr Machata , Ido Schimmel , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net 02/14] selftests: net: local_termination: parameterize sending interface Date: Thu, 15 Aug 2024 03:06:55 +0300 Message-Id: <20240815000707.2006121-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240815000707.2006121-1-vladimir.oltean@nxp.com> References: <20240815000707.2006121-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: HE1PR06CA0143.eurprd06.prod.outlook.com (2603:10a6:7:16::30) To AM8PR04MB7779.eurprd04.prod.outlook.com (2603:10a6:20b:24b::14) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM8PR04MB7779:EE_|VI2PR04MB10285:EE_ X-MS-Office365-Filtering-Correlation-Id: 891f7bef-c27d-4ef4-0c94-08dcbcbe8718 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|7416014|38350700014; X-Microsoft-Antispam-Message-Info: zfOLVUqTX/zjI7+RprvSa5q+TWYyE0K+e7lTBQWHSkea9ZjbjaMC+82Xwa9ahXp2GcZYB9Vyw6Tvt8LQjTK/twponGOH4RvLL+0tIOMdVbvZVd9ieFonpltZcWNcTs6F4vUqUVxfuETAk1uDWWFY1A5EFguaDYi6IEL2W38Cl0Enn075BBYQj6HD/cIH+s3cBDpyAsv3eAEoznjHpVBzWp5+SFqoZMJKfJhtpCw+wdEyH4WMdvdqeUJYd+ketRMLwR5TMNgRRQtn5R9deoNg8ymgA4AbZqhxxTE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ilu1TA2BLvsedS7COdj4LeCQc8HTfCK0vS+NFp/pprGhn4FGSYxQ8wFYopNA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR04MB7779.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(7416014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rhxpkHHXc2rTthXltA5+Bqqm4XLV5F1bY6KYe6AXYGL2WU2EdFFNmnJ2mFowkjKkzehlcOJMIoDupJoHKE3TVxw7qErRhC8ohAoGTQFznZnd3Vrhp28YRZjba73G85fcqlfxNcQHLk8jY5TjOuYx2TsNoz8ZoJ2q6oVf2tnV68yhSkFYXC5UGWq9pcxoYq68N31PIzQOPLzFUeqfZCnjF2SCfnCvRKehf98n7FbbrWHBurGPGmSgdCLMgobVVkpPpxnvbbaKagZ869Iw2lWXPrdP5Hakhc1JZzA0JkqePs5mTpTRyjB3/mmWGdkcTae0w//Der51xbo6gaZzeGYt/aMWRmVOSVvLsJMKasTXFwWqBH+4CSGAGJu2AiMAiRHbJvbjWo7m1vch7uTSUO5iIKWm3kZyZCfXgdzkg4VyRKBXgPctNg5jqIuNgomBfDv6W9Mja7I7PRGK4uuwt3WLA6CZsPLAgUs7FS/kImHNnDeCR9GP4zg5jwaxzOlQyLku1rJDmGtORW49Kg1wV4CEqOWEdQLa9tpwK8bAosgesiJy+7UW8fT1DGWK6MytLGxXKLK2azoQpPvA3f7nk1/P4rjTD3G8wns1EnbY2qNgN1oNdNTbjVMBVenq1Jm2QLOhMK8a0phVwl5z/8J9rHVnYxTgmx+Cn5WXzuTAoW4gmoM+shVoGNTLhRu8+52KSCQtD/KnguX+cJY8QYIHsurf32XcBGyCZCPoUsAVpnwbHdgyXor3BQoF2jPiMFekprOE4+qS7gyCta7ze1E4U+c06EXrBLYGK36rSusIwjdPrISd7U2kXD+l/wrK9QOeEbCwdlJS5VAhpvg3oa+MvoNC5H0aoyzAxcCgkvCKwxZje8eDhYHCfYQKX66MPfcwS7ZkTw0T+YRUv1KoKK+9xOUASZ/gyqZZPiK2UoHM7tthvqbVfeZqoZ6SIUt3iJEAkwIICMjhD9/K6v7R7fWYw60RfjbYNLntrwvpxvKmCkP0IOmHSGfhBW0/OS/9ANT31cI/KWWYkjBsMskLtAQOauJN3nd8bzJms7detRe4c8KrZriHLCtoDUOAje/C5SG1GXhz/qNqF7cPpPsnprKo7bUjxTm59wQURq9F5yD8K/13KKsZ/xMDwLyHk5G9+gaLDKH3xmA7EiPYPd+ciXBbO0CNchFAmfk7AACXNGvkfHNTB+7ncstGUWqS23UdPgDImBF/fL7Jej4rza1oBQu3y2gfcaXO/X4gsiiS+88u+DpMj+q840ApR5Y0FbSmQ2+tHH/OSF9+NFEPKLSabhSekJgxpE2ChalODLO0eDpfGHj3nJBKirPXzfL+16ZOw+0U7XitpYkB86gVbVPpawWe9Z5tBt7+X6xWiZDqpsJmFmAQPWZwLqziwM9Ww2Ls1ZE0uJ+sweBCLw0rG9cBcKrlMgOdUfC5Vn0I7Og+/Er5h3DjIXlkK3By5o3EMZSdTkhDW5INbe9tUXe/aTasuC40RmCoBL1XJ/TpdrVyeR7Ky3QCKL5fO90EVTCY0keUQtQyqM9TvdRf+Gw/Kn51S7DBnnHL0OpBaWdV3JYJyVwYTxsRo4YhHSbRiTqrhVNASLIpmWt9sj5jR4C0sbwTfmhOS+4jrA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 891f7bef-c27d-4ef4-0c94-08dcbcbe8718 X-MS-Exchange-CrossTenant-AuthSource: AM8PR04MB7779.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2024 00:09:27.7953 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WBDC5fseWmVhI9Am4FFV5dOr7RA2K+gCWqD+Dn9xNddOZXipK1C1h55PqE8CfzTJ/Sid5itVQ87fbgMywo6JyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI2PR04MB10285 X-Patchwork-Delegate: kuba@kernel.org In future changes we will want to subject the DUT, $h2, to additional VLAN-tagged traffic. For that, we need to run the tests using $h1.100 as a sending interface, rather than the currently hardcoded $h1. Add a parameter to run_test() and modify its 2 callers to explicitly pass $h1, as was implicit before. Signed-off-by: Vladimir Oltean --- .../net/forwarding/local_termination.sh | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/tools/testing/selftests/net/forwarding/local_termination.sh b/tools/testing/selftests/net/forwarding/local_termination.sh index 36f3d577d0be..92f0e242d119 100755 --- a/tools/testing/selftests/net/forwarding/local_termination.sh +++ b/tools/testing/selftests/net/forwarding/local_termination.sh @@ -104,44 +104,45 @@ mc_route_destroy() run_test() { - local rcv_if_name=$1 - local smac=$(mac_get $h1) + local send_if_name=$1; shift + local rcv_if_name=$1; shift + local smac=$(mac_get $send_if_name) local rcv_dmac=$(mac_get $rcv_if_name) tcpdump_start $rcv_if_name - mc_route_prepare $h1 + mc_route_prepare $send_if_name mc_route_prepare $rcv_if_name - send_uc_ipv4 $h1 $rcv_dmac - send_uc_ipv4 $h1 $MACVLAN_ADDR - send_uc_ipv4 $h1 $UNKNOWN_UC_ADDR1 + send_uc_ipv4 $send_if_name $rcv_dmac + send_uc_ipv4 $send_if_name $MACVLAN_ADDR + send_uc_ipv4 $send_if_name $UNKNOWN_UC_ADDR1 ip link set dev $rcv_if_name promisc on - send_uc_ipv4 $h1 $UNKNOWN_UC_ADDR2 - mc_send $h1 $UNKNOWN_IPV4_MC_ADDR2 - mc_send $h1 $UNKNOWN_IPV6_MC_ADDR2 + send_uc_ipv4 $send_if_name $UNKNOWN_UC_ADDR2 + mc_send $send_if_name $UNKNOWN_IPV4_MC_ADDR2 + mc_send $send_if_name $UNKNOWN_IPV6_MC_ADDR2 ip link set dev $rcv_if_name promisc off mc_join $rcv_if_name $JOINED_IPV4_MC_ADDR - mc_send $h1 $JOINED_IPV4_MC_ADDR + mc_send $send_if_name $JOINED_IPV4_MC_ADDR mc_leave mc_join $rcv_if_name $JOINED_IPV6_MC_ADDR - mc_send $h1 $JOINED_IPV6_MC_ADDR + mc_send $send_if_name $JOINED_IPV6_MC_ADDR mc_leave - mc_send $h1 $UNKNOWN_IPV4_MC_ADDR1 - mc_send $h1 $UNKNOWN_IPV6_MC_ADDR1 + mc_send $send_if_name $UNKNOWN_IPV4_MC_ADDR1 + mc_send $send_if_name $UNKNOWN_IPV6_MC_ADDR1 ip link set dev $rcv_if_name allmulticast on - send_uc_ipv4 $h1 $UNKNOWN_UC_ADDR3 - mc_send $h1 $UNKNOWN_IPV4_MC_ADDR3 - mc_send $h1 $UNKNOWN_IPV6_MC_ADDR3 + send_uc_ipv4 $send_if_name $UNKNOWN_UC_ADDR3 + mc_send $send_if_name $UNKNOWN_IPV4_MC_ADDR3 + mc_send $send_if_name $UNKNOWN_IPV6_MC_ADDR3 ip link set dev $rcv_if_name allmulticast off mc_route_destroy $rcv_if_name - mc_route_destroy $h1 + mc_route_destroy $send_if_name sleep 1 @@ -267,7 +268,7 @@ standalone() h2_create macvlan_create $h2 - run_test $h2 + run_test $h1 $h2 macvlan_destroy h2_destroy @@ -280,7 +281,7 @@ bridge() bridge_create macvlan_create br0 - run_test br0 + run_test $h1 br0 macvlan_destroy bridge_destroy