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 B8C5845BCC; Thu, 31 Oct 2024 00:13:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C37643515; Thu, 31 Oct 2024 00:13:20 +0100 (CET) Received: from egress-ip42a.ess.de.barracuda.com (egress-ip42a.ess.de.barracuda.com [18.185.115.201]) by mails.dpdk.org (Postfix) with ESMTP id 0131543528 for ; Thu, 31 Oct 2024 00:13:18 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2113.outbound.protection.outlook.com [104.47.17.113]) by mx-outbound11-85.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 30 Oct 2024 23:13:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZwIBcecf2Vqhb8HoHrMLauQeqP+HLtzQzLf6kr6CpgRa+c/vgDvuSXZNQHs+l2BnYTBc83PNhDPVHnJGitLgKElyUYXKHR0DyLDOBMesN5b00mDlTgQ4jdrmJKNXAGFk24YKwbEI01zlfZBwzp7edWBC22UteJn4iK0brZJyPGMjSx3anXh3TIEPy3RsZdL5gWm54JM2ZyB8fwhAhvHUjF+A9rLygFxRXzeseT9TAA4vBgi9Tyfnb2j1V4nRIssfabqzdstR9JUHK2k8fKVoAsxOh4UKGHQcNESgSYJ9pmFjdtMleHAmx67gqARBd6U6t5dsJi1jKjhQwvjN7KNFDg== 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=kpbVvewaEFGHkuC7W200hrBRiehmJhKwzHVtxxsAyupbwoLe1DSFDS5/NO5bsXlAYJ7Sez9tUyGXes1jGVWJ1rzOXcH74oQHBTlwyGeNSzP+CgTkZ9/1y2mMm9YcLsTs6BmsZ46PxfgWcLUxf+MJW/zAWp6XnSPwCSb7mfgUQg7I3v1r5791qHx2SZfWXPM5DgrAZMSENUgtTiOEfTDLTWut4PnU0O5szXuzEnRRhZvolteutW5xK5IDqzVOqdliLz+puh1qSUg+ZT3uOe1F57BYT5QsLN8uUm898y7S74KCzy/m6w99tOZNPyn0rgRL7HgTSDujFOetW9RHWlgX6Q== 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=glWvcQ95mn61V3JDwyzf9tlpQduAEXdwqdqJBklY+ypPCplePmzGjDr2l/guzpy3vAKmx6mRi1KLaGTNKlrf5xxQf12NRTZ/j6DWbW/9RnaTSRqSUo+VgWqauG5nbG/aK4XXVzDWApAeER6JiHfsiVrxhgMjNQvDIEyyaJTQ5lc= Received: from DUZPR01CA0003.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::15) by PA4P190MB1214.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:be::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20; Wed, 30 Oct 2024 21:41:08 +0000 Received: from DU2PEPF00028D13.eurprd03.prod.outlook.com (2603:10a6:10:3c3:cafe::6c) by DUZPR01CA0003.outlook.office365.com (2603:10a6:10:3c3::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20 via Frontend Transport; Wed, 30 Oct 2024 21:41:08 +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 DU2PEPF00028D13.mail.protection.outlook.com (10.167.242.27) with Microsoft SMTP Server id 15.20.8114.16 via Frontend Transport; Wed, 30 Oct 2024 21:41:08 +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 v5 77/80] net/ntnic: add async template declaration Date: Wed, 30 Oct 2024 22:39:24 +0100 Message-ID: <20241030213940.3470062-78-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241030213940.3470062-1-sil-plv@napatech.com> References: <20241021210527.2075431-1-sil-plv@napatech.com> <20241030213940.3470062-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PEPF00028D13:EE_|PA4P190MB1214:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 27520662-71a9-4073-68cb-08dcf92b90b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?DQwDfXKF1JDUXHdRGtPThscFip7okQof9fhQOweQPW8slTlgGzTnQEp9AiTZ?= =?us-ascii?Q?kaH7cDNKP6+b9Xu34QIjUwPmtG/X3WTBfQK/9GFaener3iUMd44D7bKpCa+U?= =?us-ascii?Q?pqcjaV0Dmt7xv/wcJK1JPU9HLAvA7+m8QxcSbfnYOp9vNhPwaj1lbXtLPhpX?= =?us-ascii?Q?AmybFjFBMz72dvoS8DL9KWU9EmKECFw+NiDacS5sUnH6fflvbkdbMr9tq0I7?= =?us-ascii?Q?o5oE3ux1PY9QOyUEMq4GobUc9kw2ZRAhsMQvpqEy5AILp2G224oqJ4hs6azW?= =?us-ascii?Q?1ngltHQqWsICZ36+YVC9f7uBAFeNA0HohxsC6wz2lXNRcDM9ozvge3NSHEOl?= =?us-ascii?Q?P9HHbf6p1GJ3sSCqQvcvzdAKJRbEnBr1SP1azDgsChg9i73XnexWMiYg1WEH?= =?us-ascii?Q?Uh9ixfJuSV2MJgyy/lpb7Tbt36Y5Z7YdOfo6oChMvf3uWrQ5XhEVbufVwICA?= =?us-ascii?Q?at0NftoimJfb/XgjjKKoKP6l4sno4oUHGvDhPZE6tkcetW/poGpoMeCXfD+O?= =?us-ascii?Q?98CP9dqXrm9JtiESeeNvr6cbS9Jmxh8oWVUy9jyIJw8BIEXFAlN2+SghmMbw?= =?us-ascii?Q?kAz4bngOUUsdNUkf4j+f/7arI5HatE+8b5PyD3bM62YToPAlDITWKBdJhn9K?= =?us-ascii?Q?qybqwyEu4qnRZVylUnMGcb5Ea+I/rsItcODY/7i+mmI2fX22F/dZ79GWoAWq?= =?us-ascii?Q?mIxHJtb7ApElT/MGmECWUm2QXNLYUWSxwK4GwDChZ0MeSmbVzGQ0HXJnGmwW?= =?us-ascii?Q?0F6wo3zBl4CCpwBvtW9RgOHjpeUvjR5T3hKEavj0ebJTRUZ6l5Xc/wnwfduG?= =?us-ascii?Q?rkjDHFM9bS/qF793wjOl6W9wPjTYhvmkgMdsofiU5HJNYqDAQQ3G/2XwwoF+?= =?us-ascii?Q?HSy8VmeYE/ncx+GqIrAROs93Ajr+BTvXZ7sfXZEwVL7Zmf4kyyyX3bCf31eW?= =?us-ascii?Q?5Sza/EQWA5ggP11YjspGcwd2EFX1/FiQWDl1HO4N0lw61hKzVghHQr0E1eaW?= =?us-ascii?Q?f5akCzMVTKDXk3Ww4j1ZkztwW84IoUB2MkmBKLKJWG1GXGj2oF8clbtsf8vA?= =?us-ascii?Q?/KbdscJCYF/cwkHxcnhTd82Dr8d5Zs3m/teixirDGcY/5qWfaKLbTR+IaPR6?= =?us-ascii?Q?QQXYjfbuSGf+MigBfdix0eXxEkVkJSv/Sj0LpvUeBsm/D8850jLc0VuhZ4Go?= =?us-ascii?Q?YXf1LAUtIt/7R2c/JN2rqLCsP2J+3DEySfg6mT9w6hafPLrq7VcXGsxbBPNB?= =?us-ascii?Q?OKgIjTUd/Ty+00V+ikWO4rujObdQcwGKE+oLZxNO8CmLovunggtzKtcn+ZW5?= =?us-ascii?Q?nVYFWLoxIdfgghzfS3h3vS4+55nBkQeZZ15anTV6HVJCI5DfGLpOK8CH05CO?= =?us-ascii?Q?vMwRi2ik7skNkTH4D7uN6Scmf4X0yAxnoo9W1tchjzOhMpqNXA=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)(376014)(36860700013)(1800799024); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: mvI+o72aeZX4aZM6DBzFKKlMvGNWsltbztbaX1YpKbpN0ok2l2QS3G/C2tNVVuXDHi+0RSlLqBBpYePsh1pCBIYOXDhLJpt2qAJpye8Ta0NKDbM9P9u1CPh2wdXp/7gOkHrv5J+aXDqj+cA/ycKj3oA4uqC0spFwpwFvidi5q4LCURh0wzWKkQq0KCDWXcSoqZHpNcq0hFbXkPPffbPYU88Dtw5eV4hPzGAyp+TropePgSqrH6onfqPm+Sd++AHfO/SpuyDxYwgCoUSqVMZXctlAac+UmUPRhFbGJANbSG2GSGRH6MLf8MiYF0ICE92B62A+aLEul8fXnPZRqaqIHhQWQvw755Kz/M5yiHnJSf/2y9L/vbKQjxbNA8NQPqmM89s15S+wv8vNkmDDrRnEDjmNImzN+U6ImbdMbBBxs9gU3FAZzPmVQ+MoTnCU4yy13kKNQdCnLSLJyUXB0pjbfbgjo6XT9kwVdfnjnuv/W1mkup6huqW6NDfyF/Iix3votHfbQV4PN0uAqSbq8yvXac9Mw06mvwfWZeZRXFrxwPuz5oywQ1a/6Ak1ntkJKvAjN/8yjfb8CR/3Hf6tQMaC8wm+3iOGTToG+8c40gjPiZE065TTfHs1i2foCHI0ZrbjDqNPb/+tr6dL5UB2fqkA41cFtAKXkxjxtC1RSlParM0= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 21:41:08.3648 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27520662-71a9-4073-68cb-08dcf92b90b7 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: DU2PEPF00028D13.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4P190MB1214 X-OriginatorOrg: napatech.com X-BESS-ID: 1730329995-302901-12800-46807-1 X-BESS-VER: 2019.1_20241018.1852 X-BESS-Apparent-Source-IP: 104.47.17.113 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.260092 [from cloudscan15-25.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