From patchwork Wed Aug 14 11:10:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13763349 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2076.outbound.protection.outlook.com [40.107.223.76]) (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 8E50419FA66 for ; Wed, 14 Aug 2024 11:11:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723633864; cv=fail; b=pCoeHsfw1l1JypskaeIVNLocns050nHSh0zorc+CbZnfyMZV2y6j5SyAp0MTJNRbqlm47x95mGYyja06RPNE5r9RNCUsf6m0ecTQJZQ76TnUw9vypQa09RbgkoGnRYfDhY2L1CK+1VIfmnIlPPCIwMcLIw4pX3I7u/+eBsNxBHU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723633864; c=relaxed/simple; bh=HeanNDoyn6qroYWEOlm2GhD9g6Y1rTNwF+VbjXjYjJU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=JBnv+NzbU8/TSgtyC+D2haH4oibYUpv4h4IOjIIB60xcYyNSQXwJJNw81JgKvR0MXakoPK6Bj58QzYeAajsyjvbZi2yT4+Zgd+VeJUtILKe7IRaUlPE17RxnX6Vsgt3zjL4OFrXblvFJCkDuEaHIzgDQ4midhtei2rClUaLtBlM= 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=elVw/bDW; arc=fail smtp.client-ip=40.107.223.76 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="elVw/bDW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=e7DY2HbJyoMdi/hJLsGgyM/ceQzVXI2cNaGRPZMb87KB8Un6iLIHaFXcOWJ2bYIy6wxA4XM5mvq42p0e/lF1dLvU5MYM85mdrf7eKwzXJh1rBxVgt5OSoq5T+OFRchlEJ4UUb838wvUQ9a5Gu7PohP7elcf1FTP1OUHzbqbWYL3jceGYQ8KEB+BCnc87sBCp/21Ey6Ho4UUOPdkPGsfdynwruXoX2PoJ8jTUl9QAxofmGxtcw8/4Us7swJKHApjF3K8G4XL9cD2QxQ7f+r7OUrhmDSVp+bEy4r4YH/+AUUINOOFTBWvlKbcsLKEpc2VAmavHTXBE2asAMGghS1sqEg== 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=aqVBAbpDeFyyBaNy24p400JqQ2p4NepHkzWpAWtpwsQ=; b=gdhppcXMb8djnlYPDG4O0e+Uu35o3IAa6HTO6Ykrxxehy0mlpJZr+W0YBpq+6Cz3At/QVr0qeNBNoaYRiE8I42d2+GgaZP/BDw3rNpKYxgeLw88r13ITFnyiKqqLbgpvvOL+LiAC1gi9DlFhb4tvGKRliz8jQYnyHZ6+lv/jO7DhBgqoehxqoh3kk8MhwFuUYC5R3l5t+5F5fO3zxlZkqPpsn1eMBnucqp203/rn5mgSleWiItpbRbtWX9OB3t6lHjjplnuDoJjSdITX0J6UlaiEIJfHVSlxy+zfnUCjwj3TG6ENveE/cAswKPY9iJw1iktwQ1zFrd6d4YU1+bbzWw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org 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=aqVBAbpDeFyyBaNy24p400JqQ2p4NepHkzWpAWtpwsQ=; b=elVw/bDWwsWaGqjbCA0EOz9dDcM/rjeMhT5NNoNyPYIOTOALHBP/ZFwzpv8ZkLP0oHw7uV3XlbIR8zjrhebPOWRltTuu4kioI5ttSULbeWQLbM9Fs20jZT+Jn3qPwjWMbxRKS3+T1q1zZb6JqCcH8rrIVMuVqY4Qa380xfAnbm9C/ETv1LlRfu4Ok7NaorAW4qg3nEL6LrAn0MqJYSSFi4ca5wvi+u/EtWBKCxZ9j8ctqIIQUL/VxCOAD6GpqEkwfMRHNkdetDsJ2Yx/FqeoczHbHKj/oiYES8mUNRUFAHlCtEFazhcF61zTphiaDEwVc37ywvYZMCFePPZTj48zKA== Received: from BY5PR04CA0001.namprd04.prod.outlook.com (2603:10b6:a03:1d0::11) by SJ1PR12MB6218.namprd12.prod.outlook.com (2603:10b6:a03:457::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Wed, 14 Aug 2024 11:10:59 +0000 Received: from SJ1PEPF000023CE.namprd02.prod.outlook.com (2603:10b6:a03:1d0:cafe::f8) by BY5PR04CA0001.outlook.office365.com (2603:10b6:a03:1d0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Wed, 14 Aug 2024 11:10:59 +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 SJ1PEPF000023CE.mail.protection.outlook.com (10.167.244.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 11:10:59 +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; Wed, 14 Aug 2024 04:10:47 -0700 Received: from shredder.lan (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; Wed, 14 Aug 2024 04:10:42 -0700 From: Ido Schimmel To: CC: , , , , , Ido Schimmel Subject: [PATCH net-next 1/5] selftests: fib_rule_tests: Remove unused functions Date: Wed, 14 Aug 2024 14:10:01 +0300 Message-ID: <20240814111005.955359-2-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240814111005.955359-1-idosch@nvidia.com> References: <20240814111005.955359-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: netdev@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: SJ1PEPF000023CE:EE_|SJ1PR12MB6218:EE_ X-MS-Office365-Filtering-Correlation-Id: b0b08f5b-8592-4cdc-f9c6-08dcbc51c6f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: GRvKd2w/UIKhIK5BVdF1oRnQWB2jIVOMITlmubtkYXdueT5X3xgt6eLSWUfgyro/ZFlxTU4vFAH3ty4peVHZOf/yL6vituDMOUUQWBQy7dQky2uCszRWUR9S0Uh3r9yAImS/JT3LQI+e2htpGkIwZ3P0xEBavaM3DupsYNpkIcZjMN7W+KWmoVMS96Cq27uF/KR89jdLl09rGKaeJt6PaPbx5TE5t4Pisu3F1pzy+mo07NcomsYeSCp8/mKSojPO0YeNjoL4dwa5gebqr3Ctwzj1RpeOvfPCMgpcB2BLOPfyAPbozdMCNsKr70Ng5+cBN5ZlmlJvQHfnQ+4yZNDOZPvVEdJIPezNw6zRlRq9cj02izROkVd5TqSaQhx5H32fK1zrb127tlm6KNHQUHrkn40EaDgvKOGMUlsOhjbSZtjylmiUdWrPIt0lvI1j1aYgiDsgilnUPS0zwMO2yn8Ee9zIcTWQLxwGlFtg7K5wdALfLx3Jgm5irH1OomIT1XWtUdGwccUQWMGP2dHvLqyPySaYRRPwJl+swquQ1dzvi7yeO1s6xDZFHn09/CEPBnuWc945TMPqysdjskhLqHi/V8vcJs0aaP6cHbBwyU4pRhmXFB/Z4w/fwt3pcogu/3bSZqO4OF2nPoR4OQBFWStJ1Kfhz1KfrlFdoQXqIiH5ye4oenADVumhwwzNRUR5z1xRcL9uoZ2lzAg3Tua9Rj04Fzqcdr9e+kN5c7VuS3c2TOqf1GaU+HZr6CqTAvGxJEKg 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)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 11:10:59.5902 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b0b08f5b-8592-4cdc-f9c6-08dcbc51c6f6 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: SJ1PEPF000023CE.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6218 X-Patchwork-Delegate: kuba@kernel.org The functions are unused since commit 816cda9ae531 ("selftests: net: fib_rule_tests: add support to select a test to run"). Remove them. Signed-off-by: Ido Schimmel --- tools/testing/selftests/net/fib_rule_tests.sh | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tools/testing/selftests/net/fib_rule_tests.sh b/tools/testing/selftests/net/fib_rule_tests.sh index 7c01f58a20de..c821d91b9ee8 100755 --- a/tools/testing/selftests/net/fib_rule_tests.sh +++ b/tools/testing/selftests/net/fib_rule_tests.sh @@ -56,14 +56,6 @@ log_test() fi } -log_section() -{ - echo - echo "######################################################################" - echo "TEST SECTION: $*" - echo "######################################################################" -} - check_nettest() { if which nettest > /dev/null 2>&1; then @@ -453,14 +445,6 @@ fib_rule4_connect_test() $IP -4 rule del dsfield 0x04 table $RTABLE_PEER cleanup_peer } - -run_fibrule_tests() -{ - log_section "IPv4 fib rule" - fib_rule4_test - log_section "IPv6 fib rule" - fib_rule6_test -} ################################################################################ # usage From patchwork Wed Aug 14 11:10:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13763352 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2065.outbound.protection.outlook.com [40.107.244.65]) (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 A36811AE875 for ; Wed, 14 Aug 2024 11:11:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.65 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723633876; cv=fail; b=cFcn4cNWVZqjJbpIZJlszBdxsWkjgAS0eZDpqReyKxfV3KCqz8Qno6rjIIhHTvBkKa44EB/Ka+d9GORO96gm2+4aUJSLAn5nQf7iRrR02TdxKUYYTPBqVNt8vVq2bcNkj0jkyRR+drGb6BCDQP5SFO4ZaRyGtFKLmVprlOTcvrQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723633876; c=relaxed/simple; bh=hOTqOTj3LBYACEUSpJmQEY+rnJlIjbWRM0lCRfBd+lY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oPKdoe0WXEv50kW1IuyZ2H3kl8Nc5ZmiioNDb1B63gCRgwVv3TVTqClorRmFGiy14HMj+v4eShoEqNjL88GgR3KFH3VvHJ6B8jN0+g8Ih1/kcW2a5/AvwRSuRYMles6URWMuS2rvBHIryrUJeAelaZho7ukUQANOW1n0U5EStUE= 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=tYDHAd/0; arc=fail smtp.client-ip=40.107.244.65 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="tYDHAd/0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NWZmdzBO6r48TyBYdjX9SBwkJG3elquYBuQJwkxa6626QT8wnE4x/fnwjLAaerCJuDFDP8sF0349m2FOHahgp9e2V7ddfZbFM/DmI6qoVrbkvPh0Nv2vuN8hId7twfb/UM/CnZ+6WaaHjh7ECSVITU3JisTr5AhI/8YMgynXWdYNXtbgyxx3XOk1Cy+2iJL7vP+o+MOhlLYjD1jFDH5i4yuPMYOTEkapSmnRsXn9q+7+ywcKvsGdulZz4wHMqxI61CHUS0lC9avqnuANkoJs5dnS7CQ4MQOny6d5kxUANpUMworF/whsP/VPAbWNIFq5wRHwxOFHtm/VcScewPBqmA== 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=5nAGVvAM04wuxeiy4Wwqb8ScEAD8YXYsAdcmZBcJrBM=; b=zJVdoTGPwmWTTgcCtth1FyOveCS0e3BvUBtKn65a2d0911LDcMlLp+hhs3LkP8NV1ghbapDAHirl0Q2tO/68Jy+mzK2yX++onR4w3m6GO7HOsUxPCLT+9Un7sF65PedYntQL+V0uzvnCNJ/MtaD3HTzgkIIA+3xrRuZ4gZufgd/fln6jpp4hHgtN+fmHcufPT8P3LQ+v7bnenqCPxzGC/JLg13YsZYkb0Hn3SWeKsdsfubsHZTOMscaNUOkNp/EJiXZ2q/0mZ5rKHmeIt8tiPQlk1nJbC5Sp5vejHe5XVjT1lNR3soP8WtdMnBfr4cyB9FiI8Wk+5lG43v0DE1J90w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org 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=5nAGVvAM04wuxeiy4Wwqb8ScEAD8YXYsAdcmZBcJrBM=; b=tYDHAd/04655FIq6e7mWrc0gmBrdg08Yqmace15iILUWS5LkXi586U7eyAezf4qsGtpVTRfRtam+pRVao08ib29O2fKZvc9fBg6aimUIp47kqPMOIBMv1AvR3B6gdkXLSm3Rh2ylDeMmmPzOI+FdiObybbCmq6mRT+EWOn78u7ObkqE22mAVh9+rkmVoe+puK07T32B/021pS8x1PwCEFct1cXpG2UMfh2GqaRGRgV6g953jz9ccKHPX7dn33yNjAGKqoayb5VwYir2d9vRoOhb2lEHG60LcwMbE7H4EIl9qUAyx1Ho5CGrDvly8dNFA2ZAJVxxGaa6MW3mvjWJ6kQ== Received: from PH7PR10CA0022.namprd10.prod.outlook.com (2603:10b6:510:23d::6) by IA1PR12MB7640.namprd12.prod.outlook.com (2603:10b6:208:424::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Wed, 14 Aug 2024 11:11:11 +0000 Received: from MWH0EPF000A6735.namprd04.prod.outlook.com (2603:10b6:510:23d:cafe::2d) by PH7PR10CA0022.outlook.office365.com (2603:10b6:510:23d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.24 via Frontend Transport; Wed, 14 Aug 2024 11:11:11 +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 MWH0EPF000A6735.mail.protection.outlook.com (10.167.249.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 11:11:10 +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; Wed, 14 Aug 2024 04:10:51 -0700 Received: from shredder.lan (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; Wed, 14 Aug 2024 04:10:47 -0700 From: Ido Schimmel To: CC: , , , , , Ido Schimmel Subject: [PATCH net-next 2/5] selftests: fib_rule_tests: Clarify test results Date: Wed, 14 Aug 2024 14:10:02 +0300 Message-ID: <20240814111005.955359-3-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240814111005.955359-1-idosch@nvidia.com> References: <20240814111005.955359-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: netdev@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: MWH0EPF000A6735:EE_|IA1PR12MB7640:EE_ X-MS-Office365-Filtering-Correlation-Id: b5901831-d195-42b2-751c-08dcbc51cdd3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: fhd4wwJtKDnKzYrOZB4IVDRBnRPGIiEP5f0DpZJApntRyEIEwuDxMQcwFv31iSroLu3/kqwCrRsmg3k5i/MAqItUeFJgtGy2wx0bZweK9cyXl4kyRacMBhNEeRhG1trC3BZoOOp+o9NcX3/AhyGAvaxYAD2GaC7OT1mS1995yFeQ9WVS3rD4nrBIT4NcIrzK8nafwJAwXWpNVpCF73mjtcxEODMZTpIqvopaeT0pSnzIve9EMedIFBdd72t+H1WkJU8f/vIetRkHEwaojTLSaAYT98AlrPXpWcGBvrb+h61y6QFfJSz1h9Z6X/cogz4JUfy5XumPyN4c52qllmAHSiIDDsBQPUWSQGvOj1MC8+ZgyI60MowxdhdRaPtKknllPPujpRzRP8eu0fFDru/hpnL0hfm8df3or2D413z+WcU3+LzXorB/Vx9ozVPZOFHjpmFxJnC+jrE4Ng/vtzBGyWBx8uIsFY36X3kI3B6QIUmaYWyLQ6R6uqpsvleAsk3BnYBC4AXhjkwOrDExGOCqzMI3NLhmxYHG5XhjQ5B+1V7Jqz7vnwLlB7czamAXMhBK7PYk/G3B5ZwaYgyk24mWbfXJnU6W4wNRYHjRFkJpEAGl0thzfqvvqz0PV5boIgMkvJnT33cqPn+VoPWisYNNFIWV7GHef1dPeoiNbbo6DwccjlDdleGhfyB2JLLL5OHMjj3V7e52igPR7Zjo+asbgm1q5hDblc/zZCxNNaR1/x8aTtQX4GlF0ujylsEBg1i3 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)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 11:11:10.9451 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b5901831-d195-42b2-751c-08dcbc51cdd3 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: MWH0EPF000A6735.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7640 X-Patchwork-Delegate: kuba@kernel.org Clarify the test results by grouping the output of test cases belonging to the same test under a common title. This is consistent with the output of fib_tests.sh. Before: # ./fib_rule_tests.sh TEST: rule6 check: oif redirect to table [ OK ] TEST: rule6 del by pref: oif redirect to table [ OK ] [...] TEST: rule4 check: oif redirect to table [ OK ] TEST: rule4 del by pref: oif redirect to table [ OK ] [...] Tests passed: 116 Tests failed: 0 After: # ./fib_rule_tests.sh IPv6 FIB rule tests TEST: rule6 check: oif redirect to table [ OK ] TEST: rule6 del by pref: oif redirect to table [ OK ] [...] IPv4 FIB rule tests TEST: rule4 check: oif redirect to table [ OK ] TEST: rule4 del by pref: oif redirect to table [ OK ] [...] Tests passed: 116 Tests failed: 0 Signed-off-by: Ido Schimmel --- tools/testing/selftests/net/fib_rule_tests.sh | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/net/fib_rule_tests.sh b/tools/testing/selftests/net/fib_rule_tests.sh index c821d91b9ee8..9100dd4d0382 100755 --- a/tools/testing/selftests/net/fib_rule_tests.sh +++ b/tools/testing/selftests/net/fib_rule_tests.sh @@ -35,18 +35,13 @@ log_test() local expected=$2 local msg="$3" - $IP rule show | grep -q l3mdev - if [ $? -eq 0 ]; then - msg="$msg (VRF)" - fi - if [ ${rc} -eq ${expected} ]; then nsuccess=$((nsuccess+1)) - printf "\n TEST: %-60s [ OK ]\n" "${msg}" + printf " TEST: %-60s [ OK ]\n" "${msg}" else ret=1 nfail=$((nfail+1)) - printf "\n TEST: %-60s [FAIL]\n" "${msg}" + printf " TEST: %-60s [FAIL]\n" "${msg}" if [ "${PAUSE_ON_FAIL}" = "yes" ]; then echo echo "hit enter to continue, 'q' to quit" @@ -205,10 +200,14 @@ fib_rule6_test_reject() fib_rule6_test() { + local ext_name=$1; shift local getmatch local match local cnt + echo + echo "IPv6 FIB rule tests $ext_name" + # setup the fib rule redirect route $IP -6 route add table $RTABLE default via $GW_IP6 dev $DEV onlink @@ -267,7 +266,7 @@ fib_rule6_test() fib_rule6_vrf_test() { setup_vrf - fib_rule6_test + fib_rule6_test "- with VRF" cleanup_vrf } @@ -277,6 +276,9 @@ fib_rule6_connect_test() { local dsfield + echo + echo "IPv6 FIB rule connect tests" + if ! check_nettest; then echo "SKIP: Could not run test without nettest tool" return @@ -344,10 +346,14 @@ fib_rule4_test_reject() fib_rule4_test() { + local ext_name=$1; shift local getmatch local match local cnt + echo + echo "IPv4 FIB rule tests $ext_name" + # setup the fib rule redirect route $IP route add table $RTABLE default via $GW_IP4 dev $DEV onlink @@ -411,7 +417,7 @@ fib_rule4_test() fib_rule4_vrf_test() { setup_vrf - fib_rule4_test + fib_rule4_test "- with VRF" cleanup_vrf } @@ -421,6 +427,9 @@ fib_rule4_connect_test() { local dsfield + echo + echo "IPv4 FIB rule connect tests" + if ! check_nettest; then echo "SKIP: Could not run test without nettest tool" return From patchwork Wed Aug 14 11:10:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13763353 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2070.outbound.protection.outlook.com [40.107.100.70]) (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 A65A71442F7 for ; Wed, 14 Aug 2024 11:11:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723633880; cv=fail; b=JkiNlEPOpH78qzE+oHBIAVsxHpDYd1SD4KpXxHt2jXIPyvtcB8hSPVGkkFP2Tx6b9SfD5roS6U/cN7qNRGEaACXj5/X1Ofi6F9YFYwWndrKXcLzGvaEbUwv/tTTXx6zU2/fSfnhfu6HTPdSxRBzvnwdcv6P/iPC0TKcKPXmoQOI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723633880; c=relaxed/simple; bh=Zue00ZRP1U0fk6gJ/9JiNeVdBe+PRBvtUFsFMazgGlw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=H5rrT2gBTfJoaQKvrt6tH6Ze5Y5X1aQOsoMK5tkPXH4BPWO0sqLq0v8Elf2ho+rA8SF/RO/IP7knQblPHk2Sp/iwikMqE7qiYIUa5ZtgeaTBepGxcjTVwWbxob5xpUDB2xlVcudjRbOwwzPwJGUOit7iv123bC24W/xAhI4cRWg= 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=HaBq7keb; arc=fail smtp.client-ip=40.107.100.70 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="HaBq7keb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JpLtmnd86PigqokCEG8+EMW0a5u8vTobGzRZpymz+33hEz7ztWdQkc0ummDmZeK/hz//cQofQT1ePoo0LE2D+d5f7xhJ3NFSdNZtWGCICgcAYOmFA79Bo8LdYj6gNSOqP8sEpgT3mHRmqLwnxyISKWPSFTQI+Pb2HfAoeQEmHnp2WG8tYAwlStyLW/YSBCv/a+0N2TVLdV+5pKe5+DUbKSZCDc4JUHmDTrVSTRR16uGduX28g2Ay+O7OQbVkHP37Oyc9u7EZW8eXW8gCtkoHpc/vIwL12IPqgdILntEHd6qBHGNnCOWxr4kh90woxgGsks0FqEBC94pAEYw0tOmhcg== 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=RcKRWOT7rydL7F2EgvytEgrmFWCz/ouUxktoT8yLMkM=; b=tJlm+9VJqhQlIogqQs0LBVAW/lYLYVaUisqnYINdZk1RmwkGrxoYYgjzPzvRvi4P5pq4bJM4k8B/+eK0kfECthaMpkv9KgHYj3CpnBvyYwPrHF2lAuUiXeyd2g3VXDaqh+4dFAZFFL8a63OsHmD7UFw3IB/SLov2quD8JzjBRW9DuzHXp35fFit1i2T3CGFUR2rnPu3IYXzfwdpxOTfLsHFbd0R22uc9IY2MixsKi8QwGrtgp6F6aXNMVdmaieehzS0B1UDAjqw8qHHqUq7QAeKWMJAcM98EcTLpbf2gEdPqEhMHiV7K4DHnUUyfFKRHfOtAworvN53dMW+r1TUALQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org 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=RcKRWOT7rydL7F2EgvytEgrmFWCz/ouUxktoT8yLMkM=; b=HaBq7kebQAGTcIkyNtZrgKHHE90zNq06NfEZubbCyVckEVWWMaI2Qk9rw4EoMiCPFAiKawJS+74DbG5r7Oza6ZGn0RFxAY8ZMdNnLrksEgJw3dbzweKKLEAuBKp5S8nkT9P/9RIE2YKoyiZfrJnEsNXmF6xbiD3GxgrpnloM7DfHYchUXxUX1nA3Zv1kJ2XFvB0+B/06j7Lq0wDGNsqXN4BirCKd7F6kEPLtMgu+wFI7y/z0zG8JBLtkAOl2TTYTCz+nEf+I3adZ9uDrzxHZQwy58xfN+O0MkyEXno8xxQRnkiNHkBWvE7y8j6OWRn9JtjsdIz6Ubm3stzzZoG15+w== Received: from SN7PR04CA0111.namprd04.prod.outlook.com (2603:10b6:806:122::26) by SN7PR12MB6766.namprd12.prod.outlook.com (2603:10b6:806:26a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Wed, 14 Aug 2024 11:11:13 +0000 Received: from SN1PEPF00026369.namprd02.prod.outlook.com (2603:10b6:806:122:cafe::46) by SN7PR04CA0111.outlook.office365.com (2603:10b6:806:122::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23 via Frontend Transport; Wed, 14 Aug 2024 11:11:13 +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 SN1PEPF00026369.mail.protection.outlook.com (10.167.241.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 11:11:13 +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; Wed, 14 Aug 2024 04:10:54 -0700 Received: from shredder.lan (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; Wed, 14 Aug 2024 04:10:51 -0700 From: Ido Schimmel To: CC: , , , , , Ido Schimmel Subject: [PATCH net-next 3/5] selftests: fib_rule_tests: Add negative match tests Date: Wed, 14 Aug 2024 14:10:03 +0300 Message-ID: <20240814111005.955359-4-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240814111005.955359-1-idosch@nvidia.com> References: <20240814111005.955359-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: netdev@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: SN1PEPF00026369:EE_|SN7PR12MB6766:EE_ X-MS-Office365-Filtering-Correlation-Id: d0b2fb97-1f46-4a6e-9c00-08dcbc51cf58 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: jpXSRMc8Cm8OmXxlTSxHi6ZmVDv+aNvd92PzCwqnvSn0elB66l9kFtyXjVwQKQUlD6TCkqmcV1PwoYzMQpkC2TpKIwPV0VCN9jo7yHvx4gdQ5/WWSMrgidmQyF21yf/n+JYg92GKTdPl98fFrvSD5h67wX4bLmO7uWP4d6rhwdOkx/huSNWomYb+b6e4NGSNcOz0fG+wPg6z1IJnxZmww4jwKO8rM2gZtinvcf5cenHAMruYW2hdU1W2S6tLr1bKhi2Cz3OJKgk1/P9ctQvrGufd2eQ+xBANYDC/eScllx3GrwKO1xGynLVW20tg2/QylOyvP77X5pgUH1YmmQ6naZhwXoPBJ1wDRcQqpDcLyH2rvq7N2liJ23hGJOKxD7q0dnCbRuzcDLzL+IstpBmBQqGZPfYrg/wfpwdffzUHLTQuG+q8+9MaLon/pXF2WbMniMQLxAZOpuB0C+w2X8nyQxsZRbEQd7BIr7t/PO6R5s0+aIBr6DTI8VzvtiBsQuL5tZYlp3KciLTQbly04UiKs8y+K0i+NViGn5jFaGX5b9lDW+6fV0MB9wKZDvEfr1JBk6K4MTpyhuIA86ExsajGf7QOXdICyhB3IiLKUDYrUd3A0Nzyc/PDBF3Na4TOdo9yMRwoFioix7+5oopEl/oPbaRt12DAFLSs7Zv86D7P00+7JFeh3iOatWq/4lTTJurYZgQ+4BFjqUWbaU3sVzQMqVkTeYMWsPd0NTGujdRfN9DE3lattRj/8D5sBMxoEeeAw4wjDdHuwvQUxQHvfTGhMAb7gq/esPw1sg7kQIMg9w5INLS6XUBA86qptBgY6KYtPcic8OcIHeQjW3RlbOlVeS2ogWIaCatG6FaMwRmQkxwG1+8ixE5YLyfpSbuZoTulqiE5zq1AuD3ea1/8NLmmGMz0bW1QyG5DYL/WJrOKdubDz7QGcul5an1Xrg+lzHsHNwBziWFW94EjU4t8HIpCezIB8qxeid/MuNAMR83rWBXtM0BuHLSg7FX7ihnXlxHriO1BnxNGtYmGcVKkTkfTVCe4gL2ws0x6dnAd4s4AypzrtF5HPiUCC95rR2vu+ivr+gsErVCxgqekzQ7IfnPxsrDqrWi4RjkYJq89lTZVbuSjz7L5Il2czEGsOoyOb/EU/JWnLY9Km9gbxmX+KmZButu0dKcT/qOcizCH7AsOyUTfxlUO+AH3e7GJz8Wb0I4Gh7eI/CNhHCUK6qjsVFXkk0ocZ0yIItgsgBYNQjew0GGPgW8ZfCcx8aRMSxiiaP0PQGjvcQgq5AB46WAQIoAvKh2f9xo8LLKhIjqN+npgtBg/THTDYirlt3x9FQjB1Jl3L/9TUkmxAa3edhK4l8pKNNBO9cu/vQ3G6vwd+4veRrebya5Y8J9krbnCYRrfCZAh73eULARkYTSUscSZ53L+Tnlsjv4aj6LNR6K7kHJNLcbgLagCAKoH3COzDJYQDLH+ 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)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 11:11:13.5268 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0b2fb97-1f46-4a6e-9c00-08dcbc51cf58 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: SN1PEPF00026369.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6766 X-Patchwork-Delegate: kuba@kernel.org The fib_rule{4,6} tests verify the behavior of a given FIB rule selector (e.g., dport, sport) by redirecting to a routing table with a default route using a FIB rule with the given selector and checking that a route lookup using the selector matches this default route. Add negative tests to verify that a FIB rule is not hit when it should not. Signed-off-by: Ido Schimmel --- tools/testing/selftests/net/fib_rule_tests.sh | 87 +++++++++++++++---- 1 file changed, 69 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/net/fib_rule_tests.sh b/tools/testing/selftests/net/fib_rule_tests.sh index 9100dd4d0382..085e21ed9fc3 100755 --- a/tools/testing/selftests/net/fib_rule_tests.sh +++ b/tools/testing/selftests/net/fib_rule_tests.sh @@ -174,12 +174,17 @@ fib_rule6_test_match_n_redirect() { local match="$1" local getmatch="$2" - local description="$3" + local getnomatch="$3" + local description="$4" + local nomatch_description="$5" $IP -6 rule add $match table $RTABLE $IP -6 route get $GW_IP6 $getmatch | grep -q "table $RTABLE" log_test $? 0 "rule6 check: $description" + $IP -6 route get $GW_IP6 $getnomatch 2>&1 | grep -q "table $RTABLE" + log_test $? 1 "rule6 check: $nomatch_description" + fib_rule6_del_by_pref "$match" log_test $? 0 "rule6 del by pref: $description" } @@ -201,6 +206,7 @@ fib_rule6_test_reject() fib_rule6_test() { local ext_name=$1; shift + local getnomatch local getmatch local match local cnt @@ -212,10 +218,14 @@ fib_rule6_test() $IP -6 route add table $RTABLE default via $GW_IP6 dev $DEV onlink match="oif $DEV" - fib_rule6_test_match_n_redirect "$match" "$match" "oif redirect to table" + getnomatch="oif lo" + fib_rule6_test_match_n_redirect "$match" "$match" "$getnomatch" \ + "oif redirect to table" "oif no redirect to table" match="from $SRC_IP6 iif $DEV" - fib_rule6_test_match_n_redirect "$match" "$match" "iif redirect to table" + getnomatch="from $SRC_IP6 iif lo" + fib_rule6_test_match_n_redirect "$match" "$match" "$getnomatch" \ + "iif redirect to table" "iif no redirect to table" # Reject dsfield (tos) options which have ECN bits set for cnt in $(seq 1 3); do @@ -229,37 +239,52 @@ fib_rule6_test() # Using option 'tos' instead of 'dsfield' as old iproute2 # versions don't support 'dsfield' in ip rule show. getmatch="tos $cnt" + getnomatch="tos 0x20" fib_rule6_test_match_n_redirect "$match" "$getmatch" \ - "$getmatch redirect to table" + "$getnomatch" "$getmatch redirect to table" \ + "$getnomatch no redirect to table" done match="fwmark 0x64" getmatch="mark 0x64" - fib_rule6_test_match_n_redirect "$match" "$getmatch" "fwmark redirect to table" + getnomatch="mark 0x63" + fib_rule6_test_match_n_redirect "$match" "$getmatch" "$getnomatch" \ + "fwmark redirect to table" "fwmark no redirect to table" fib_check_iproute_support "uidrange" "uid" if [ $? -eq 0 ]; then match="uidrange 100-100" getmatch="uid 100" - fib_rule6_test_match_n_redirect "$match" "$getmatch" "uid redirect to table" + getnomatch="uid 101" + fib_rule6_test_match_n_redirect "$match" "$getmatch" \ + "$getnomatch" "uid redirect to table" \ + "uid no redirect to table" fi fib_check_iproute_support "sport" "sport" if [ $? -eq 0 ]; then match="sport 666 dport 777" - fib_rule6_test_match_n_redirect "$match" "$match" "sport and dport redirect to table" + getnomatch="sport 667 dport 778" + fib_rule6_test_match_n_redirect "$match" "$match" \ + "$getnomatch" "sport and dport redirect to table" \ + "sport and dport no redirect to table" fi fib_check_iproute_support "ipproto" "ipproto" if [ $? -eq 0 ]; then match="ipproto tcp" - fib_rule6_test_match_n_redirect "$match" "$match" "ipproto match" + getnomatch="ipproto udp" + fib_rule6_test_match_n_redirect "$match" "$match" \ + "$getnomatch" "ipproto tcp match" "ipproto udp no match" fi fib_check_iproute_support "ipproto" "ipproto" if [ $? -eq 0 ]; then match="ipproto ipv6-icmp" - fib_rule6_test_match_n_redirect "$match" "$match" "ipproto ipv6-icmp match" + getnomatch="ipproto tcp" + fib_rule6_test_match_n_redirect "$match" "$match" \ + "$getnomatch" "ipproto ipv6-icmp match" \ + "ipproto ipv6-tcp no match" fi } @@ -320,12 +345,17 @@ fib_rule4_test_match_n_redirect() { local match="$1" local getmatch="$2" - local description="$3" + local getnomatch="$3" + local description="$4" + local nomatch_description="$5" $IP rule add $match table $RTABLE $IP route get $GW_IP4 $getmatch | grep -q "table $RTABLE" log_test $? 0 "rule4 check: $description" + $IP route get $GW_IP4 $getnomatch 2>&1 | grep -q "table $RTABLE" + log_test $? 1 "rule4 check: $nomatch_description" + fib_rule4_del_by_pref "$match" log_test $? 0 "rule4 del by pref: $description" } @@ -347,6 +377,7 @@ fib_rule4_test_reject() fib_rule4_test() { local ext_name=$1; shift + local getnomatch local getmatch local match local cnt @@ -358,14 +389,18 @@ fib_rule4_test() $IP route add table $RTABLE default via $GW_IP4 dev $DEV onlink match="oif $DEV" - fib_rule4_test_match_n_redirect "$match" "$match" "oif redirect to table" + getnomatch="oif lo" + fib_rule4_test_match_n_redirect "$match" "$match" "$getnomatch" \ + "oif redirect to table" "oif no redirect to table" # need enable forwarding and disable rp_filter temporarily as all the # addresses are in the same subnet and egress device == ingress device. ip netns exec $testns sysctl -qw net.ipv4.ip_forward=1 ip netns exec $testns sysctl -qw net.ipv4.conf.$DEV.rp_filter=0 match="from $SRC_IP iif $DEV" - fib_rule4_test_match_n_redirect "$match" "$match" "iif redirect to table" + getnomatch="from $SRC_IP iif lo" + fib_rule4_test_match_n_redirect "$match" "$match" "$getnomatch" \ + "iif redirect to table" "iif no redirect to table" ip netns exec $testns sysctl -qw net.ipv4.ip_forward=0 # Reject dsfield (tos) options which have ECN bits set @@ -380,37 +415,53 @@ fib_rule4_test() # Using option 'tos' instead of 'dsfield' as old iproute2 # versions don't support 'dsfield' in ip rule show. getmatch="tos $cnt" + getnomatch="tos 0x20" fib_rule4_test_match_n_redirect "$match" "$getmatch" \ - "$getmatch redirect to table" + "$getnomatch" "$getmatch redirect to table" \ + "$getnomatch no redirect to table" done match="fwmark 0x64" getmatch="mark 0x64" - fib_rule4_test_match_n_redirect "$match" "$getmatch" "fwmark redirect to table" + getnomatch="mark 0x63" + fib_rule4_test_match_n_redirect "$match" "$getmatch" "$getnomatch" \ + "fwmark redirect to table" "fwmark no redirect to table" fib_check_iproute_support "uidrange" "uid" if [ $? -eq 0 ]; then match="uidrange 100-100" getmatch="uid 100" - fib_rule4_test_match_n_redirect "$match" "$getmatch" "uid redirect to table" + getnomatch="uid 101" + fib_rule4_test_match_n_redirect "$match" "$getmatch" \ + "$getnomatch" "uid redirect to table" \ + "uid no redirect to table" fi fib_check_iproute_support "sport" "sport" if [ $? -eq 0 ]; then match="sport 666 dport 777" - fib_rule4_test_match_n_redirect "$match" "$match" "sport and dport redirect to table" + getnomatch="sport 667 dport 778" + fib_rule4_test_match_n_redirect "$match" "$match" \ + "$getnomatch" "sport and dport redirect to table" \ + "sport and dport no redirect to table" fi fib_check_iproute_support "ipproto" "ipproto" if [ $? -eq 0 ]; then match="ipproto tcp" - fib_rule4_test_match_n_redirect "$match" "$match" "ipproto tcp match" + getnomatch="ipproto udp" + fib_rule4_test_match_n_redirect "$match" "$match" \ + "$getnomatch" "ipproto tcp match" \ + "ipproto udp no match" fi fib_check_iproute_support "ipproto" "ipproto" if [ $? -eq 0 ]; then match="ipproto icmp" - fib_rule4_test_match_n_redirect "$match" "$match" "ipproto icmp match" + getnomatch="ipproto tcp" + fib_rule4_test_match_n_redirect "$match" "$match" \ + "$getnomatch" "ipproto icmp match" \ + "ipproto tcp no match" fi } From patchwork Wed Aug 14 11:10:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13763354 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2043.outbound.protection.outlook.com [40.107.92.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 BF9714D8D0 for ; Wed, 14 Aug 2024 11:11:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723633881; cv=fail; b=Zkydo47KXSM/p8TF6nTd2tvHOnKvtWRsAxqsLHdXOTDgxbpSQWY+hh4TgGWGojz1gsf/CoGE5ViqJViv7pLbPJ8GMRfm1PwjPDBuxUiPGCoLtYphBMpTAw7J3ictaqC9pV2TsI2dtZXDjFVb9nTIcpRdL6zMLMWT9aWoAdBGl9U= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723633881; c=relaxed/simple; bh=b1uXA/Cuj4qQAA2MJ7ycngz2m3hSfwxmuhhNYT8bJ68=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ozx7toO9Gy1qOuQZ965KxG6rGXC4P3w0ToGofNBxS+kBNDCDz0Bq6Ta/p1o3Y3YOS4etjT+/ILW50c+42zoALu/1GgUfONwvPdEL304IVLhmPVBiFpI7qun2ybPkmYBS6vPkDXaY9b64PhhLH9E8PKWuL4ZxTKr6iRXEcol13o4= 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=upOt/uam; arc=fail smtp.client-ip=40.107.92.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="upOt/uam" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RuzbxXZISrF317dst4zKtqdnW3a5ie7YWOt45GLIV+J+KZ3f2tprqev7MeNXuogP8S0kU9BP54Rr7qsSMsPMoVtKzHAr3A5oyOWY4DsTApEkHwc6rRI8jRJRSVzSPVEwWITnlqIPJBiYGD0fsyvstCjc8ZIu7GvsDwwzz/1UGR3oU2NILN7ZU35ZOnEXRTfTH36uRRnCRP0lD3lGsuHaHevPPbkEyXv7+PP3yzjYU6OZLfS6DwTVfNc2vsWeD6Hq2fP43S05OFzCQCpfP/I349Pq06RH3TNaU1JCqeQoJ2jK0L1C870y/vN2FinqN0m54x8QpLVsHCFWK34egKJE0Q== 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=Se250rGtBUF1Yb0OQz7Us5hpkaBHcB9wBVqzASmNWjk=; b=bBCnXntS5/QPu6avCQvgDqGEGQ+ZdWT7sJO1V3fqjWibxkeQ8ypyAh/bzmHu3SH5iktewsdZby4pbXbaNiykkwfJAb+Ch4ZeZRqHqjz5PvRsDEPSEWMG/CUvOxFxm4aiUq7lbMic2a9ruFNEUf9Oy6Um2dQ6tjZ7fP2Gzy811IKrS9zxKPI9DVakq6o2vW3ffx/xwwo9ZppiYfDMtOcFPLTxIC9dS8jDsCLa23MAyxvmxAsXw1CcYvd1hDIOXqgTXwA6WjRZkCKt8jNijPFJeCTFMujWeM3kqM/82cvQCEybZdEf5NqV4lMaOG6cgJy2jEatt0awKy/23d68PP5cyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=vger.kernel.org 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=Se250rGtBUF1Yb0OQz7Us5hpkaBHcB9wBVqzASmNWjk=; b=upOt/uamcYOj/wSVUwk6QECdBzhi4pK4/PIfWmKXIkq9Jw8zN0jMrz5CXm+Pl7+6u92cj0EySLruNXtpdwX4d+QeSNEPB8WaqJBxusBZtaFx7EnJqiSDHqhcFgsu6NP8KZ37dVnqQedWBX83fd39oc6hoXtXwkrsJN79OBZuoi8fv9a04YSgVAT+NCNY0qrv3zRm5IEfJ7Tm/0pZ03JHqwrx/EgUQ7wdGJV+7jr/hT262Jk3AIvr1RmiFsO9S644bu0R1GqB4lgA15s6YtJBTtR0Ldnb4VO3T64o3UvWj6dvM4YjPKb6nqfK0qSae7ixDMYeU1FLPUHjShi6fy7/FA== Received: from SN7PR04CA0092.namprd04.prod.outlook.com (2603:10b6:806:122::7) by IA0PR12MB8421.namprd12.prod.outlook.com (2603:10b6:208:40f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Wed, 14 Aug 2024 11:11:14 +0000 Received: from SN1PEPF00026369.namprd02.prod.outlook.com (2603:10b6:806:122:cafe::8) by SN7PR04CA0092.outlook.office365.com (2603:10b6:806:122::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Wed, 14 Aug 2024 11:11:14 +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 SN1PEPF00026369.mail.protection.outlook.com (10.167.241.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 11:11:14 +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; Wed, 14 Aug 2024 04:10:56 -0700 Received: from shredder.lan (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; Wed, 14 Aug 2024 04:10:54 -0700 From: Ido Schimmel To: CC: , , , , , Ido Schimmel Subject: [PATCH net-next 4/5] selftests: fib_rule_tests: Add negative connect tests Date: Wed, 14 Aug 2024 14:10:04 +0300 Message-ID: <20240814111005.955359-5-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240814111005.955359-1-idosch@nvidia.com> References: <20240814111005.955359-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: netdev@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: SN1PEPF00026369:EE_|IA0PR12MB8421:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f567da5-bd5f-4e80-a79a-08dcbc51d006 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: FurQCSbK0Pv5SF0kklMMB34cLU+BDeTsQAmtVgC8I8Q28knZoJld9SGeEReTPniuh6sa4B6vCJe0eEG01RXpT6eHp/zD9bS8gtOVQE38D4e4DJjqgUXJdJCbA55OOj4eGeSPCNQ1P1HhuwzABRzZd3WaYJGtd05jwbCu9qrfAwiTEM0jhS/0/VE45AoKKMZahmncu0PuLd13HzfM9rFYtOGzAb297pvwd6RAyOSPUC/d0YuuiMXpagq5d8y4qRwsja2M10MDAD9iQ1D8u/YTtczBqhSzdl+6pt4FATjG+/AzUX9AyTCmuOgLHjRe5klLsJmeW2Najh5kcsO/MGo7IPmI/XKG4oEO2d9A9u6GQYZefWJvfApcYrsLPOVfqyOjaK8Tmym0Q9Xnm6+mbsKrGriW86dGrUPkt05U2hvOtm1yKJOkCrI9AaqBICJZxGFiP9sgVi63D4nRVPJZrUburE1Z+6vwEfzIQK45TaZOZySbkRnhHcmVX8sCZSGbQvM5JLrPvxyVO4ttXgicYi1mWt7IqStrxhEz/U4nlWuMDwKMwP7wR6oLQSFWDv0RsoXgMbQ5JGIq5wKCweSA7nmR+vTzcFTQIj6RqIxHyTURBujsK9tD7HFfbFWsArvFlY/RNUOWC4kdSEluaA8+Q+aN4OOdY8AqJtE1I+u/Qc5lN3Df8JXFEJ+6/er9/ITFLofvVq3Q2W9Zqum6TqjBey8QG34ZaFw7a47+axOONtKABWS0wKcsPi/ImANA6ZkFAytkK2/2TS7FISEqOoSziwrSpEfqfcyiNMBBS4gVlq6rRt1n24hyadNrY7HiYxCYIH6yuIWgcsEnl4j+A3+fAlupYRyeybEdCxEQgS9VhOG9h3sHcWMNZfl+fQGlhfbAFqyiC7gpXhHWH249znNwAAcH+TAdsKPvdDAw1QI9EbNjU/jxRboRRug1hMJNur6LTS7CMnc4kHz0FhcI0Me2bqXvAEdQDRWVIkL1OneEJDjeQjx009EQb6/So08QMRMXCAIbeX9XwIpggcWDX10hm6A1xpDwtgjr2iIkiqsQ9+LSsPNSATzm+SNawhJZNa6tec16IWzjn5zQIqJDjbx3iQS9+fWz+zmnRzOUWNL6rdUpFBIxxdRCMmyBe4M0jK1npSOtB4UT+d6zHcl0wV2GOqdedcMKvulWA5mnXvU2TN7aZetW+B5bDDSi1ZGcqrL2UgtBMDwgznRaNP652u2lIfz7W8wdCq9ql4YdKWBs+XDuuJl1QKFEJGEAKc0bEcJEV8hHA4AETUhx7esqkiIPaAZIEaVNUEcHctpJIZvOcbht+Zw25lObRVL8rfLy6BxM7u5gu3IHZwrLJZGnDy97NFTcL3BdPEd1eV4ng8zA0D44qbSSUV6mfIzMcRS3YsNALwCDxTpraiBTnarlKVQnKeG3+WzZypgLqPKm0Zolpsy3THHP8BJk+18uTjB3Zo1ih9Jt 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)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 11:11:14.6831 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3f567da5-bd5f-4e80-a79a-08dcbc51d006 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: SN1PEPF00026369.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8421 X-Patchwork-Delegate: kuba@kernel.org The fib_rule{4,6}_connect tests verify that locally generated traffic from a socket that specifies a DS Field using the IP_TOS / IPV6_TCLASS socket options is correctly redirected using a FIB rule that matches on the given DS Field. Add negative tests to verify that the FIB rule is not hit when the socket specifies a DS Field that differs from the one used by the FIB rule. Signed-off-by: Ido Schimmel --- tools/testing/selftests/net/fib_rule_tests.sh | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/testing/selftests/net/fib_rule_tests.sh b/tools/testing/selftests/net/fib_rule_tests.sh index 085e21ed9fc3..a3b2c833f050 100755 --- a/tools/testing/selftests/net/fib_rule_tests.sh +++ b/tools/testing/selftests/net/fib_rule_tests.sh @@ -325,6 +325,16 @@ fib_rule6_connect_test() log_test $? 0 "rule6 dsfield tcp connect (dsfield ${dsfield})" done + # Check that UDP and TCP connections fail when using a DS Field that + # does not match the previously configured FIB rule. + nettest -q -6 -B -t 5 -N $testns -O $peerns -U -D \ + -Q 0x20 -l 2001:db8::1:11 -r 2001:db8::1:11 + log_test $? 1 "rule6 dsfield udp no connect (dsfield 0x20)" + + nettest -q -6 -B -t 5 -N $testns -O $peerns -Q 0x20 \ + -l 2001:db8::1:11 -r 2001:db8::1:11 + log_test $? 1 "rule6 dsfield tcp no connect (dsfield 0x20)" + $IP -6 rule del dsfield 0x04 table $RTABLE_PEER cleanup_peer } @@ -502,6 +512,16 @@ fib_rule4_connect_test() log_test $? 0 "rule4 dsfield tcp connect (dsfield ${dsfield})" done + # Check that UDP and TCP connections fail when using a DS Field that + # does not match the previously configured FIB rule. + nettest -q -B -t 5 -N $testns -O $peerns -D -U -Q 0x20 \ + -l 198.51.100.11 -r 198.51.100.11 + log_test $? 1 "rule4 dsfield udp no connect (dsfield 0x20)" + + nettest -q -B -t 5 -N $testns -O $peerns -Q 0x20 \ + -l 198.51.100.11 -r 198.51.100.11 + log_test $? 1 "rule4 dsfield tcp no connect (dsfield 0x20)" + $IP -4 rule del dsfield 0x04 table $RTABLE_PEER cleanup_peer } From patchwork Wed Aug 14 11:10:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 13763351 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2067.outbound.protection.outlook.com [40.107.223.67]) (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 E757B1AE864 for ; Wed, 14 Aug 2024 11:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723633874; cv=fail; b=EbQNJ+esgXlrunxyl9cB/Iw9bfb/dY+kFqU07k9MdqnE7EUN0lslBzfkbbHihAEw234GLavhAF06F7/s74TXkh/V9W9Xq+fAJ0gHO0aKMVdegKSK6v1s99hOJzroIkVivWCH9a97RNcZqBaMrZhTunZU0fT5EALbwg3Ao0xSr3k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723633874; c=relaxed/simple; bh=FRwN8BANTa4Ks7L3/XXI8SzCnUAzII81YWVFQtRri98=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Zm0N3gr93V5IyHm/x6iQq/YlgU9qBdOWWoGpxajknbQZLlIUTPy05j4V6hZDWqS1Ev9/UP0pG1ekC4pgvHVDUxKwV7H5Yc6Qg5X1Sy+zGW1JO2MFPTa/GZEFo1CmYnUjeVn1MmLfPjnVAbellnqWM0FHJ2gWBPASrkU0ZLqSspA= 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=upoAHkgZ; arc=fail smtp.client-ip=40.107.223.67 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="upoAHkgZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cCTTLIEZ0bRFc+jlnLUGwtKqthnK1obSwdioBAU4g6U10hF0N6oxja0m3h9QvFVuSa0BUYajsa3E0CEXHBRT5gdj5ynBqZ6UuI7x9jfTMl+21O4xDtGA4q8GMgwRxt4co6uh2E2Hz1Q3Yx9S160Nw3Mf5eE6RDsdV7TeMqNm5IeHUDnqM3YBeXwLHZB4Zodrku0nVPolphiVOLYpiRhnjICIxG121zVGBir6pjA2o+iflXAM3S/C8cR1yZC9z4h6CXJ6OwB0bbm+oQWoybHiBdGIYa7BPhiVSIonsVN9B+lCYQ/lxNt0Enf5pU2Q+D1KvtmxfajLG4Xe7ptwCvA6Ow== 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=QAVTBI5D9cU1Ntqv47jjSzItE+cSP0RlwvAcrY0SGyU=; b=HCERR5CiTOIXslh/lbfPImC4tz/7y6gLGHsYwZp+IOaQSLi4Iv+iVRnwCvuHGd/x2AomxW04z102D7Qpnga1hfPcgmBAKklFZR3XQG3+Ctu3sHg4b+Ci/dlXv5EMq76sk1iLepey560FupZxTDQ6GfF6MM4dcW12tkBGSEcUpXo8fhXipIaP01wvF+rBhJqTIKvwEcNF0Hzma0cY2/aTekjcVxxYlcM/eyHWimhC1T2LtvuniqJ96Wftr38cB3cJXnDBAem2EFDDNV2tIurioddxmi8wxaqc/yIOv7QZkPB5hZi8mvsbC1Eh6vU5P3u/44n13B0uMU4tYmgXb/bVtg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org 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=QAVTBI5D9cU1Ntqv47jjSzItE+cSP0RlwvAcrY0SGyU=; b=upoAHkgZTG1j6T0b7HVLxnc/UzxcL7mLNENRHfGvByX/4/seeKLov/lQh9KnpYln0uP4IesguyIZYNyK/mqWKZe1jIbepcaOAWC9GAbLoO96vMd6QCvYatqob8lfXORvpmja7SVccn65AxCE6LboZMFCflC0y/CsJ9yvDDJSslQhdU0PuFsW55HPw4uTN1cHb9o86RWjxPrYQtNZ9jmJPcQLSqQCMFsgUfVMgPk/uGmEWAPiqHLC0+w5R0FM0HZ9MSbr4BiJwM2kwjZxKZGix7Vy1DE8a5Tn7CDI3JlbB7c8i/dA/gAMNtqo68VH2bqTFRnyWOqPfdbD4dN+K87iug== Received: from BYAPR08CA0029.namprd08.prod.outlook.com (2603:10b6:a03:100::42) by DS0PR12MB8766.namprd12.prod.outlook.com (2603:10b6:8:14e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Wed, 14 Aug 2024 11:11:09 +0000 Received: from SJ1PEPF000023D2.namprd02.prod.outlook.com (2603:10b6:a03:100:cafe::de) by BYAPR08CA0029.outlook.office365.com (2603:10b6:a03:100::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Wed, 14 Aug 2024 11:11:09 +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 SJ1PEPF000023D2.mail.protection.outlook.com (10.167.244.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 11:11:09 +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; Wed, 14 Aug 2024 04:10:59 -0700 Received: from shredder.lan (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; Wed, 14 Aug 2024 04:10:56 -0700 From: Ido Schimmel To: CC: , , , , , Ido Schimmel Subject: [PATCH net-next 5/5] selftests: fib_rule_tests: Test TOS matching with input routes Date: Wed, 14 Aug 2024 14:10:05 +0300 Message-ID: <20240814111005.955359-6-idosch@nvidia.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240814111005.955359-1-idosch@nvidia.com> References: <20240814111005.955359-1-idosch@nvidia.com> Precedence: bulk X-Mailing-List: netdev@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: SJ1PEPF000023D2:EE_|DS0PR12MB8766:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b82482c-44ae-4d86-5ce5-08dcbc51cd01 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: 3fwpllWoFVWq75RRM+ptS3TusQsOi6dgBj3JuMUNmMNEvewPRQ1ckfBSZMLMjoDrXbqBNBWuFBiFZYjgJrHJY0Kl3rs//f965mYiSd0+XP7mbRzC45i7H8AHJWAUqA7wxhOxEhLhqT3hqIH5HGvF1UH05379alok10jWsdTOUXthjo/nHNInvdr2epz3pNaXLVO/uhT0o6D0og2yQmbesFB29GVhCulsWWYy1x+TeRQSbLow0LTmHNoSm5PFY24FTOybMGA6DIWGoqIltvvzNe1cYFZBnB9Jg0pVhn0x3IG9KrXvbgIfikBxvDBFit6lOPtdZilSXRM20K0KZuUasUc0HioNVqw0CJynVYX80P2Dbw3j5HQnyijhxZMcVlKGetsSYEC1vdevXAxp9+klG4t68IRkO/oDjD1jfm7y6Ph0pnkP01E9edVXlsVpV7NXCMbOhgiA2L7aFFpYTlSKfp6khzgJopVn6guuHtu87Yyi66wMvCMLV2BYYS7sTLqQv+qCQ4tMq5a9RghoABpHeY277Gdnw6Z+MQ7ZVXEkn+ZpzyIKnndXzYDFlQvqjUjZrDNJRAQeme0LqH6r8cXnvtUVqq2/0M7CI/ikhfoLYU0Zzbtv57MTL2GkTF2rIFTSRtMuM1/po0nM43wthTOHwT/90yj3/3/mzG3p4J+4w3isWNDK8fXeVGdLeIRpboTLyYqwnnHrMcUGf8kra+OA+4Qz071t4X6D7/q0iXqIuwtx2eZvQxdAaWQsVgH3BfpD 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: 14 Aug 2024 11:11:09.7246 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b82482c-44ae-4d86-5ce5-08dcbc51cd01 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: SJ1PEPF000023D2.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8766 X-Patchwork-Delegate: kuba@kernel.org The TOS value reaches the FIB rule core via different call paths when an input route is looked up compared to an output route. Re-test TOS matching with input routes to exercise these code paths. Pass the 'iif' and 'from' selectors separately from the 'get{,no}match' variables as otherwise the test name is too long to be printed without misalignments. Signed-off-by: Ido Schimmel --- tools/testing/selftests/net/fib_rule_tests.sh | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/fib_rule_tests.sh b/tools/testing/selftests/net/fib_rule_tests.sh index a3b2c833f050..89034c5b69dc 100755 --- a/tools/testing/selftests/net/fib_rule_tests.sh +++ b/tools/testing/selftests/net/fib_rule_tests.sh @@ -245,6 +245,19 @@ fib_rule6_test() "$getnomatch no redirect to table" done + # Re-test TOS matching, but with input routes since they are handled + # differently from output routes. + match="tos 0x10" + for cnt in "0x10" "0x11" "0x12" "0x13"; do + getmatch="tos $cnt" + getnomatch="tos 0x20" + fib_rule6_test_match_n_redirect "$match" \ + "from $SRC_IP6 iif $DEV $getmatch" \ + "from $SRC_IP6 iif $DEV $getnomatch" \ + "iif $getmatch redirect to table" \ + "iif $getnomatch no redirect to table" + done + match="fwmark 0x64" getmatch="mark 0x64" getnomatch="mark 0x63" @@ -403,15 +416,14 @@ fib_rule4_test() fib_rule4_test_match_n_redirect "$match" "$match" "$getnomatch" \ "oif redirect to table" "oif no redirect to table" - # need enable forwarding and disable rp_filter temporarily as all the - # addresses are in the same subnet and egress device == ingress device. + # Enable forwarding and disable rp_filter as all the addresses are in + # the same subnet and egress device == ingress device. ip netns exec $testns sysctl -qw net.ipv4.ip_forward=1 ip netns exec $testns sysctl -qw net.ipv4.conf.$DEV.rp_filter=0 match="from $SRC_IP iif $DEV" getnomatch="from $SRC_IP iif lo" fib_rule4_test_match_n_redirect "$match" "$match" "$getnomatch" \ "iif redirect to table" "iif no redirect to table" - ip netns exec $testns sysctl -qw net.ipv4.ip_forward=0 # Reject dsfield (tos) options which have ECN bits set for cnt in $(seq 1 3); do @@ -431,6 +443,19 @@ fib_rule4_test() "$getnomatch no redirect to table" done + # Re-test TOS matching, but with input routes since they are handled + # differently from output routes. + match="tos 0x10" + for cnt in "0x10" "0x11" "0x12" "0x13"; do + getmatch="tos $cnt" + getnomatch="tos 0x20" + fib_rule4_test_match_n_redirect "$match" \ + "from $SRC_IP iif $DEV $getmatch" \ + "from $SRC_IP iif $DEV $getnomatch" \ + "iif $getmatch redirect to table" \ + "iif $getnomatch no redirect to table" + done + match="fwmark 0x64" getmatch="mark 0x64" getnomatch="mark 0x63"