From patchwork Thu Sep 19 00:48:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 144291 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E9285459CB; Thu, 19 Sep 2024 02:48:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7870A40156; Thu, 19 Sep 2024 02:48:49 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2076.outbound.protection.outlook.com [40.107.243.76]) by mails.dpdk.org (Postfix) with ESMTP id A34DF4003C for ; Thu, 19 Sep 2024 02:48:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bakZzomJ93zQcvz3MU2quyMFuE7/A5X7q3fA1HiQX6DlmAt5/VYAIv/p858SCm17QrFTc2i+OcQOedPUe/0ev1fyn4HFGEbn9U2aizh5oynC8ZPMrtRmyNEyT2rqhdpraU1eu9lQZePYmxAtKj1eRfMmv/btcUD1Gm+BxcD6mP4Aza8egRPTpQZq97xNaThutfoj5pv0AT6gf9A3/jlFrCWsrxgs1hKgKHlzdMlqIo1X4BvUxhJSE+i7QCgvhq+UwFG+epY1GtXDSEXc+BlS4mjThjU7+9rchiV2IJ2G/IO7nlGmnhVsiKiI6nGy/5OOKPHlqNNmnedgQSuI6zmKqQ== 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=wWu3HoYo4UtjF5Dq9xobwo3UwkW1/5RiBES8DN5YIfg=; b=R5ZxZReFr3a522lj+XAHxSgNNnMh3wnBBasI3bvV58c7zeuDsgzFUphxzO7yOYUzL2uQWbwL81tZfeTGXlr+83Wkrq25jIE4ukC1DyDUQWBQozJH4LjOu+X4nMgztjT4INqFkkuZoff/x5JzGju9aeaDneCI6edep2RwUqHUn1aoI1gdhoCwwZbv0TJKivbDKrewkJi0syQ4swbV6tYyge9zE5mDVJrjqS6qkHZbeiW2+33XlaCNpoRrBF9QlmabrLKwlwS8dzAE3AWxvhU+AprA/N2NMMuqnWZVjIPPA1sgSz+FPEbzI270U34al77l/aOl+6yMjhBdRUR3iwmfoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.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=wWu3HoYo4UtjF5Dq9xobwo3UwkW1/5RiBES8DN5YIfg=; b=ayAsZn4YUgiTQx6/wemFjIxMxqsFVdhPwSHeaxdY0sKQWdEUj4vvVjA9DFAaK5jjM6b/hlRK1EJI/TaqFxE20GD09BkjLihreWB0rdap9sLcLLo1gtDWIor5Zh8k+uT+2PLwnoSc26hMO0UcPjJ/O4vBpTMNRogfXJo/vvZdJAipnSpV/QviiAsdptFoeYSOJFNmK+PAB6TwcK4q6AtVHfv/gB1Wi0k58Kvr5bUJXnVMgWRhTmv9Vn9dKEXJIPsd/BZ1qh+KNr9SQB2U9tIR3rma9gYYCQ8cTtnBpmK9yNRrniGfPYKjylnbus8IBkY7uJB97Gcaxs0fNbmUySbmoQ== Received: from SJ0PR03CA0017.namprd03.prod.outlook.com (2603:10b6:a03:33a::22) by SJ1PR12MB6313.namprd12.prod.outlook.com (2603:10b6:a03:458::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.26; Thu, 19 Sep 2024 00:48:44 +0000 Received: from MWH0EPF000A672F.namprd04.prod.outlook.com (2603:10b6:a03:33a:cafe::8d) by SJ0PR03CA0017.outlook.office365.com (2603:10b6:a03:33a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Thu, 19 Sep 2024 00:48:44 +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 MWH0EPF000A672F.mail.protection.outlook.com (10.167.249.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 19 Sep 2024 00:48:44 +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, 18 Sep 2024 17:48:34 -0700 Received: from pegasus01.mtr.labs.mlnx (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, 18 Sep 2024 17:48:31 -0700 From: Alexander Kozyrev To: CC: , , , , , Subject: [PATCH 1/6] ethdev: add insertion by index with pattern Date: Thu, 19 Sep 2024 03:48:08 +0300 Message-ID: <20240919004813.3158356-2-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20240919004813.3158356-1-akozyrev@nvidia.com> References: <20240919004813.3158356-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A672F:EE_|SJ1PR12MB6313:EE_ X-MS-Office365-Filtering-Correlation-Id: a32cfd05-05b9-4c91-73b6-08dcd844d073 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: eXNZWcb3Cv+Ok/lOXsEteQc4QQp049YrW8BG0qCJXx/YvtnY422m+ttbA51TuBtVZqdT2BJ+YE0xjPHk6p1N3U0L3U+xi26fOPPzkqMddlsy4H0eYDBV3jq5SYI3ATja4OBXioNuDWQX2J6e0IGpmDuptX0iA+ivwtyziIeWd8jWRpM6pDJ1LpoQnT3a4jL7VbBsil8U283J7P3LjJrxcmjbRgOQ8glZrrKerTGpc5p/o5azWgBC5TrIt+7J/YDTTqFK/FB1EWGGpJJ/D3ndbiG+8LSbzL8PfT/eMeJiMzXs8d7nO0aVZX4OvUvTj4G9mqDkxNLVW/yrw/2xddFAVPAimFauukLWMfizYcKKiMR3COKdnPB8dFGg8p11Yb7Yt+rkh5+NFgui3NfEAvfLY0EYmYSSJjc5KWdEBkRojcioRzr2rpfz0vK65nVMxb2KAMPU2xRsxKoIFvyzU0y9uPkfjtR2aGRnzBGdVJjDssTOhZsSDOXHpy5bLXO3lllvm/TQH/yw0LYA4DuHGNnSY6iMtyhtWBFBBahH0+8pNATDSPShEdoa761sp1uYIbQMm8v+q8FIvkKHSzHyEuq1YvFHla0Y6JFMIdOEoTnJNCNLok1+x1NJ3IkS2S7nZFKuSp57jd/Zjg/ejFZjC+DXQDmH+0ZWafDbw2RI+PDq3V+iuZqfAIf1o9WZXkb99y3wK6G3Nxo1VcVDR+3Es6s3pECi+2zHFFt54z9von8uGFJjgpks6izpF702+0qkrjrJ3c4kX6QpeN8ICoJxk0/TBq0Lzs6DAds9GIAZrjMSPfHKXF/2e4StpF4OJB2241i0YorFN4NjCwxh+Ad95j42z620POmYULOkDB0aMkAaF//F1fnc9mTVBbUQwHDOKX4i84kXgU3JV4MZ5k9bN3yH7T97Em55VlHkTgTqYjedz+8CGmNhvmJ26quxge8FyV+ZEUQuFlkPC+94fL0g9zw2QctvVZF/1iBuxK6Jf9NTLuN/xzfBuB9jjCbSJdntUlJXGY3IGWGh1oHoZwOtFFVmhwlX8FbTVvVL9zzmyRVF711Rs702ZfYPdwB87T2nyTOLessW5WMF032sEogcEf8XEcfkCwysJoYnTIO9ggbZQO+M+pU9gd4HrpKfmnMTrPIKd8P+CODJOa56p71qAq60o49UA5Yxs+jYSQT0CPWaLXp0dIkd2+tLZr2aG7OE4192N67hZonM23neTY/3Xd1HjIon25ZYyAZ76ZFzw83F5bP/uUVEBIliBe53rzsXpb793SMbGYuHxVVCQqdl8HA3uVtpUC5EP3FjDZDVlTXDzJCjSi1rB3sTEqgT9jcWrV0FmLQDiLoi21fjTc/cEQ4US3DWzZ9V7adeZS8usYDKkYBah8VD+I45UCeJ4HHRTEflSzO99WyhxdKq/N0FVqEcAvedcmPVljmpI4x47cXQySNyipV1/exfMzAk+dDJi23Y 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)(36860700013)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 00:48:44.4964 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a32cfd05-05b9-4c91-73b6-08dcd844d073 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: MWH0EPF000A672F.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6313 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org There are two flow table rules insertion type today: pattern-based insertion when packets match on the pattern and index-based insertion when packets always hit at the index. We need another mode that allows to match on the pattern at the index: insertion by index with pattern. Signed-off-by: Alexander Kozyrev Acked-by: Dariusz Sosnowski --- doc/guides/rel_notes/release_24_11.rst | 4 ++++ lib/ethdev/rte_flow.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index 0ff70d9057..7056f17f3c 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -55,6 +55,10 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added a new insertion by index with pattern table insertion type.** + + Extended rte_flow_table_insertion_type enum with new + RTE_FLOW_TABLE_INSERTION_TYPE_INDEX_WITH_PATTERN type. Removed Items ------------- diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index f864578f80..6f30dd7ae9 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -5898,6 +5898,10 @@ enum rte_flow_table_insertion_type { * Index-based insertion. */ RTE_FLOW_TABLE_INSERTION_TYPE_INDEX, + /** + * Index-based insertion with pattern. + */ + RTE_FLOW_TABLE_INSERTION_TYPE_INDEX_WITH_PATTERN, }; /** From patchwork Thu Sep 19 00:48:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 144293 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4CB35459CB; Thu, 19 Sep 2024 02:49:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 62047432F0; Thu, 19 Sep 2024 02:49:00 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2085.outbound.protection.outlook.com [40.107.223.85]) by mails.dpdk.org (Postfix) with ESMTP id 8EA7D42FEF for ; Thu, 19 Sep 2024 02:48:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JcBPkCHysVh9FJhZDJ4RhKLJMK/OuDy7TALPe9Bq4bwcf+9R35ergQY/pCeKVR31C1zFjHDmx2NDWA9eBKw+cDJs+ie6i+ox1GcL3D1t/u7ugOiIGCZtyq5rl90hVMCKwuFaELwI1wWTD7bqVDlPBcv3hmgaVQMKgA+QTWk6xdx2Zkt+u5ve0hO+6TTGkZkYAf9IjQk7T+N9eY0Tkcfex8WZbAD64qeXoRY8+fkWh63uQA3SYCrvJIeClPRGEuGcuU+URpNUjAcmYBO3h9McmERJFJL4sLGS7F9XebUzbSlS35139iRcIfZJICwSXt6eMcooEF6NlqHheUR55Aoi3g== 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=wWiHynE+m9o7JtQRq+c6rtsBJHQk68UhFiNgO5uKmFc=; b=SyCwUyKEUgZGaxml2jpWoOi6eXQwxMNOogxduRZeqPOZZNilr6G+CDWNGjiWH0kSrXlXGA7koob2Q7JNVjfRNWX7qF6GWeqaKxnOpM0J6/k4V27wpkFuDCR/lxW3bPb9PWUndwf1n60GVimYG3L5cBWsjMnnlj9iLEoosJ0R5WrrQcsAAsma3LaHhH2ZZ7AaNafZLqwaB429Z34Xrl1DTs+QMv9LnvJSPGTckvC2SkRrdCJ1OMYX8aTAh1YrvqiojbviPmiNjKhTFPNw0le8OqY+GO5RcoxSOU9cm7CRiUpCEWB+kHbaohm5M7kYYiTlbCb4tE7+/g7Ip5sonjGfvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.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=wWiHynE+m9o7JtQRq+c6rtsBJHQk68UhFiNgO5uKmFc=; b=ds3XsqJ0Jjc2ClvaBu5fCk3DpmTEM87iFVnrZLSRjzdfDW5DXjjJMp1t2Lg54kPVv98izVVUN0Jr9R54Tx4Z1aBpl1ASroEqb5p3n3yCja4TIxIJRVxYQ8ajQAxZBK+ufSnm3+VjbMn4bd8liDX6i2IrsQ57x07owfeOsFjhri3L6rAlNAWqeC8lq7BWZS1bpwboR3Kl19naQrEICDwZKVc7xRumpH2FUbrDGNMsz4sKAPtqzAFNV/Pm5jhXDdTYJGkytffpSTqpIHwXOugclV9ZfvgANjgW6YX366HKLJpoAEN1tmzAu8twwUjsaemSXtxJbCuCQ8GZBJmXn8ahrA== Received: from BL1PR13CA0289.namprd13.prod.outlook.com (2603:10b6:208:2bc::24) by PH7PR12MB8595.namprd12.prod.outlook.com (2603:10b6:510:1b5::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.24; Thu, 19 Sep 2024 00:48:53 +0000 Received: from MN1PEPF0000ECD6.namprd02.prod.outlook.com (2603:10b6:208:2bc:cafe::ea) by BL1PR13CA0289.outlook.office365.com (2603:10b6:208:2bc::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.15 via Frontend Transport; Thu, 19 Sep 2024 00:48:53 +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 MN1PEPF0000ECD6.mail.protection.outlook.com (10.167.242.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 19 Sep 2024 00:48:53 +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, 18 Sep 2024 17:48:36 -0700 Received: from pegasus01.mtr.labs.mlnx (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, 18 Sep 2024 17:48:34 -0700 From: Alexander Kozyrev To: CC: , , , , , Subject: [PATCH 2/6] app/testpmd: add index with pattern insertion type Date: Thu, 19 Sep 2024 03:48:09 +0300 Message-ID: <20240919004813.3158356-3-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20240919004813.3158356-1-akozyrev@nvidia.com> References: <20240919004813.3158356-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD6:EE_|PH7PR12MB8595:EE_ X-MS-Office365-Filtering-Correlation-Id: bc73137f-b8c8-4f20-f754-08dcd844d5b5 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr 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: RPpJd8hZ7qv3rrmH4+UhvR+GnAAWvNCsRTxMiXbXD7RBHCWslRjjNH6+1mZysuHmxFpsnyNhEuCSJ3hs3P5zHIboi9sjsWHoCPigntbJktrfF8zpDLrfvVOiYNHirJWRuJ/bY4rgIRoDUsBngKTYj8Dg5cLgFZLslJQN1HpAFS3jRtOOY3hGjAr4mNrrfG52w5ZB3g3Xen4PdyYqa7SzyRuEifp3olvP6wXHGAB7F3Rzg1Q8MeiNn0SS6xp7MaDyCnp6C0GBG5G/Qblpftytb/AcYyU2LD2nEZIAFS9G8gtgOyJcbLshbYRR9A4dewL07XpLSLA2vglem24xIjk+U0cZahZIFXwizMImxNSUCbqmFoj9zlJcr83aAeWgstToDOBfnvzoWkkkqxUMEbS7xNbMPKHD0pAPweOSFRi2f6Mmd9BGle3YGxnSVdUhx0Zju6G734LhCCYudb5r4VZ/SQBAJ3AR32pHzB1Hh+Fi5BM2bfiNTnuNopBLqSNQuUwiFW15Z4BJeALYDHeZbSgqNFKVmYHUDWS4PaeFEwWkh67hFge+kMS/TZo0aOvyDhJEXDExx0Cpek7CCqHT4pLirxz3Bv45NA1UinA95GevM3gqMzpitFc0KGeKUAYT6z7d0HAGNfVevk80Xp/k1l3cE5LlY1dFF8JQmTksE6f9WsGjeLlCJmV3x5X16i5EduPnF1gYyQK6UYbm2rUqUKOy4f+urAwd6QukpWLO1aypbTmulOz3xvh+kXSVEmzy3MVhNnb6cmjeKKKgxQyTEkbUwGzd7oNKg0a07/jN+KPrES+rBc0TgvkqHOWdKWHHh/kShsb6eIBGCK7+MaOJN0izg4I7H7JdgNPWjswY6N/cSCOxIH5v4+roDqnlXXXtNsCt5DZQAaZBCi1Hppd1pye7u1oyhVbzHYja6dbqnVZpmRbSeZ0rxpbVuYl/DXemYK5UBNqXzOViKy1y267dZydRYx0cY6rQLOiEiJSCL157AAdcER5/xu9tit1rhsGQQ6X5vxeFy4fyLH8avQ973baZt6rxc29YY31v5LDriNaYvVrsWmVNDnLsPAqIoU1ykouCmibvU8fOlz3DnaesOYL64Km4CwxK6lx8SOD+HCjYKMDhs1gRISM0sidlR0JotbBkL8Ms7LVfII70u6Ba1i+D5TLv45CfRpOMtVeauyceX3sGcddq+LdZAk5KERvc1sevGqt6N3f3vF8pNDOFUAuEePwfe8wSYXdclSifVtptK+RRzKNrvQiYdPHuZ3/SYlZc7ZJMMA0MBbrK4SUVTx/803cghx4iBXXhDLg1DK0A4D5cj1ggPb3xTMHZpMJBAMcDSAJWWcAtf96j3wNEK5dfcSaXd4jfMKoNbyOiIs7YNC+NbTqJL9WCDGtB9MX2LQFML+wc/b194zmjOX9oyBHNxd9g56oLmoghmESejKslQ+B8TceauvuuDNVnU45b0rMd 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)(82310400026)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 00:48:53.2740 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc73137f-b8c8-4f20-f754-08dcd844d5b5 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: MN1PEPF0000ECD6.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8595 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Provide index_with_pattern command line option for the template table insertion type. flow template_table 0 create table_id 2 group 13 priority 0 insertion_type index_with_pattern ingress rules_number 64 pattern_template 2 actions_template 2 Signed-off-by: Alexander Kozyrev Acked-by: Dariusz Sosnowski --- app/test-pmd/cmdline_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index d04280eb3e..a794e5eba5 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -1030,7 +1030,7 @@ static const char *const meter_colors[] = { }; static const char *const table_insertion_types[] = { - "pattern", "index", NULL + "pattern", "index", "index_with_pattern", NULL }; static const char *const table_hash_funcs[] = { From patchwork Thu Sep 19 00:48:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 144292 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 81B22459CB; Thu, 19 Sep 2024 02:49:07 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 025374327E; Thu, 19 Sep 2024 02:48:57 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2073.outbound.protection.outlook.com [40.107.102.73]) by mails.dpdk.org (Postfix) with ESMTP id D73E942FC3 for ; Thu, 19 Sep 2024 02:48:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PAx31gn3DyCrzQSBSrrceBRGt/xuwr7/XgXt7bdIRIh/FH8/WFQ4oddC11NG3r/xv5hE8YxHECkcA02AijY5yCvFYvUYpqCEPo3YplEKqtTaHVs5CfnyGuM1+SfbzTLjPTV9D04aTPVYXCanDvJ3fM1jUtpehqW7dWifS7R6+mL7zRyrMOdJGpdF0UgDI/ZgNPqxUxTUCaF34RWvJepzAi2ZwkAZtSfQEQ98WTnpTo71iO2hhnly1e2KGap5HPv4bAXX1esMHTkiWadlqEuKnhBTGCKRBYRKUcXXKNEjAArxZnQq2++pLtVLtrQCza8lWyitI57vzTeIsOu7sZ+YCw== 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=gb6HW0q7+NYSwaUZznhfnjXoMgFJi71tYbi7NrVwldE=; b=rSnfiVaZMys1oyWf6TU1zhg32vVvS315fA0edLNzMVrglpSfQdlbFlP6utAZYvUUkt33bBAWKMVwKokzyX7+y1uJPpDnmJlDNsYXVSRJVDhEdXoi8s8JyvTx3/IefeVGYq/OIu3JfAEiZVNYZlZwoWlxvimiiAbZ5175Q9FTfAFA9XW7EinH89tXQH09uko1066Rp1EyjAqmfZ4gkX0tmrhbN9/SyGmWHkCeZhG3xL14GDDd6NKq3wnF5GyyabV89dWKt5v5Dx8cLh1sNywvGIQINi0nr9+zg8iD/zyYioIUWj07ngb3/RA1SVjHEN7ka1Rki1hWpv1wsqbHPKmdjA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.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=gb6HW0q7+NYSwaUZznhfnjXoMgFJi71tYbi7NrVwldE=; b=t7KVij4Ww3ykoRoS50ra5Y8730gpp+XYCpKh5kAr9VJ2ISuF/SDP7tb32gom74R8fgM4X1gc3YzmNfioqz2v1ZakVAhuVi5kPqJMQCmlz7Xo1QhI4USjuQbblCgpulZlXS5Im6YXwkiQ5vJp/53FitrxrKtYRKTbtkSSSEh8igDYaxUxus5ZP37RdhnRg0JpE6vakmxEdO9ZDttvecEDqB/A3M2C4EWyU8MZHQpxIdIVbPy6F+PUzqo5GhS3F9oRCHUdVHyvoh4U1m17KzML2sahxWyWsxsv1W4wJVJAHNBSEn8oPSiEUAfIFNTDtKvY3l2ge+japIH3tx1OcuIcyg== Received: from MW4PR03CA0241.namprd03.prod.outlook.com (2603:10b6:303:b4::6) by PH7PR12MB6693.namprd12.prod.outlook.com (2603:10b6:510:1b0::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.17; Thu, 19 Sep 2024 00:48:49 +0000 Received: from MWH0EPF000A6734.namprd04.prod.outlook.com (2603:10b6:303:b4:cafe::a8) by MW4PR03CA0241.outlook.office365.com (2603:10b6:303:b4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.25 via Frontend Transport; Thu, 19 Sep 2024 00:48:49 +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 MWH0EPF000A6734.mail.protection.outlook.com (10.167.249.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 19 Sep 2024 00:48:49 +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, 18 Sep 2024 17:48:39 -0700 Received: from pegasus01.mtr.labs.mlnx (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, 18 Sep 2024 17:48:36 -0700 From: Alexander Kozyrev To: CC: , , , , , Subject: [PATCH 3/6] ethdev: add flow rule insertion by index with pattern Date: Thu, 19 Sep 2024 03:48:10 +0300 Message-ID: <20240919004813.3158356-4-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20240919004813.3158356-1-akozyrev@nvidia.com> References: <20240919004813.3158356-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A6734:EE_|PH7PR12MB6693:EE_ X-MS-Office365-Filtering-Correlation-Id: 16348324-90d6-448e-7d88-08dcd844d35c X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr 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: HaVhW6VzcgS2pbO9sgSPVP10S/EMU3HRCgUuHF6ibjBTH/DELz7PZ/952oQQ9GWUa5RGeS3MLGSC3fjnMbPNY16c0AN8pIOnbwMhyFJsGDo0ObE/HLHnFm7tVKqev39Ag2ixQBqCfDranh+KJI2uyWF8RMw4KumcB+Llt2iwAEUM+1WAyrg5nBSwhX4/4Kpv7ywUbwGPTPro6xt1k9sA2typr4/LglNyIhD/X0/MQjHg+287inXjdtjCl5djQBcU0x5jm9gPx9GGCUMx7LIVyFSzGBZiJK9hSA2c8AXAv9yDZ1CGCr8dUVlRwha9NJ3VdvlggAsJz9M9ko21HVLxkgmC2V2NPOU+O6aHHMinz2FeoMSPh1X/GZmU97pqxi+Fo0sTEOZwt19zDP/iM9oDH299J69MbslEF0kNzNTp4txF4k1gsDgl9vOyBbB9OQCtl/1wu0Dz70B0yp7zHkX1EFhsxFFjupMS5e+HcBABOvwKvL4M9H8jIi5N8GFz7SisG3o54N6XvZ0792bw4T+7AE3/Ye+0MnlFRlNEoEKNMDbfAGkuysY0PVvR0fAd5UncTpbEx0mZwnfLZIU6GbDrqKe1v/EWO1EqY2rqkyeUrdy88LdZcALVJATYayrdTeE3/+gFIcEvx/jyYlfpuGK9IHBnVFklgnlKIG/7jtJ15kFKHOG7ItsQWX2fjLvmeIxOR1Cdh7/01JIZ6zbjPc2URaz7FnMxwRZGQShDrYpAlr+DsbwH8HjzfBHSB/lXoGK450MSQQKfprJWjU8wpCQNDnSDqATjvjZvSUNCRz5QbftKlaGTfpT+LMnpbPm8zeIMJWThvlroBNSdl1hZl/kwVFt9z4nvlFO4qmnmq3iaAqUPXdDNqUI+oQhLQJtjW08u2sSs2nJmVgdtAcZLf/O7py/Nro2vH0fZGxjPtW1VsQwq0NuQm6R6c0uY4cIAjFi2KpaShVAWWKC09QNMlOflU/WGutgcEIgL+dKov2E7StX7irc8QwcfoWdCgyFDKx8C2zOb1Eu6KzVnFnU2OaSUgO7FXmazG4wsSbsuR91WcLYI7ebleXjDuZRDjXYX9WY1LDDaBQBLBQrk2PetUEYDiEG+w7s6gC5HJ2G88y+T9t4qDz7zj5xAr9Rngx7mHeBh4J1e9yffud31d9M7i7hglSklUqe3pUxg8/mDAa9dLu6MIn1iaL4zHC61eaCBjU7lP+DpYxkio0I0ruWCxDvu1MBVKJmsoO/55/2xKPxoBIGiCv0DGSut2mcY2EGo4VvvaQyO4gN3xQbtaSIwFlUkZThOY87Zlz3HM4BUlV6nMa5Fia+sU/0NZctBvD5X2XOEERUJpRtjOj/FpvCOC+ne4RJWVyKQL2zX7Qn2bqZIFS55XNYtX5W+odEdlycMjrnIRHGrqqOoMdiq6GeEFOGIS9oZFYydV687ByWuOqZrliWw1fyx6teiBRr5wx0rrhI0 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)(36860700013)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 00:48:49.3636 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 16348324-90d6-448e-7d88-08dcd844d35c 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: MWH0EPF000A6734.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6693 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add a new API to enqueue flow rule creation by index with pattern. The new template table rules insertion type, index-based insertion with pattern, requires a new flow rule creation function with both rule index and pattern provided. Packets will match on the provided pattern at the provided index. Signed-off-by: Alexander Kozyrev --- doc/guides/prog_guide/rte_flow.rst | 20 ++++++++++ doc/guides/rel_notes/release_24_11.rst | 5 +++ lib/ethdev/ethdev_trace.h | 44 +++++++++++++++++++++ lib/ethdev/ethdev_trace_points.c | 6 +++ lib/ethdev/rte_flow.c | 55 ++++++++++++++++++++++++++ lib/ethdev/rte_flow.h | 54 +++++++++++++++++++++++++ lib/ethdev/rte_flow_driver.h | 14 +++++++ lib/ethdev/version.map | 3 ++ 8 files changed, 201 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index dad588763f..adbd9b1c20 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -4156,6 +4156,26 @@ Enqueueing a flow rule creation operation to insert a rule at a table index. A valid handle in case of success is returned. It must be destroyed later by calling ``rte_flow_async_destroy()`` even if the rule is rejected by HW. +Enqueue creation by index with pattern +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Enqueueing a flow rule creation operation to insert a rule at a table index with pattern. + +.. code-block:: c + + struct rte_flow * + rte_flow_async_create_by_index_with_pattern(uint16_t port_id, + uint32_t queue_id, + const struct rte_flow_op_attr *op_attr, + struct rte_flow_template_table *template_table, + uint32_t rule_index, + const struct rte_flow_item pattern[], + uint8_t pattern_template_index, + const struct rte_flow_action actions[], + uint8_t actions_template_index, + void *user_data, + struct rte_flow_error *error); + Enqueue destruction operation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index 7056f17f3c..f71a9ab562 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -60,6 +60,11 @@ New Features Extended rte_flow_table_insertion_type enum with new RTE_FLOW_TABLE_INSERTION_TYPE_INDEX_WITH_PATTERN type. +* **Added flow rule insertion by index with pattern to the Flow API.** + + Added API for inserting the rule by index with pattern. + Introduced rte_flow_async_create_by_index_with_pattern() function. + Removed Items ------------- diff --git a/lib/ethdev/ethdev_trace.h b/lib/ethdev/ethdev_trace.h index 3bec87bfdb..910bedbebd 100644 --- a/lib/ethdev/ethdev_trace.h +++ b/lib/ethdev/ethdev_trace.h @@ -2343,6 +2343,50 @@ RTE_TRACE_POINT_FP( rte_trace_point_emit_ptr(flow); ) +RTE_TRACE_POINT_FP( + rte_flow_trace_async_create_by_index, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, + const struct rte_flow_op_attr *op_attr, + const struct rte_flow_template_table *template_table, + uint32_t rule_index, + const struct rte_flow_action *actions, + uint8_t actions_template_index, + const void *user_data, const struct rte_flow *flow), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); + rte_trace_point_emit_ptr(op_attr); + rte_trace_point_emit_ptr(template_table); + rte_trace_point_emit_u32(rule_index); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_u8(actions_template_index); + rte_trace_point_emit_ptr(user_data); + rte_trace_point_emit_ptr(flow); +) + +RTE_TRACE_POINT_FP( + rte_flow_trace_async_create_by_index_with_pattern, + RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, + const struct rte_flow_op_attr *op_attr, + const struct rte_flow_template_table *template_table, + uint32_t rule_index, + const struct rte_flow_item *pattern, + uint8_t pattern_template_index, + const struct rte_flow_action *actions, + uint8_t actions_template_index, + const void *user_data, const struct rte_flow *flow), + rte_trace_point_emit_u16(port_id); + rte_trace_point_emit_u32(queue_id); + rte_trace_point_emit_ptr(op_attr); + rte_trace_point_emit_ptr(template_table); + rte_trace_point_emit_u32(rule_index); + rte_trace_point_emit_ptr(pattern); + rte_trace_point_emit_u8(pattern_template_index); + rte_trace_point_emit_ptr(actions); + rte_trace_point_emit_u8(actions_template_index); + rte_trace_point_emit_ptr(user_data); + rte_trace_point_emit_ptr(flow); +) + RTE_TRACE_POINT_FP( rte_flow_trace_async_destroy, RTE_TRACE_POINT_ARGS(uint16_t port_id, uint32_t queue_id, diff --git a/lib/ethdev/ethdev_trace_points.c b/lib/ethdev/ethdev_trace_points.c index 99e04f5893..0563fb1451 100644 --- a/lib/ethdev/ethdev_trace_points.c +++ b/lib/ethdev/ethdev_trace_points.c @@ -583,6 +583,12 @@ RTE_TRACE_POINT_REGISTER(rte_flow_trace_template_table_destroy, RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_create, lib.ethdev.flow.async_create) +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_create_by_index, + lib.ethdev.flow.async_create_by_index) + +RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_create_by_index_with_pattern, + lib.ethdev.flow.async_create_by_index_with_pattern) + RTE_TRACE_POINT_REGISTER(rte_flow_trace_async_destroy, lib.ethdev.flow.async_destroy) diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 4076ae4ee1..f6259343e8 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -2109,6 +2109,42 @@ rte_flow_async_create_by_index(uint16_t port_id, user_data, error); } +struct rte_flow * +rte_flow_async_create_by_index_with_pattern(uint16_t port_id, + uint32_t queue_id, + const struct rte_flow_op_attr *op_attr, + struct rte_flow_template_table *template_table, + uint32_t rule_index, + const struct rte_flow_item pattern[], + uint8_t pattern_template_index, + const struct rte_flow_action actions[], + uint8_t actions_template_index, + void *user_data, + struct rte_flow_error *error) +{ + struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + +#ifdef RTE_FLOW_DEBUG + if (!rte_eth_dev_is_valid_port(port_id)) { + rte_flow_error_set(error, ENODEV, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + rte_strerror(ENODEV)); + return NULL; + } + if (dev->flow_fp_ops == NULL || + dev->flow_fp_ops->async_create_by_index_with_pattern == NULL) { + rte_flow_error_set(error, ENOSYS, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + rte_strerror(ENOSYS)); + return NULL; + } +#endif + + return dev->flow_fp_ops->async_create_by_index_with_pattern(dev, queue_id, op_attr, + template_table, rule_index, + pattern, pattern_template_index, + actions, actions_template_index, + user_data, error); +} + int rte_flow_async_destroy(uint16_t port_id, uint32_t queue_id, @@ -2733,6 +2769,24 @@ rte_flow_dummy_async_create_by_index(struct rte_eth_dev *dev __rte_unused, return NULL; } +static struct rte_flow * +rte_flow_dummy_async_create_by_index_with_pattern(struct rte_eth_dev *dev __rte_unused, + uint32_t queue __rte_unused, + const struct rte_flow_op_attr *attr __rte_unused, + struct rte_flow_template_table *table __rte_unused, + uint32_t rule_index __rte_unused, + const struct rte_flow_item items[] __rte_unused, + uint8_t pattern_template_index __rte_unused, + const struct rte_flow_action actions[] __rte_unused, + uint8_t action_template_index __rte_unused, + void *user_data __rte_unused, + struct rte_flow_error *error) +{ + rte_flow_error_set(error, ENOSYS, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + rte_strerror(ENOSYS)); + return NULL; +} + static int rte_flow_dummy_async_actions_update(struct rte_eth_dev *dev __rte_unused, uint32_t queue_id __rte_unused, @@ -2899,6 +2953,7 @@ struct rte_flow_fp_ops rte_flow_fp_default_ops = { .async_create = rte_flow_dummy_async_create, .async_create_by_index = rte_flow_dummy_async_create_by_index, .async_actions_update = rte_flow_dummy_async_actions_update, + .async_create_by_index_with_pattern = rte_flow_dummy_async_create_by_index_with_pattern, .async_destroy = rte_flow_dummy_async_destroy, .push = rte_flow_dummy_push, .pull = rte_flow_dummy_pull, diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 6f30dd7ae9..84473241fb 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -6187,6 +6187,60 @@ rte_flow_async_create_by_index(uint16_t port_id, void *user_data, struct rte_flow_error *error); +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Enqueue rule creation by index with pattern operation. + * Packets are only matched if there is a rule inserted at the index. + * + * @param port_id + * Port identifier of Ethernet device. + * @param queue_id + * Flow queue used to insert the rule. + * @param[in] op_attr + * Rule creation operation attributes. + * @param[in] template_table + * Template table to select templates from. + * @param[in] rule_index + * Rule index in the table. + * Inserting a rule to already occupied index results in undefined behavior. + * @param[in] pattern + * List of pattern items to be used. + * The list order should match the order in the pattern template. + * The spec is the only relevant member of the item that is being used. + * @param[in] pattern_template_index + * Pattern template index in the table. + * @param[in] actions + * List of actions to be used. + * The list order should match the order in the actions template. + * @param[in] actions_template_index + * Actions template index in the table. + * @param[in] user_data + * The user data that will be returned on the completion events. + * @param[out] error + * Perform verbose error reporting if not NULL. + * PMDs initialize this structure in case of error only. + * + * @return + * Handle on success, NULL otherwise and rte_errno is set. + * The rule handle doesn't mean that the rule has been populated. + * Only completion result indicates that if there was success or failure. + */ +__rte_experimental +struct rte_flow * +rte_flow_async_create_by_index_with_pattern(uint16_t port_id, + uint32_t queue_id, + const struct rte_flow_op_attr *op_attr, + struct rte_flow_template_table *template_table, + uint32_t rule_index, + const struct rte_flow_item pattern[], + uint8_t pattern_template_index, + const struct rte_flow_action actions[], + uint8_t actions_template_index, + void *user_data, + struct rte_flow_error *error); + /** * @warning * @b EXPERIMENTAL: this API may change without prior notice. diff --git a/lib/ethdev/rte_flow_driver.h b/lib/ethdev/rte_flow_driver.h index 506d1262ab..e00a5d7f7e 100644 --- a/lib/ethdev/rte_flow_driver.h +++ b/lib/ethdev/rte_flow_driver.h @@ -319,6 +319,19 @@ typedef struct rte_flow *(*rte_flow_async_create_by_index_t)(struct rte_eth_dev void *user_data, struct rte_flow_error *error); +/** @internal Enqueue rule creation by index with pattern operation. */ +typedef struct rte_flow *(*rte_flow_async_create_by_index_with_pattern_t)(struct rte_eth_dev *dev, + uint32_t queue, + const struct rte_flow_op_attr *attr, + struct rte_flow_template_table *table, + uint32_t rule_index, + const struct rte_flow_item *items, + uint8_t pattern_template_index, + const struct rte_flow_action *actions, + uint8_t action_template_index, + void *user_data, + struct rte_flow_error *error); + /** @internal Enqueue rule update operation. */ typedef int (*rte_flow_async_actions_update_t)(struct rte_eth_dev *dev, uint32_t queue_id, @@ -436,6 +449,7 @@ struct __rte_cache_aligned rte_flow_fp_ops { rte_flow_async_create_t async_create; rte_flow_async_create_by_index_t async_create_by_index; rte_flow_async_actions_update_t async_actions_update; + rte_flow_async_create_by_index_with_pattern_t async_create_by_index_with_pattern; rte_flow_async_destroy_t async_destroy; rte_flow_push_t push; rte_flow_pull_t pull; diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index 1669055ca5..8e02e1de8f 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -325,6 +325,9 @@ EXPERIMENTAL { rte_flow_template_table_resizable; rte_flow_template_table_resize; rte_flow_template_table_resize_complete; + + # added in 24.11 + rte_flow_async_create_by_index_with_pattern; }; INTERNAL { From patchwork Thu Sep 19 00:48:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 144294 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2670B459CB; Thu, 19 Sep 2024 02:49:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C9C31432CE; Thu, 19 Sep 2024 02:49:02 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2063.outbound.protection.outlook.com [40.107.236.63]) by mails.dpdk.org (Postfix) with ESMTP id 9F1EF432CE for ; Thu, 19 Sep 2024 02:49:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=j+TVDUuXQuG2hJj9hUBAe1mDv2HaC0D7K7DUKxo+l1SSZizTaAV20i3zDaIODJOq9InBGC9INs6c3g3BrD4lODU4v2XIK7PJ2adexoAxYQFGEqnVbCj0RSfn7u0RdeKPldVHkt0ug5szQdOrbV6VN3A1nnPaJPi1yIKvaX02bvyWHGPuwG3Cudnl56fdj1hQRewajC05Dm9yeQw/Ez64qmkM6+mT+1ylUFmwKzZfoRMnstJokY48UBp16wt5Y1Q2TobKYmTOTJiaPK5dgUwa5F0QI3uMyjR6PG1YcSglUi3NZ8gJZZdBY9NanfNmVp3M2ab8TZ6pE4X2c8F9dtaLDw== 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=7jnygYO13hBEeyiyu/C3V5cEC+AAjhW1Q/qjS0fqkGY=; b=UBCsSrePX7AbBcN75K5FMHOEPNhhQgoy2LsZEwZ/exboJnddB2J/yoBLPVgaW+nj8NtbDysonxNXilNYO2Ohv0TqqpgqYiiEPy+5b0WxdE1fw8TsayFWQ6mAU+40JR0l8n+27q9tBuusQv93yXhRBhAXNKvBeSoDvKh0evWmzm6nlFqvULtHk7sjWuJZXILkDxTBKvJVpSau7sZnvvh69VTeWhcq4o79epweVgwZ5IJv0Fv3irBvBeCl2swzfOLYzTQ1eV2DQ16qXrxqytSwiCT7BcnU5uh4IpbiZ7BXOTv0RXZ71aBoLj7u7XYjhFgyI+9eDKvOBv2wMJUqyyEmSA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.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=7jnygYO13hBEeyiyu/C3V5cEC+AAjhW1Q/qjS0fqkGY=; b=uBQhUmdo/V38KHbrNDSE6T1zje1EVnAT9dMNhoWQ2ikVXhV7vZDb5EvwmwPIphXD799Ida8XkdlSZcy2cff5O2UyJAQ5oWqmI4/99Utwjo0RiW4tdKWJle/Q7dhTYvnDqIH1a97FW2sDiokLC45q1HR4wI146QiGG0jOeTUjjWMr6Gh1x1aNWi6GFRKG+aPC9WP6oqh38BGPtViaM6Xo1pZw3swbkxCvZf+rfbHrZVqHt5HLcUVq9lk6/tq/Ngwxr8iKulMf54EdoItOuUKipoCgB28h+lIsxlq/MCWCLbMvj1sPWK816NsdrEZRYvBnrYrZFUKUicXLKFDnhdbfDg== Received: from MN0P220CA0030.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:52e::24) by DS7PR12MB6069.namprd12.prod.outlook.com (2603:10b6:8:9f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.17; Thu, 19 Sep 2024 00:48:57 +0000 Received: from MN1PEPF0000ECDB.namprd02.prod.outlook.com (2603:10b6:208:52e:cafe::3a) by MN0P220CA0030.outlook.office365.com (2603:10b6:208:52e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.25 via Frontend Transport; Thu, 19 Sep 2024 00:48: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 MN1PEPF0000ECDB.mail.protection.outlook.com (10.167.242.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 19 Sep 2024 00:48:56 +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, 18 Sep 2024 17:48:41 -0700 Received: from pegasus01.mtr.labs.mlnx (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, 18 Sep 2024 17:48:39 -0700 From: Alexander Kozyrev To: CC: , , , , , Subject: [PATCH 4/6] app/testpmd: add insertion by index with pattern option Date: Thu, 19 Sep 2024 03:48:11 +0300 Message-ID: <20240919004813.3158356-5-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20240919004813.3158356-1-akozyrev@nvidia.com> References: <20240919004813.3158356-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECDB:EE_|DS7PR12MB6069:EE_ X-MS-Office365-Filtering-Correlation-Id: 827c56ee-02c1-4adf-bfb3-08dcd844d7b6 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: j9rJ1uO5Xmre9pUOHvLDp6n687iPPN10CSlexwgzIrk5io/thboWJSuK+2T4sEqm/uwpfjXtwzxuspKBj5SeBOCmd+RI/GyGCNyAS/VP0HtnRtI8XUITOvcAJ4i7U8QcjYUq3YlnSQIfDO95R4FxfvSYAxBhTUwYR6VrVRIUkXErztntzbaa98PNGPmyjAeuFmuMJyadOAKgHJCy1lV6EQPYTeCRu+WIfGAueRFFHbaDEyIOurOVHPQkrGe32trhReIQiKiNZb+0B5f8qCTJj0nbSvOfCse3XZOKS5JlcYcwL/Bc46mApcRPRUokDmyBZbMTjPQMx3kPb52aC1un5125bLvpZhTnyf7OBc6RraCKx1PkbgfciibtFKN0DPYl16OixjqD9Tgsoh4trrBU4SzE2bQeJEbmayxxsg7L+VKxdGeDL2IoFggNmovUxXwmAlLGxr0X3rbchIaDFcmlJDRQEYbNKnk4//g88OVajzuDOy+hCDpTyjauyU3PxSpvVPGYkNlrNapNQ2HDXV/DX2JRq/BYpmKEJv/j+5aEupbGie9Nnui7Sy9CIlGkJRGD77x86pr418CgYFvD46OBve7mdRJCnKmvSDslJiYuH/4JBxRUFVVN0RuMgArqyJOS5PbSUMW/5NIB9cXN1VYARcIsR50FI3uqYoU9OX+SMhZJ978205WARA4JaV/m2fygl5xbY4pzv3GkI6xEOktb0cRZSZBbvjVCQZKTnnU+oTIe58xmHZhCQfCS+wBi2taDAiXT9c0JVgR9VaMXSwuoj8/G4SdfHdOIvLyAtpKEEK692jSuajQ0f5otiWBTKNFdsSarJiEg5IYKvRwv2BIY0iTV5UByJh6u744VTUzoZuM7vxbhRYQ4RKPXwpn6pkICdFR6p30cNU0DRcvCHXkSVIjyGCOkM8t51QF0pWIuM3dBuZGV+5+FajHLchnb4y8OeLgfjFT9+z/GPbIgRZ9a0Yj5IgBVafIZw24gqy+Yjn4MLqTHaq73tqfBs6Mcx0tR5bqyS6vP4kpVjJC4dUWu62h8ayQu5BoBXXlWTZpd8zxenxkjlVYA7svCTeddSszBrwZl0O9I0kEBVC81Yhy19J1cCNA6bSnuhQzmlLYV9f9sjVNJUVwIkH6xfMIR1sTlY7D59OvHI2CbOCeoJjPaILfIk0yA8ci5RED1yVY/soWuNGz7AYYyYOIvmCNMBLtFlWF2GYUwbdO6dIPv8uG7RCdHiIzdCzlTyDGlsez9fVyNUuJ6BPfbgrwkx9bJgnt87r7HmXXqkjFEn4q5UdnXOumE5x2UY6OViKnBiWoWFMXDPs6w5coXl468l5JoYgDDvg6lWCPGJksNLiCAkqtNBVGOv8+PjtEE+XIXxa4nFiQVg5r1RYk2oEiCiauKHQs+Jreg/WCNoF4AKtFnG5Y3/K+DnhhGV1cA7Ehoa3bJdUDMC/2I7r6fs+7mEiR2LeIj 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)(36860700013)(82310400026)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 00:48:56.6346 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 827c56ee-02c1-4adf-bfb3-08dcd844d7b6 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: MN1PEPF0000ECDB.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6069 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Allow to specify both the rule index and the pattern in the flow rule creation command line parameters. Both are needed for rte_flow_async_create_by_index_with_pattern(). flow queue 0 create 0 template_table 2 rule_index 5 pattern_template 0 actions_template 0 postpone no pattern eth / end actions count / queue index 1 / end Signed-off-by: Alexander Kozyrev Acked-by: Dariusz Sosnowski --- app/test-pmd/cmdline_flow.c | 8 +++++++- app/test-pmd/config.c | 22 ++++++++++++++++------ app/test-pmd/testpmd.h | 2 +- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index a794e5eba5..855273365e 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -1585,6 +1585,12 @@ static const enum index next_async_insert_subcmd[] = { ZERO, }; +static const enum index next_async_pattern_subcmd[] = { + QUEUE_PATTERN_TEMPLATE, + QUEUE_ACTIONS_TEMPLATE, + ZERO, +}; + static const enum index item_param[] = { ITEM_PARAM_IS, ITEM_PARAM_SPEC, @@ -3788,7 +3794,7 @@ static const struct token token_list[] = { [QUEUE_RULE_ID] = { .name = "rule_index", .help = "specify flow rule index", - .next = NEXT(NEXT_ENTRY(QUEUE_ACTIONS_TEMPLATE), + .next = NEXT(next_async_pattern_subcmd, NEXT_ENTRY(COMMON_UNSIGNED)), .args = ARGS(ARGS_ENTRY(struct buffer, args.vc.rule_id)), diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 6f0beafa27..39924d8da9 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2636,8 +2636,8 @@ port_flow_template_table_create(portid_t port_id, uint32_t id, } pt->nb_pattern_templates = nb_pattern_templates; pt->nb_actions_templates = nb_actions_templates; - rte_memcpy(&pt->flow_attr, &table_attr->flow_attr, - sizeof(struct rte_flow_attr)); + rte_memcpy(&pt->attr, table_attr, + sizeof(struct rte_flow_template_table_attr)); printf("Template table #%u created\n", pt->id); return 0; } @@ -2835,7 +2835,7 @@ port_queue_flow_create(portid_t port_id, queueid_t queue_id, } job->type = QUEUE_JOB_TYPE_FLOW_CREATE; - pf = port_flow_new(&pt->flow_attr, pattern, actions, &error); + pf = port_flow_new(&pt->attr.flow_attr, pattern, actions, &error); if (!pf) { free(job); return port_flow_complain(&error); @@ -2846,12 +2846,22 @@ port_queue_flow_create(portid_t port_id, queueid_t queue_id, } /* Poisoning to make sure PMDs update it in case of error. */ memset(&error, 0x11, sizeof(error)); - if (rule_idx == UINT32_MAX) + if (pt->attr.insertion_type == RTE_FLOW_TABLE_INSERTION_TYPE_PATTERN) flow = rte_flow_async_create(port_id, queue_id, &op_attr, pt->table, pattern, pattern_idx, actions, actions_idx, job, &error); - else + else if (pt->attr.insertion_type == RTE_FLOW_TABLE_INSERTION_TYPE_INDEX) flow = rte_flow_async_create_by_index(port_id, queue_id, &op_attr, pt->table, rule_idx, actions, actions_idx, job, &error); + else if (pt->attr.insertion_type == RTE_FLOW_TABLE_INSERTION_TYPE_INDEX_WITH_PATTERN) + flow = rte_flow_async_create_by_index_with_pattern(port_id, queue_id, &op_attr, + pt->table, rule_idx, pattern, pattern_idx, actions, actions_idx, job, + &error); + else { + free(pf); + free(job); + printf("Insertion type %d is invalid\n", pt->attr.insertion_type); + return -EINVAL; + } if (!flow) { free(pf); free(job); @@ -3060,7 +3070,7 @@ port_queue_flow_update(portid_t port_id, queueid_t queue_id, } job->type = QUEUE_JOB_TYPE_FLOW_UPDATE; - uf = port_flow_new(&pt->flow_attr, pf->rule.pattern_ro, actions, &error); + uf = port_flow_new(&pt->attr.flow_attr, pf->rule.pattern_ro, actions, &error); if (!uf) { free(job); return port_flow_complain(&error); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 9facd7f281..f9ab88d667 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -220,7 +220,7 @@ struct port_table { uint32_t id; /**< Table ID. */ uint32_t nb_pattern_templates; /**< Number of pattern templates. */ uint32_t nb_actions_templates; /**< Number of actions templates. */ - struct rte_flow_attr flow_attr; /**< Flow attributes. */ + struct rte_flow_template_table_attr attr; /**< Table attributes. */ struct rte_flow_template_table *table; /**< PMD opaque template object */ }; From patchwork Thu Sep 19 00:48:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 144295 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 739E4459CB; Thu, 19 Sep 2024 02:49:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C0504328F; Thu, 19 Sep 2024 02:49:08 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2063.outbound.protection.outlook.com [40.107.95.63]) by mails.dpdk.org (Postfix) with ESMTP id 0B70B43302 for ; Thu, 19 Sep 2024 02:49:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nsBCyvJOPNvf2GIOBAni+oqn9gVPAfDNWlulapKPoKYIchoXK4EL2oKGxqh8DpcYWcLQFm1/Y+pkDHXtGrPZqmJCq+krLfhe0CkHvYGQDeZfwkJyQhtGrCGRRoCd0k/QWYcsEKN6awBPDh0ML9Gy6jt33KldP+m0hsss+Pt+/GggQajUqAXv6AbsilZQ4cW/BZ//MwHlB8/JpLJyxbtEyD9a5EXlrhxSVpW5+bMlOqQ0lEKrNIEvM3y/HpG1l9lqY6V0QqJJLoDjojW5ffVgeRIols6S0W7589WXWuR7BVPjxRNZE+zZH+BeuD0U3PYP5BgALYfZTUzt6Z4YoSchmA== 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=Iec9+7TOyVHM4Ylyf1w1l7iV7uAM/QKH6G/+55o+KGw=; b=KfBqH4nT4DYZORSjiJeSNKUHc7tmMx7O9a/sm2qw2aZksAteL+OBafbFN2s40n1FjIXk+QghqcnVMhr7mEZHTW+lB4U0XHWv+dIkiajPGhyoznynLjOIWWqEKpnpzIiZ3XhNevaMLjsq90nUDkoQvhxslQqgknVTDLVdQ5CMS4XwcK7JBB7nD6yCjhliuFOsgzDMhjsTLxgR4q7UH9EZLeBVAW2wz58iRvLhyvx5BuPtt8M87k5C3I1o9fqQjKsvzuk/CSLstEsmHWAa8XznfiP3DB3i6rwS/w1570hrGh9kyJr2pJgAqImB+tJyby9W+of2wiHyRtB4VFl+7YNLSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.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=Iec9+7TOyVHM4Ylyf1w1l7iV7uAM/QKH6G/+55o+KGw=; b=PU7VmErL35EfTrdOdCgag82bvAHSxh8h1E5v25K0W3C7CgxPC3Mp7ADEHSHC7s0/8/XZuNiO47/j9Lr/iiUJC+SzBX8/DD9WIK9faPohGEu/uFRQSoDiiqLXeplInGO+IYIX1nY1inAMKZn4jETdKYrd1B40WxakJKCaU2NxdzVvOaVtUjdpk9xrWQbOyJQtqlBq4Jz6hcYqyJ+r+ydAXt27QJT6Nuw3egsBycaXOIwdZAxcSmyVLXe3W9zB12Uwx5Ai1uyv+12BvR7G6HXEVeMZnbg6bZevTU0ZUdKm0hl3EbMGX1G3TJwp7RSpRRIm7HJ+bFQRkT0OOAOUBnd9eA== Received: from PH7PR03CA0016.namprd03.prod.outlook.com (2603:10b6:510:339::13) by DS0PR12MB7827.namprd12.prod.outlook.com (2603:10b6:8:146::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.24; Thu, 19 Sep 2024 00:48:59 +0000 Received: from MWH0EPF000A672E.namprd04.prod.outlook.com (2603:10b6:510:339:cafe::94) by PH7PR03CA0016.outlook.office365.com (2603:10b6:510:339::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.26 via Frontend Transport; Thu, 19 Sep 2024 00:48:58 +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 MWH0EPF000A672E.mail.protection.outlook.com (10.167.249.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 19 Sep 2024 00:48:57 +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, 18 Sep 2024 17:48:44 -0700 Received: from pegasus01.mtr.labs.mlnx (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, 18 Sep 2024 17:48:41 -0700 From: Alexander Kozyrev To: CC: , , , , , Subject: [PATCH 5/6] ethdev: add jump to table index action Date: Thu, 19 Sep 2024 03:48:12 +0300 Message-ID: <20240919004813.3158356-6-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20240919004813.3158356-1-akozyrev@nvidia.com> References: <20240919004813.3158356-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A672E:EE_|DS0PR12MB7827:EE_ X-MS-Office365-Filtering-Correlation-Id: ce37e519-9438-44d7-1b5c-08dcd844d82d X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr 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: 9YpjHfdDxoFaUGnBg4xQrLiL+BzxqzkjIbrHatPymgHVBBhoC9e+NYD7Uy0xGjoRf13KUIMqW/NN5XX2bh7qMDcMRFSLiYVYsgxDq3zTW/9CBNPx9d97qg7mx6fYU6GAzU+ZA8nebA7HdZrIx6TuX4ymITjVUPxuE3CncpDizRhnnieuHxWoTPWoWk1FS2ELFajMgmhBXi/zaoYnfVnwulhY6CaiZoGRpD8k4+trX4eQXHla7sxQ9pQNdcLCvKcAD31ghkHFnGcOlJN8mljrCj9e9sBk6KUvxTmC0JJeBo4NPZqLQfTWITMmOFe9GB+u0jtjAs/8FDq8cibVVUfi6WEcTNsoF39RHhs1qODK9s0430kb1jxkpt04/98H5mHqxLelDKntOHEkEfDPwbJsuvvdCafHcuTRPWWWlU8CopskcvpflcoXU5klCZZuz2S9fnimd6Gzn1Sb3LKfR2pdtyk+ta3/2wEi/P1mWeqU0FxyY5jtycUBHG/igDICTHhzisEAvPgf4OhecMG+/ASatDO5dsgmGytF/Lh0IafrGLHGIbmKv8D+0ltzttPXb6YOdRPlo7hj/3jc/OLsmP2vMO0yXaXCHSrI/gWFDuhQc1SiihSrTYwYYVufbDNyab/z85mGxVOYNWR6DD1xUFBfgo7r8CAMGZy0hHBm6pnPSCUF3pe8L2fg+CH+vYfVf2WlEPPYASqJ+0FcIyS8ppFRhVy8Kf6ohOwWJIfad0VUtdj5SZjG98dkJ6CLi8TJhAlqizWmyDByxJM+s49yC1kqlY8yenTBbSHBD1GXvvI2RLXqwdwaUecnb7bGrzojppM1wtNpw/hhliwgsF0vNgkJoZOBsOeWprywPFSX6WL6B9hJX/MbNVbtWpPGMZ8wad4FqP2qllCBMrkmbz+qLEo+ERLs9xNoCQxCO8WKxVbfl/gYUsnw+UcPB9lycDTzeA/Zi7/ZJ21iWBmmczZ0s5CfRvHaTX/fesdeHnSaV2KWLKqgGl7rGvGLsUwAGc3Vk3yRfB9Dl32u9jJRjHD+/aQBB2ZwE90r3Reasmuqw0+nkLmMy+pSRVF2YKcwJ9Y9bjcC8ZSfhqQhPb1UstZBB/U+YxBLqPmVr1RCibUlU/QJH7kFGWDJPxJGM5dMjrXtrLmMeerigUiGax5MoDQ553Meo69eqGjIda4Y+fLQwRLGTCaYOE1X/CyQJDli4u9rVENlTXasRRFq1X5+cyMxD+lsdBiitjucbqim6mcxwKO+tG6L01JZLme09tI+2q5CJCOxOw9Vd/EErm0UcPn9w1e/CTCpJPZqXkvb75PDJ6P+Z/ScRmYnfkAWySE930VL0sXfPESZ7x5BZ+5uEYUDSsjxHqxGyQL5BG9iEPnk/Sn29MTxlMTCcLjduer3TH46pFdw23d9qufKxp3sF18FevZR+ef1UiTP2FN81+S03f/RvNb26A4KLy+zr6gj415ZEdon 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)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 00:48:57.4572 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce37e519-9438-44d7-1b5c-08dcd844d82d 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: MWH0EPF000A672E.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7827 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Introduce the RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX action. It redirects packets to a particular index in a flow table. Signed-off-by: Alexander Kozyrev Acked-by: Dariusz Sosnowski --- doc/guides/rel_notes/release_24_11.rst | 4 ++++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 23 +++++++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index f71a9ab562..ccdc44f3d8 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -65,6 +65,10 @@ New Features Added API for inserting the rule by index with pattern. Introduced rte_flow_async_create_by_index_with_pattern() function. +* **Added the action to redirect packets to a particular index in a flow table.** + + Introduced RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX action type. + Removed Items ------------- diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index f6259343e8..a56391b156 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -275,6 +275,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = { MK_FLOW_ACTION(PROG, sizeof(struct rte_flow_action_prog)), MK_FLOW_ACTION(NAT64, sizeof(struct rte_flow_action_nat64)), + MK_FLOW_ACTION(JUMP_TO_TABLE_INDEX, sizeof(struct rte_flow_action_jump_to_table_index)), }; int diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 84473241fb..a2929438bf 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -3262,6 +3262,15 @@ enum rte_flow_action_type { * @see struct rte_flow_action_nat64 */ RTE_FLOW_ACTION_TYPE_NAT64, + + /** + * RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX, + * + * Redirects packets to a particular index in a flow table. + * + * @see struct rte_flow_action_jump_to_table_index. + */ + RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX, }; /** @@ -4266,6 +4275,20 @@ rte_flow_dynf_metadata_set(struct rte_mbuf *m, uint32_t v) *RTE_FLOW_DYNF_METADATA(m) = v; } +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX + * + * Redirects packets to a particular index in a flow table. + * + */ +struct rte_flow_action_jump_to_table_index { + struct rte_flow_template_table *table; + uint32_t index; +}; + /** * Definition of a single action. * From patchwork Thu Sep 19 00:48:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 144296 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C73CF45982; Thu, 19 Sep 2024 02:49:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C83C43312; Thu, 19 Sep 2024 02:49:12 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2073.outbound.protection.outlook.com [40.107.236.73]) by mails.dpdk.org (Postfix) with ESMTP id D925A4331C for ; Thu, 19 Sep 2024 02:49:09 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kzM6s1wzfOIIRaK+icxfgFthTVgFZnaVhsHLEJE4Xs3zspk8jYC4CLam1d14WJZWQ31PjVNGogbsttwER6Tf2BKABuYIkntpLkGZwhiS6JUKSUpMv2n9Vg3wkIh1m+9an22qTaCBSwGO5qg+uYwta0YrMHMnFE/yi7Ies0RQYTqQmvRzYvBUH6ujxYTKncFKFe/gcZSmV9aFP/O46OPhezalkgROBpIMB7mZ5L+C2QIg4Rnh7c0jhZvVHYia4dDcPWxTqpjHi89pn0M6+aGoieV/EzcPNInhO3AMkUt+GGVuWBkGtkQHmnWJYTyQKNbcuK/Q9s5942R/NiM2Z/3XMg== 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=nCXIPrxf+8XrWk4Boh3g0kczulSDA2MOL0NHA8Y/O2s=; b=SzUjfwXYnD29JprLk0cB/0sVeSf4nwPtHUMARiMpTH8qPgPzfRmq7GQ9Rt2+AUCsJnpfpktpFjI19hwcvGJFTPMwe6+58ZCnSMNYCi/ETEEdvwIoYPY0J+vdbRCgifTlTE42kcHU4UD4JbAp9pCeuM7IHLBmsMnS9jajNtUNENo3mI5ZMh7k2LiogQ+qSiL59egdItuQd+KDo+9gQm9M9kDto6H7HwiJGvfIMu/w5EFeE7NlnRkm0ukbnKNA3L1DDldZrOBJbXMNJxUz+ufnpvaABBdAIVLJEcRxMGRmO+3+uM00Cpyc8j2bDaO+9rh4bmwDpNZ8QgiyHvH32sZkrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.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=nCXIPrxf+8XrWk4Boh3g0kczulSDA2MOL0NHA8Y/O2s=; b=UMhqaOT9tCskYV7++GcibD3GkAJXW3bhF9ZDkj6q4fA+F7uWce1aS0MtOxBa5yoKlrH/AQ2IoLWRuiL82pZEDde3buL77ZkbkXUylzIPmN1fYfFfOMU2v7yUjZbb7vpOhvINbp8da4vKkEvGRJjdiyh7YCLaGRNncz0DK0tBcIAWkkXL5K2eN7BylMBsVNH1Y6Gp9oXE5PN1IzdmsHyysNKiqBA6cXpAZ/COxZZbDCk0kLed8D4EV/sky88HnsfFp6JAIaL1eBBqNxccOLflRoAcDvflivZTtdrLqS1uVkPqwYjeSYv7dyuGbuhzI6E8xco9e4e88uE13jRBB6+/6A== Received: from MW4PR03CA0244.namprd03.prod.outlook.com (2603:10b6:303:b4::9) by CY5PR12MB6478.namprd12.prod.outlook.com (2603:10b6:930:35::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.16; Thu, 19 Sep 2024 00:49:04 +0000 Received: from MWH0EPF000A6734.namprd04.prod.outlook.com (2603:10b6:303:b4:cafe::a3) by MW4PR03CA0244.outlook.office365.com (2603:10b6:303:b4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Thu, 19 Sep 2024 00:49:03 +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 MWH0EPF000A6734.mail.protection.outlook.com (10.167.249.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 19 Sep 2024 00:49:03 +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, 18 Sep 2024 17:48:46 -0700 Received: from pegasus01.mtr.labs.mlnx (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, 18 Sep 2024 17:48:44 -0700 From: Alexander Kozyrev To: CC: , , , , , Subject: [PATCH 6/6] app/testpmd: add jump to table index action Date: Thu, 19 Sep 2024 03:48:13 +0300 Message-ID: <20240919004813.3158356-7-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20240919004813.3158356-1-akozyrev@nvidia.com> References: <20240919004813.3158356-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000A6734:EE_|CY5PR12MB6478:EE_ X-MS-Office365-Filtering-Correlation-Id: 7b999a27-4f9b-4dc2-82b6-08dcd844dbf7 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: r1yliyjKYKgv1hW4o9kupjzoKmMRowc2MGOdppZpEDC71lf96t22fIhMYp2zpv5cO9u4TSCq6gBWFjHr7grHLXX7cxojmiekgH4N2oUQXKKJPtQMQeW5BnNXN8JYJS/em+y9idn2Vqv80/5Yi4txhQjzaOiWi/TL1b3dO1L7gSWy/JnWHYDew5svnc7ubDrydJhJfxdQNXDXJ5szO4ulw8ts8hwMMxrF1agZTuvSfMM6d/Ag7bYn3b7qekOVrM1DRvGyGAjovosQIX8F8EB1n+X9vyRJ775ZMXIHYlpiuMob+Hs7oPmJNRbn+DMLlgjSr2GgmGxRIzB/GMYX9xKyf1owFaqIFDUhvT/WRy/hlMe9cP3SWf2hrXD01G3MY7AUfRq2rlnZFOfIdGzJU0Ipgh3cxC5BK2uC1KrJjuthW1R/8niUDzBf6ulMSy+UQOuOt9gIWiH9S62lqPGAyayagGDeYqYZ+ku2imPacAPQAkZG+G9Z86+Ql6P4Lx0Khb9igtKXww+C7q4yUyjsZP1+W4semhZRmGOCCeBZz8Vvj4kVusKZxoMEu2++P1eQC3n5cT+ZRER19dXU/Aa3r+06WoyJdtI8aTP9HfLX6qjvUrbiYpsHE1ZVVnX+drpGbXo1OL2fggVI/VmzsiTARKOWpXRZAbFJvxKVd3eRQegSfZyw6+kzoJHwT3cLYBDLI6w0hb0jFJgQ52z1hZitGLqPnsqG8R0zhdT9znBa4bm0diLf/vxlSKHAqLZ8AHuwjWMbTAEI+G8tWAemnz19pApiA6soSNcJxvPKVF5Yobnwn/L7OFoPy2ceb9nq6AULJqeiADJqr8S/Z/ByHdi+2hhdRJCh5RZ54KmNzNSGnhbr/kBRTVaafJ66EH5x36SgdlWbC9cCuGNQ7TyOnKHuHcMTJnwgppRtGqzYj1Z/83+PRxWFeQWymFcbNvrcuJsuaUjWvpXcIdiWuXIpNDqMDj6IVkzNUMICHXyowI79MUKSOmIoDVLPhlm/v01dJ6FfyC6+FSTSlgibE3cgKUp2+33078dETm0pOuahjjdF/x+ODkm6vBrbJXZxsmogg6+ffpYc5AqwDqIJYi3xrBhsmnDGtWtnRYRCWUVLXvGCza/EF95WOzH4RpVMkhJmczLvlSEoUNBDtDFkwVoMn+b/q45W9ZRqw1n9hk3LumhMvg988EmnzXDYHfB2LhvoohhkDCQZ6UICxWSCjSXXwsD4ntw75YzL77/rBnZ2zp5/Uo0Bsl55Wzb8OvpH1OuE30ywk6n3CQCY6yYs5tkIPpxnbIJiZuBDJY8lWf8Jb3pJcL9b6qwynBC+NU1P6UM29iFquTfLRRE6FEhjfs7+0EBCOQz5tXClFEotZ8NWErXuBvYmPHJNAGAoYdKgk23Rp0+3ECS5 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)(1800799024)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 00:49:03.8012 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b999a27-4f9b-4dc2-82b6-08dcd844dbf7 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: MWH0EPF000A6734.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6478 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add a new command line options to create the RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX action from the testpmd command line. flow queue 0 create 0 template_table 0 pattern_template 0 actions_template 0 postpone no pattern eth / end actions jump_to_table_index table 0x166f9ce00 index 5 / end Signed-off-by: Alexander Kozyrev Acked-by: Dariusz Sosnowski --- app/test-pmd/cmdline_flow.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 855273365e..b7bcf18311 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -785,6 +785,9 @@ enum index { ACTION_IPV6_EXT_PUSH_INDEX_VALUE, ACTION_NAT64, ACTION_NAT64_MODE, + ACTION_JUMP_TO_TABLE_INDEX, + ACTION_JUMP_TO_TABLE_INDEX_TABLE, + ACTION_JUMP_TO_TABLE_INDEX_INDEX, }; /** Maximum size for pattern in struct rte_flow_item_raw. */ @@ -2328,6 +2331,7 @@ static const enum index next_action[] = { ACTION_IPV6_EXT_REMOVE, ACTION_IPV6_EXT_PUSH, ACTION_NAT64, + ACTION_JUMP_TO_TABLE_INDEX, ZERO, }; @@ -2688,6 +2692,13 @@ static const enum index next_hash_encap_dest_subcmd[] = { ZERO, }; +static const enum index action_jump_to_table_index[] = { + ACTION_JUMP_TO_TABLE_INDEX_TABLE, + ACTION_JUMP_TO_TABLE_INDEX_INDEX, + ACTION_NEXT, + ZERO, +}; + static int parse_set_raw_encap_decap(struct context *, const struct token *, const char *, unsigned int, void *, unsigned int); @@ -7608,6 +7619,29 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY(struct rte_flow_action_nat64, type)), .call = parse_vc_conf, }, + [ACTION_JUMP_TO_TABLE_INDEX] = { + .name = "jump_to_table_index", + .help = "Jump to table index", + .priv = PRIV_ACTION(JUMP_TO_TABLE_INDEX, + sizeof(struct rte_flow_action_jump_to_table_index)), + .next = NEXT(action_jump_to_table_index), + .call = parse_vc, + }, + [ACTION_JUMP_TO_TABLE_INDEX_TABLE] = { + .name = "table", + .help = "table to redirect traffic to", + .next = NEXT(action_jump_to_table_index, NEXT_ENTRY(COMMON_UNSIGNED)), + .args = ARGS(ARGS_ENTRY(struct rte_flow_action_jump_to_table_index, table)), + .call = parse_vc_conf, + }, + [ACTION_JUMP_TO_TABLE_INDEX_INDEX] = { + .name = "index", + .help = "rule index to redirect traffic to", + .next = NEXT(action_jump_to_table_index, NEXT_ENTRY(COMMON_UNSIGNED)), + .args = ARGS(ARGS_ENTRY(struct rte_flow_action_jump_to_table_index, index)), + .call = parse_vc_conf, + }, + /* Top level command. */ [SET] = { .name = "set",