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 91A3D45C0D; Tue, 29 Oct 2024 18:16:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7111642F53; Tue, 29 Oct 2024 18:16:35 +0100 (CET) Received: from egress-ip11b.ess.de.barracuda.com (egress-ip11b.ess.de.barracuda.com [18.185.115.215]) by mails.dpdk.org (Postfix) with ESMTP id 8DACA42FC9 for ; Tue, 29 Oct 2024 18:16:32 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2171.outbound.protection.outlook.com [104.47.17.171]) by mx-outbound43-199.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 29 Oct 2024 17:16:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xuDPTxYQe9LRH/YK10jtdcB3V/ldScvyBxIuijAsMvUn8JyVlpWllEmBt06U/FnPdeHbo+uN+aG9dlA/cTGfinP9f3B1Feytivn8xTCdxRtRTzMSJ5dY6tEUU2BOVKgCpD2Nzb+bkd4A/F5XucYTPmHGZmPsvzdyKBnolVoSUUe6Gw7cUlwqxvjW3ceJgFobnt0UsDHlhopA7YoBEOm5OruJjoy5idrPLRhfc5lSJZFvVP+skMMY5uXptIHBJum+beGcYUgOv1DKwPL0pU0ClBN3Ul4d6K8PXEfDufySZzEG1GWbbxkeWJRlsAp66Vu9YqfnbIXUnDrsgAFJAmuE7Q== 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=r6+dDgJbY5UmAo9pu08TZMMqPXSYypuLAdb+E8PA+LI=; b=Ea3wy2/9K5OK4R8z2Jdl/bY2kQREG6tnoiUn9QOO6JW0j/xKKVtGB+tx/JeNTU0yownKDtR0hIml4HUmbtyZcklZOlce7x4PyCngbkoVo4LMNhzjIVZ2C1vZm/7FfUuq7Rf0FHYlAXzB/GneIF/7EGpAmK2GWqhFl2JGom7w3DNWSHH1cgx8cQ7054rzbcyccT4YjMl5un516PNcDpd4bm0av5t9oS3EE+wfm3Jae1btVtqgddtW5eld7u3CAXhPcOXaso7AZjLGSMnAbVkfMjtzXqdW0MZRWDN1lFvBXJJQYCzeYr6oRlhpv1jh9TXKvNd8XblfYSOvt4JbK4O3mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 178.72.21.4) smtp.rcpttodomain=dpdk.org smtp.mailfrom=napatech.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=napatech.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r6+dDgJbY5UmAo9pu08TZMMqPXSYypuLAdb+E8PA+LI=; b=IDuFsbl4HUHsQgU2iy8SBEhF41UXfiEFc7zV/HkpzW7TraVi3AWypLSa0jWOXlsd4reBbNzv8DjiwNgS0nf7U/ixojNoF4HMekRzRSPLre4yaFq4wqLrT8jfQsu006FEbkRqdyrnfeofoWsEQx9MT1ytvvsktsfOnd7JgdJCEVo= Received: from DUZPR01CA0208.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b6::6) by PAXP190MB1719.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:281::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 16:44:12 +0000 Received: from DU2PEPF00028D06.eurprd03.prod.outlook.com (2603:10a6:10:4b6:cafe::71) by DUZPR01CA0208.outlook.office365.com (2603:10a6:10:4b6::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.17 via Frontend Transport; Tue, 29 Oct 2024 16:44:12 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 178.72.21.4) smtp.mailfrom=napatech.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=napatech.com; Received-SPF: Fail (protection.outlook.com: domain of napatech.com does not designate 178.72.21.4 as permitted sender) receiver=protection.outlook.com; client-ip=178.72.21.4; helo=localhost.localdomain; Received: from localhost.localdomain (178.72.21.4) by DU2PEPF00028D06.mail.protection.outlook.com (10.167.242.166) with Microsoft SMTP Server id 15.20.8114.16 via Frontend Transport; Tue, 29 Oct 2024 16:44:12 +0000 From: Serhii Iliushyk To: dev@dpdk.org Cc: mko-plv@napatech.com, sil-plv@napatech.com, ckm@napatech.com, andrew.rybchenko@oktetlabs.ru, ferruh.yigit@amd.com, stephen@networkplumber.org, Danylo Vodopianov Subject: [PATCH v4 81/86] net/ntnic: add async template API declaration Date: Tue, 29 Oct 2024 17:42:25 +0100 Message-ID: <20241029164243.1648775-82-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241029164243.1648775-1-sil-plv@napatech.com> References: <20241021210527.2075431-1-sil-plv@napatech.com> <20241029164243.1648775-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PEPF00028D06:EE_|PAXP190MB1719:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: c2b4a93c-ae2f-4faf-f792-08dcf838eb1f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?8ARSFhuwrnnVz2ShViqX3nTp0ux5CRDLAefeE2Y7eNFAVnm9iKFcFgT7zz12?= =?us-ascii?Q?Ww3m0t4SbSQxTcse3L6CZtwqGAapPxB1j/JZdcYPZnf73iBZidGoPjMFWeSw?= =?us-ascii?Q?fYhoapaxhUeETlqo45RmjdyydxK4VZ2A90HH8QI+Rst17UzgVMAUBCDMICeU?= =?us-ascii?Q?rJxesk0dHQMXpxlJTwW7kXy8J4YMcQfj5ixkbcKuQ6fSJaaR88TeqZR8bdVd?= =?us-ascii?Q?hbWm0ngtPH7f72XomDF+vI/s7iVPnbXknrVRfLTPbhVXWpTGv9IMCP941D+o?= =?us-ascii?Q?8VEjbcOnaPtAgLN8YqglsQE+doJ6P3SLuu1Uj6Lkniw95Rmf1cAGdAIiNNhy?= =?us-ascii?Q?LurYzk7iVSZXTtejUFJpIvtsKwa8G8PqKNIcoXCQqHD4Q+p27jEPW7vCK1zV?= =?us-ascii?Q?26JKc7tLbHTWgoQ33pmfqghb+YBqU6hV8vqGAdHTAnr+K+Rk1ZvbFZO/pS+s?= =?us-ascii?Q?nhDQrgf55n9KzzHI3xIy6gYsfDbx4G8t6QslMlCNZnPX8IrpcPHOj07eAloG?= =?us-ascii?Q?cFB1oMKlta3R1vLHTE95e6aeE5WdC6ATKVb52jnPYroB9HuAcemP/eyqX37T?= =?us-ascii?Q?vAYAKTHfZECA5R7ZeN0NrlVDdBmkmaqDpz13ITSKOF5sLH5FBknglUmUdxjV?= =?us-ascii?Q?c/jc3lIsmIMm4zyNmGTn7jA3Ls1uQIzDrGa7v6gjdkyDqBxlaNFt5T/RFSG+?= =?us-ascii?Q?jaIPo+XzfjSRsmmjmNDbRZaV9CjM2S09u4x20AhEgARRjbLifQXJ0Wk+TozO?= =?us-ascii?Q?zuKkoJm4UqWtYFaRMUyR8JBd2xoHL09G9il/q53sSA0h2d6KriK0x27LU/wx?= =?us-ascii?Q?GsWsdSaCTtP3nwSp1upvng+KM+FEXB6nheWXoRaFQ1MAt3zfH7c7PMDKg6+c?= =?us-ascii?Q?w9rkuopG0lrc6U2GRLuVCgzfb27LGt22gfxbTsugXiG/S2P/hXkM1hidU6WN?= =?us-ascii?Q?Ok68m8mb8JcSvXJpWajhNrgYfw7SvhkpM7TwH/dXb+AidDcMcLc//z9CNkyX?= =?us-ascii?Q?TWOiGffz4H7fdKQ2FTwe/MeN1BBGzWGzU/+0imU6zKfyCmbEuMhjtxek5eq5?= =?us-ascii?Q?tdtk8ZRxdYNdzcZebQi/fmEzFUZ02rakz/2a8YcwL2lePniHqYF2wAfNrDJ8?= =?us-ascii?Q?XDRrKLNcPAkWr5kmMPytHJ1zcDeaXNQ2u5V3VgaDfreIRNJ4X+s1e/e/PJVL?= =?us-ascii?Q?X8P+Yjg901DWfbQcohh/pOV1MBpkjpenS4jsXKbX4YsgqJv+VFDAtNQE18eY?= =?us-ascii?Q?hmHQiVwAWaIpt3CXpYWNPVOlEcdpVI8y1T7uhWIxOweIfaKOlUzUZBAAAPhG?= =?us-ascii?Q?Oeqg5DKmbbgMMUwqasnyK4tfhZI3SZ9rc7ibsjucovL21raKCS0uT2IqCTwE?= =?us-ascii?Q?zfTjsep8Si7oSNK21NwSKQRqvNAD+Cad4hzqDumxruKUYab2VA=3D=3D?= X-Forefront-Antispam-Report: CIP:178.72.21.4; CTRY:DK; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:localhost.localdomain; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: P3xeiJ25UKBPz4O765mXZoGjJkc5bamhZcll1V8/LWpbsfMNy5k6opDL7m29x8yy6/aUPFNbbL9jD1RcJ2/A8PpDsgNzTGgLLRs3QEdkK0q7FB7143SBp5w389WM0ytC/XD0guatKd0p9E9GkTl74zIEiqi5luXYI+w4fC7/bB7MU4ytzaZVuzZ1SiANAtx6SJzJK3SS3W/eYM2UvKVN3c6hqe7yoU1UQhoNpeeZAOPEcAD709sRuRoDSZP/1ruVIRdn4WcbGE6a+BqjAh5WXr7et1LyKMjCguYm23Wo/Q4+8NIYgbEU0GTQ6eguQbHgsINuMKEliZLY61OFxxFubpUroUMW6igOMObfep6IdQl4zXPpSstdwYzeFc9Hm74HpaGSX2PQ166CTvw1wS8+e3TgO/y9v7UNggEk8W2xf/lKvzMnQ1mG/nyl2ljwSvQzsNTzo3051E7zMQBZKozThqmWlTzpIwoyYXOLnV3y9/dVPP85p+0T5opMZe1WdBRS/nl/gmzyLdoVAspBmssD6bibwrza5miBazdUaWPD3Ca4ckqxQaMVSC0i89dGqi+S6g8udReMuzPciQ8diCI4s7TlLKUbo0VvVeORweGfPj5GKpDb58GFZsQ4o0Jm2bmBXtb9iT+ai9U0UHng0avRBIrx91vHdFCRJ7RxiNQfrD0= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 16:44:12.3396 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c2b4a93c-ae2f-4faf-f792-08dcf838eb1f X-MS-Exchange-CrossTenant-Id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c4540d0b-728a-4233-9da5-9ea30c7ec3ed; Ip=[178.72.21.4]; Helo=[localhost.localdomain] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF00028D06.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXP190MB1719 X-OriginatorOrg: napatech.com X-BESS-ID: 1730222188-311207-12673-29585-1 X-BESS-VER: 2019.1_20241018.1852 X-BESS-Apparent-Source-IP: 104.47.17.171 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVoYGFuZmQGYGUNQyKTXZ2Cwl0T TZ0tDE2DjZ2MLSNDnZxNjQwDDRxMLESKk2FgD2N6vJQgAAAA== X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.260064 [from cloudscan15-223.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 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 From: Danylo Vodopianov rte_flow_ops was exnteded with next features support 1. flow pattern template create 2. flow pattern template destroy 3. flow actions template create 4. flow actions template destroy 5. flow template table create 6. flow template table destroy Signed-off-by: Danylo Vodopianov --- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 224 ++++++++++++++++++ drivers/net/ntnic/ntnic_mod_reg.h | 28 +++ 2 files changed, 252 insertions(+) diff --git a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c index d1f3ed4831..06b6ae442b 100644 --- a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c +++ b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c @@ -886,6 +886,224 @@ static int eth_flow_configure(struct rte_eth_dev *dev, const struct rte_flow_por return res; } +static struct rte_flow_pattern_template *eth_flow_pattern_template_create(struct rte_eth_dev *dev, + const struct rte_flow_pattern_template_attr *template_attr, + const struct rte_flow_item pattern[], struct rte_flow_error *error) +{ + const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + + if (flow_filter_ops == NULL) { + NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized"); + return NULL; + } + + struct pmd_internals *internals = dev->data->dev_private; + + static struct rte_flow_error flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, + .message = "none" }; + + struct cnv_match_s match = { 0 }; + struct rte_flow_pattern_template_attr attr = { + .relaxed_matching = template_attr->relaxed_matching, + .ingress = template_attr->ingress, + .egress = template_attr->egress, + .transfer = template_attr->transfer, + }; + + uint16_t caller_id = get_caller_id(dev->data->port_id); + + if (create_match_elements(&match, pattern, MAX_ELEMENTS) != 0) { + rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, + "Error in pattern"); + return NULL; + } + + struct flow_pattern_template *res = + flow_filter_ops->flow_pattern_template_create(internals->flw_dev, &attr, caller_id, + match.rte_flow_item, &flow_error); + + convert_error(error, &flow_error); + return (struct rte_flow_pattern_template *)res; +} + +static int eth_flow_pattern_template_destroy(struct rte_eth_dev *dev, + struct rte_flow_pattern_template *pattern_template, + struct rte_flow_error *error) +{ + const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + + if (flow_filter_ops == NULL) { + NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized"); + return -1; + } + + struct pmd_internals *internals = dev->data->dev_private; + + static struct rte_flow_error rte_flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, + .message = "none" }; + + int res = flow_filter_ops->flow_pattern_template_destroy(internals->flw_dev, + (struct flow_pattern_template *) + pattern_template, + &rte_flow_error); + + convert_error(error, &rte_flow_error); + return res; +} + +static struct rte_flow_actions_template *eth_flow_actions_template_create(struct rte_eth_dev *dev, + const struct rte_flow_actions_template_attr *template_attr, + const struct rte_flow_action actions[], const struct rte_flow_action masks[], + struct rte_flow_error *error) +{ + const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + + if (flow_filter_ops == NULL) { + NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized"); + return NULL; + } + + struct pmd_internals *internals = dev->data->dev_private; + + struct fpga_info_s *fpga_info = &internals->p_drv->ntdrv.adapter_info.fpga_info; + static struct rte_flow_error rte_flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, + .message = "none" }; + + struct cnv_action_s action = { 0 }; + struct cnv_action_s mask = { 0 }; + struct rte_flow_actions_template_attr attr = { + .ingress = template_attr->ingress, + .egress = template_attr->egress, + .transfer = template_attr->transfer, + }; + uint16_t caller_id = get_caller_id(dev->data->port_id); + + if (fpga_info->profile == FPGA_INFO_PROFILE_INLINE) { + uint32_t queue_offset = 0; + + if (internals->type == PORT_TYPE_OVERRIDE && internals->vpq_nb_vq > 0) + queue_offset = internals->vpq[0].id; + + if (create_action_elements_inline(&action, actions, MAX_ACTIONS, queue_offset) != + 0) { + rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, NULL, + "Error in actions"); + return NULL; + } + + if (create_action_elements_inline(&mask, masks, MAX_ACTIONS, queue_offset) != 0) { + rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, NULL, + "Error in masks"); + return NULL; + } + + } else { + rte_flow_error_set(error, EPERM, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + "Unsupported adapter profile"); + return NULL; + } + + struct flow_actions_template *res = + flow_filter_ops->flow_actions_template_create(internals->flw_dev, &attr, caller_id, + action.flow_actions, + mask.flow_actions, &rte_flow_error); + + convert_error(error, &rte_flow_error); + return (struct rte_flow_actions_template *)res; +} + +static int eth_flow_actions_template_destroy(struct rte_eth_dev *dev, + struct rte_flow_actions_template *actions_template, + struct rte_flow_error *error) +{ + const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + + if (flow_filter_ops == NULL) { + NT_LOG_DBGX(ERR, NTNIC, "flow_filter module uninitialized"); + return -1; + } + + struct pmd_internals *internals = dev->data->dev_private; + + static struct rte_flow_error rte_flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, + .message = "none" }; + + int res = flow_filter_ops->flow_actions_template_destroy(internals->flw_dev, + (struct flow_actions_template *) + actions_template, + &rte_flow_error); + + convert_error(error, &rte_flow_error); + return res; +} + +static struct rte_flow_template_table *eth_flow_template_table_create(struct rte_eth_dev *dev, + const struct rte_flow_template_table_attr *table_attr, + struct rte_flow_pattern_template *pattern_templates[], uint8_t nb_pattern_templates, + struct rte_flow_actions_template *actions_templates[], uint8_t nb_actions_templates, + struct rte_flow_error *error) +{ + const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + + if (flow_filter_ops == NULL) { + NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized"); + return NULL; + } + + struct pmd_internals *internals = dev->data->dev_private; + + static struct rte_flow_error rte_flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, + .message = "none" }; + + struct rte_flow_template_table_attr attr = { + .flow_attr = { + .group = table_attr->flow_attr.group, + .priority = table_attr->flow_attr.priority, + .ingress = table_attr->flow_attr.ingress, + .egress = table_attr->flow_attr.egress, + .transfer = table_attr->flow_attr.transfer, + }, + .nb_flows = table_attr->nb_flows, + }; + uint16_t forced_vlan_vid = 0; + uint16_t caller_id = get_caller_id(dev->data->port_id); + + struct flow_template_table *res = + flow_filter_ops->flow_template_table_create(internals->flw_dev, &attr, + forced_vlan_vid, caller_id, + (struct flow_pattern_template **)pattern_templates, + nb_pattern_templates, (struct flow_actions_template **)actions_templates, + nb_actions_templates, &rte_flow_error); + + convert_error(error, &rte_flow_error); + return (struct rte_flow_template_table *)res; +} + +static int eth_flow_template_table_destroy(struct rte_eth_dev *dev, + struct rte_flow_template_table *template_table, + struct rte_flow_error *error) +{ + const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + + if (flow_filter_ops == NULL) { + NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized"); + return -1; + } + + struct pmd_internals *internals = dev->data->dev_private; + + static struct rte_flow_error rte_flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, + .message = "none" }; + + int res = flow_filter_ops->flow_template_table_destroy(internals->flw_dev, + (struct flow_template_table *) + template_table, + &rte_flow_error); + + convert_error(error, &rte_flow_error); + return res; +} + static struct rte_flow *eth_flow_async_create(struct rte_eth_dev *dev, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow_template_table *template_table, const struct rte_flow_item pattern[], @@ -1106,6 +1324,12 @@ static const struct rte_flow_ops dev_flow_ops = { .get_aged_flows = eth_flow_get_aged_flows, .info_get = eth_flow_info_get, .configure = eth_flow_configure, + .pattern_template_create = eth_flow_pattern_template_create, + .pattern_template_destroy = eth_flow_pattern_template_destroy, + .actions_template_create = eth_flow_actions_template_create, + .actions_template_destroy = eth_flow_actions_template_destroy, + .template_table_create = eth_flow_template_table_create, + .template_table_destroy = eth_flow_template_table_destroy, }; void dev_flow_init(void) diff --git a/drivers/net/ntnic/ntnic_mod_reg.h b/drivers/net/ntnic/ntnic_mod_reg.h index 572da11d02..92856b81d5 100644 --- a/drivers/net/ntnic/ntnic_mod_reg.h +++ b/drivers/net/ntnic/ntnic_mod_reg.h @@ -430,6 +430,34 @@ struct flow_filter_ops { /* * RTE flow asynchronous operations functions */ + struct flow_pattern_template *(*flow_pattern_template_create)(struct flow_eth_dev *dev, + const struct rte_flow_pattern_template_attr *template_attr, uint16_t caller_id, + const struct rte_flow_item pattern[], struct rte_flow_error *error); + + int (*flow_pattern_template_destroy)(struct flow_eth_dev *dev, + struct flow_pattern_template *pattern_template, + struct rte_flow_error *error); + + struct flow_actions_template *(*flow_actions_template_create)(struct flow_eth_dev *dev, + const struct rte_flow_actions_template_attr *template_attr, uint16_t caller_id, + const struct rte_flow_action actions[], const struct rte_flow_action masks[], + struct rte_flow_error *error); + + int (*flow_actions_template_destroy)(struct flow_eth_dev *dev, + struct flow_actions_template *actions_template, + struct rte_flow_error *error); + + struct flow_template_table *(*flow_template_table_create)(struct flow_eth_dev *dev, + const struct rte_flow_template_table_attr *table_attr, uint16_t forced_vlan_vid, + uint16_t caller_id, + struct flow_pattern_template *pattern_templates[], uint8_t nb_pattern_templates, + struct flow_actions_template *actions_templates[], uint8_t nb_actions_templates, + struct rte_flow_error *error); + + int (*flow_template_table_destroy)(struct flow_eth_dev *dev, + struct flow_template_table *template_table, + struct rte_flow_error *error); + struct flow_handle *(*flow_async_create)(struct flow_eth_dev *dev, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct flow_template_table *template_table, const struct rte_flow_item pattern[], -- 2.45.0