From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Content-Type: text/plain 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: =?us-ascii?Q?HaVhW6VzcgS2pbO9sgSPVP10S/EMU3HRCgUuHF6ibjBTH/DELz7PZ/952oQQ?= =?us-ascii?Q?9GWUa5RGeS3MLGSC3fjnMbPNY16c0AN8pIOnbwMhyFJsGDo0ObE/HLHnFm7t?= =?us-ascii?Q?VKqev39Ag2ixQBqCfDranh+KJI2uyWF8RMw4KumcB+Llt2iwAEUM+1WAyrg5?= =?us-ascii?Q?nBSwhX4/4Kpv7ywUbwGPTPro6xt1k9sA2typr4/LglNyIhD/X0/MQjHg+287?= =?us-ascii?Q?inXjdtjCl5djQBcU0x5jm9gPx9GGCUMx7LIVyFSzGBZiJK9hSA2c8AXAv9yD?= =?us-ascii?Q?Z1CGCr8dUVlRwha9NJ3VdvlggAsJz9M9ko21HVLxkgmC2V2NPOU+O6aHHMin?= =?us-ascii?Q?z2FeoMSPh1X/GZmU97pqxi+Fo0sTEOZwt19zDP/iM9oDH299J69MbslEF0kN?= =?us-ascii?Q?zNTp4txF4k1gsDgl9vOyBbB9OQCtl/1wu0Dz70B0yp7zHkX1EFhsxFFjupMS?= =?us-ascii?Q?5e+HcBABOvwKvL4M9H8jIi5N8GFz7SisG3o54N6XvZ0792bw4T+7AE3/Ye+0?= =?us-ascii?Q?MnlFRlNEoEKNMDbfAGkuysY0PVvR0fAd5UncTpbEx0mZwnfLZIU6GbDrqKe1?= =?us-ascii?Q?v/EWO1EqY2rqkyeUrdy88LdZcALVJATYayrdTeE3/+gFIcEvx/jyYlfpuGK9?= =?us-ascii?Q?IHBnVFklgnlKIG/7jtJ15kFKHOG7ItsQWX2fjLvmeIxOR1Cdh7/01JIZ6zbj?= =?us-ascii?Q?Pc2URaz7FnMxwRZGQShDrYpAlr+DsbwH8HjzfBHSB/lXoGK450MSQQKfprJW?= =?us-ascii?Q?jU8wpCQNDnSDqATjvjZvSUNCRz5QbftKlaGTfpT+LMnpbPm8zeIMJWThvlro?= =?us-ascii?Q?BNSdl1hZl/kwVFt9z4nvlFO4qmnmq3iaAqUPXdDNqUI+oQhLQJtjW08u2sSs?= =?us-ascii?Q?2nJmVgdtAcZLf/O7py/Nro2vH0fZGxjPtW1VsQwq0NuQm6R6c0uY4cIAjFi2?= =?us-ascii?Q?KpaShVAWWKC09QNMlOflU/WGutgcEIgL+dKov2E7StX7irc8QwcfoWdCgyFD?= =?us-ascii?Q?Kx8C2zOb1Eu6KzVnFnU2OaSUgO7FXmazG4wsSbsuR91WcLYI7ebleXjDuZRD?= =?us-ascii?Q?jXYX9WY1LDDaBQBLBQrk2PetUEYDiEG+w7s6gC5HJ2G88y+T9t4qDz7zj5xA?= =?us-ascii?Q?r9Rngx7mHeBh4J1e9yffud31d9M7i7hglSklUqe3pUxg8/mDAa9dLu6MIn1i?= =?us-ascii?Q?aL4zHC61eaCBjU7lP+DpYxkio0I0ruWCxDvu1MBVKJmsoO/55/2xKPxoBIGi?= =?us-ascii?Q?Cv0DGSut2mcY2EGo4VvvaQyO4gN3xQbtaSIwFlUkZThOY87Zlz3HM4BUlV6n?= =?us-ascii?Q?Ma5Fia+sU/0NZctBvD5X2XOEERUJpRtjOj/FpvCOC+ne4RJWVyKQL2zX7Qn2?= =?us-ascii?Q?bqZIFS55XNYtX5W+odEdlycMjrnIRHGrqqOoMdiq6GeEFOGIS9oZFYydV687?= =?us-ascii?Q?ByWuOqZrliWw1fyx6teiBRr5wx0rrhI0?= 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 { -- 2.18.2