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 9777845AAF; Fri, 4 Oct 2024 17:54:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E66742E9A; Fri, 4 Oct 2024 17:51:30 +0200 (CEST) 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 6D791427B4 for ; Fri, 4 Oct 2024 17:51:25 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2109.outbound.protection.outlook.com [104.47.18.109]) by mx-outbound22-159.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 04 Oct 2024 15:51:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RUaEmO/dxVpKxjf5UZQ/sQoOjWobQvoGNiFQ+nvY2J7DPPmVtTnjTugy+Y6H44qQ2xNSXa28lJHsKPDFGyLb9XyoGuwk9ksLJlzwGFcQKPnXnDkWhAacLFb9k2UqiPt/75fOGz6Se+d8f0InLRmt5AYfIWIlpa/qqouEDDsj8ZC883JM1buoPYlwnS8CzO077YWxdT5UZyqbdPjXMR3L2O3Yzvob0sgE+fJHIR9CvBhj9s8q06XEKj3MGH6OI/nr5FrZ4E5BLy6iSUTjjYeQGeNOGBRtBzbA2cQQP2YxFCqOy2PHchmxLK/zQ52ycqUMkWzYBVHj3F/fi6HQl6/0lA== 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=ymnCzHUXbBRZMviakyhG3k1Pg5kIIqQyVh+K/W1WSCI=; b=UMrr87p2gwUQD3K2IDZj3tjml2m2uAV+QBC3gRV05pHbXh/b/nKf+lnUlq7ns95Yd2K2HsbPEDM7cdF0kBVMEX42bLck3jPo26Fu8XKWmOYuWlpVHXNZvPbiHzC2wbeW6gW9pvR/3bTBnYSR3+Ul8q6heWcvueAIJvwIwZ1WftQy+L0WiC50ptjmynLe68eE2CsJQoCjZvdzYCjd6fDghQsjGzFB+324PvAfLnTCttel28n2fspo9UcaFWJ5V4tx6zDyfYRaSQMiNCLcxHaXcVT0eyD+5gQEFM0mXGOlWaIoXsi9rJzZcMJ/eMK6si6j/GE9z1uLDj6+u/Nj2J8mpw== 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=ymnCzHUXbBRZMviakyhG3k1Pg5kIIqQyVh+K/W1WSCI=; b=FsczrhXngnSQzenX69C+oGrG4FTld76HnpQd39YL/vFZJKH2CXVQUuoqucQY+nsdAAWsm5cE2ET5UTAEFmKJq9dg/pLfnqx5i3/JJk7DpzXs31Tei1PxLBpKajIPWEkNU0HCIfv5xira4URMQaAgpNNeYJc/yONYKUsNGOwrFK4= Received: from AM0PR10CA0112.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:e6::29) by PR3P190MB0924.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:90::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.24; Fri, 4 Oct 2024 15:36:05 +0000 Received: from AM2PEPF0001C715.eurprd05.prod.outlook.com (2603:10a6:208:e6:cafe::67) by AM0PR10CA0112.outlook.office365.com (2603:10a6:208:e6::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.18 via Frontend Transport; Fri, 4 Oct 2024 15:36:05 +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 AM2PEPF0001C715.mail.protection.outlook.com (10.167.16.185) with Microsoft SMTP Server id 15.20.7918.13 via Frontend Transport; Fri, 4 Oct 2024 15:36:05 +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, Oleksandr Kolomeiets Subject: [PATCH v1 01/31] net/ntnic: add flow filter init API Date: Fri, 4 Oct 2024 17:34:24 +0200 Message-ID: <20241004153551.267935-7-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241004153551.267935-1-sil-plv@napatech.com> References: <20241004153551.267935-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM2PEPF0001C715:EE_|PR3P190MB0924:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 4c6c79d3-dd92-4332-2800-08dce48a42b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?5iV90GE+u/qE0jo6DeFB3XVDMMgTHvele8AzTX4PmeQVA00waSOSG2gzXIdF?= =?us-ascii?Q?MkMfkPih0UUOSvnSHhVYU76Hv+JeRLdRjiANjInCncEX+WUBods319ngwxAK?= =?us-ascii?Q?IeQTsUDY6zP8gVqRwo1ML6x5Qa6bQXlAl2EkWeoC8GQKreiIpzzyZKyunnvf?= =?us-ascii?Q?OhtF1q71P3HyUiUfHGnC185yXT/PKGZlFXSFLMlLankqQ2QME42Xbm2nl92a?= =?us-ascii?Q?mcgj4VgNsVxHgw5WYNzAaDirtu/j5Qwp+tDM01NZQjZC5yk3T3uM9g6qXdLU?= =?us-ascii?Q?dNL4GNdZp8UTR21pHNwEIMmKWxJbDMvJDai/OsWP4HD3E9DYt2iZN/KxGjr6?= =?us-ascii?Q?oQ4Oj6vIeSYGQR4TZAH8Dix58XIq76q87g9FB1VzMHWb03H24odCI39VV07w?= =?us-ascii?Q?yMqJXP/wg4gA7SvHa52OdiWCuSvxKiYSfsRU99RjVKbW7i1+702a+8hiehBJ?= =?us-ascii?Q?t6gOcx7ROxM74CZF4TSrMtNq2MxDb6lzzo691P2QcWds4CKAp6mDjFGjmfjz?= =?us-ascii?Q?4q0yJ6+igd4RpYjM582V0T4hR5DuzqCN1no8morbry1tzcPqNG5plpuIN642?= =?us-ascii?Q?KqK5WeVWhW8w/lKtpYMLMHQ7mr/liMdnXCEXRP8CdWQ8GWuw+yOyYzrjb+28?= =?us-ascii?Q?frID0D0WIcfiGzdI83AKxPpjKzzhsy5xGSQvz0QVhZxVVkUzm8Rg5Fr9+GcV?= =?us-ascii?Q?NUwy1W2+hDBZ4cX1c2QfFjQOMUHHmry4VyZeJxcc8wGpZheiIa8qnXK1zZJK?= =?us-ascii?Q?TcS7lYXiDf+5lLADnKOZn/kyZSAd4FDJc+RewPmJUo5UUzTHCgGWK3wALZsD?= =?us-ascii?Q?kXJYqaS/o39qdFiIupc7cMPbhwC9o26PVxelpZN76GesJMN1vRLUEw64KgKQ?= =?us-ascii?Q?qWLxVByBsFEGAyQ3Lcs/8MoDSpkW+5k5lmeJQA87VvEFDki1GMcyzsg/N4mH?= =?us-ascii?Q?atzHCnk9jg2g8K5n7nLcRYzU15eWmZQQSpSiiWhTfApi0WiV7K+onzRQwjlh?= =?us-ascii?Q?ZVcb4eOUf2L+gprtgFIcl6ViMTCbfHCD3ulTboU9C6Z7ZK/0ccQHBISXABnv?= =?us-ascii?Q?u4RY/I91TE/0sHnS6nNJg1f943fvv/mX0DYDZWNvEqUdgtd4JYHHvh0rWF7k?= =?us-ascii?Q?jkzEezEWOuPKsiSKRMjA71BuE0U+aqHZjz9STcCAm4XGYnVZ7HOhse97nkKt?= =?us-ascii?Q?Qm412LAOKWc6HC/F3tbzb3Idk0Tphc+5Jx2Sr8pzZE8VuVF2yV81syNyrUNB?= =?us-ascii?Q?gF7P5dkxrwIkMMrAKfhbq82VG2e9tHIq2IT7hJnE9ColU6WQHEmzAPYMSfhJ?= =?us-ascii?Q?jUCjw7jNcYaWDF0/Anko9XuolwHQWLmCW+kU3+2489UTtkWw2f96HLpxAF0+?= =?us-ascii?Q?7yrO1gM=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)(36860700013)(376014)(1800799024); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: AK14g6fX+L/PxwdCPDnABqrvi+99EMkaUEZoCNYnqPXVOnxtY4btlFUM6EzmTm+vdaHwkix0ah89fB6DKUWXFj+hbPOk1uAsyDDtkfrcWxFa6de6k4nyTKT+NrziRf2Ox9WkrRv2vD+JHtNjPNdcxzcDjcwgRcL1RuoX8v7Sy5E/2P4prCp9s7it0RBaHgQ6jrfHzllAhmI+KRZYc9t4eIvrVaVZx8eqSm8zF7qR2M8/nIKLdSg7kg/HPBUkNlKSJspik5ygC7Y9hiLCWwhu1RY6cI4z3wm7RZgj2pbzmhWo5pmHlLbl88ATnv2SlfaDEpAq1gq1Sflo6MK0Yqzx78YrHOBcvdWZdpvOnkw4LW/I6/zwgeaC0sYWSyXNKOlnCr3ASiZ5CQ2C1UCwFbWYbeBlAvjEihx14jN5++EKSEXiExZ30VRPOGb/+TM4t7R7NVqyU71P854dJoE9nYGa8e3xoW9T2o83P2pxROahz6EWYK5mNxXSd7pMY6mxv3whp/Y7T9C+cCwPULyYUVeQW5dkZcW/lY6inkXmLiq/2jN1pTZxeuSCBuQrD5Qe+fWlocbHAcWYvmGG00nCa4AObCr6MqguM+ar9E5keJyp0GmtvAXuX43ZYHaqL/LwhRe0npdC5lK1zNELgBF54aBQUw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2024 15:36:05.3615 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c6c79d3-dd92-4332-2800-08dce48a42b4 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: AM2PEPF0001C715.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P190MB0924 X-OriginatorOrg: napatech.com X-BESS-ID: 1728057084-305791-12648-36000-1 X-BESS-VER: 2019.1_20240924.1654 X-BESS-Apparent-Source-IP: 104.47.18.109 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKViZmJmZAVgZQ0MQs1TzNKDktJd XCKMnM1NQ0NdHC0jItxdTM3MLCIM1SqTYWAC3p0TdBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259494 [from cloudscan20-43.eu-central-1b.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: Oleksandr Kolomeiets Add high-level interfaces for the initialization of the flow filter. Signed-off-by: Oleksandr Kolomeiets --- drivers/net/ntnic/adapter/nt4ga_adapter.c | 18 ++++++++++++++++++ drivers/net/ntnic/include/flow_api.h | 12 ++++++++++++ drivers/net/ntnic/include/nt4ga_adapter.h | 6 ++++++ drivers/net/ntnic/include/nt4ga_filter.h | 13 +++++++++++++ drivers/net/ntnic/ntnic_mod_reg.c | 7 +++++++ drivers/net/ntnic/ntnic_mod_reg.h | 8 ++++++++ 6 files changed, 64 insertions(+) create mode 100644 drivers/net/ntnic/include/flow_api.h create mode 100644 drivers/net/ntnic/include/nt4ga_filter.h diff --git a/drivers/net/ntnic/adapter/nt4ga_adapter.c b/drivers/net/ntnic/adapter/nt4ga_adapter.c index b704a256c6..4105a6eb5a 100644 --- a/drivers/net/ntnic/adapter/nt4ga_adapter.c +++ b/drivers/net/ntnic/adapter/nt4ga_adapter.c @@ -75,6 +75,11 @@ static int nt4ga_adapter_show_info(struct adapter_info_s *p_adapter_info, FILE * static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) { + const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + + if (flow_filter_ops == NULL) + NT_LOG(ERR, NTNIC, "%s: flow_filter module uninitialized\n", __func__); + char *const p_dev_name = malloc(24); char *const p_adapter_id_str = malloc(24); fpga_info_t *fpga_info = &p_adapter_info->fpga_info; @@ -155,6 +160,19 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) n_nim_ports = fpga_info->n_nims; assert(n_nim_ports >= 1); + /* Nt4ga Init Filter */ + nt4ga_filter_t *p_filter = &p_adapter_info->nt4ga_filter; + + if (flow_filter_ops != NULL) { + res = flow_filter_ops->flow_filter_init(p_fpga, &p_filter->mp_flow_device, + p_adapter_info->adapter_no); + + if (res != 0) { + NT_LOG(ERR, NTNIC, "%s: Cannot initialize filter\n", p_adapter_id_str); + return res; + } + } + { int i; const struct link_ops_s *link_ops = NULL; diff --git a/drivers/net/ntnic/include/flow_api.h b/drivers/net/ntnic/include/flow_api.h new file mode 100644 index 0000000000..036e652b76 --- /dev/null +++ b/drivers/net/ntnic/include/flow_api.h @@ -0,0 +1,12 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#ifndef _FLOW_API_H_ +#define _FLOW_API_H_ + +/* registered NIC backends */ +struct flow_nic_dev; + +#endif diff --git a/drivers/net/ntnic/include/nt4ga_adapter.h b/drivers/net/ntnic/include/nt4ga_adapter.h index 4b204742a2..93218fd45b 100644 --- a/drivers/net/ntnic/include/nt4ga_adapter.h +++ b/drivers/net/ntnic/include/nt4ga_adapter.h @@ -23,7 +23,13 @@ typedef struct hw_info_s { int hw_reserved1; } hw_info_t; +/* + * Services provided by the adapter module + */ +#include "nt4ga_filter.h" + typedef struct adapter_info_s { + struct nt4ga_filter_s nt4ga_filter; struct nt4ga_link_s nt4ga_link; struct hw_info_s hw_info; diff --git a/drivers/net/ntnic/include/nt4ga_filter.h b/drivers/net/ntnic/include/nt4ga_filter.h new file mode 100644 index 0000000000..2024b500f3 --- /dev/null +++ b/drivers/net/ntnic/include/nt4ga_filter.h @@ -0,0 +1,13 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#ifndef NT4GA_FILTER_H_ +#define NT4GA_FILTER_H_ + +typedef struct nt4ga_filter_s { + struct flow_nic_dev *mp_flow_device; +} nt4ga_filter_t; + +#endif /* NT4GA_FILTER_H_ */ diff --git a/drivers/net/ntnic/ntnic_mod_reg.c b/drivers/net/ntnic/ntnic_mod_reg.c index 40e22c60fa..45cc767c90 100644 --- a/drivers/net/ntnic/ntnic_mod_reg.c +++ b/drivers/net/ntnic/ntnic_mod_reg.c @@ -88,3 +88,10 @@ struct rst9563_ops *get_rst9563_ops(void) rst9563_ops_init(); return rst9563_ops; } + +static const struct flow_filter_ops *flow_filter_ops; + +const struct flow_filter_ops *get_flow_filter_ops(void) +{ + return flow_filter_ops; +} diff --git a/drivers/net/ntnic/ntnic_mod_reg.h b/drivers/net/ntnic/ntnic_mod_reg.h index 3189b04f33..6dd6240c6f 100644 --- a/drivers/net/ntnic/ntnic_mod_reg.h +++ b/drivers/net/ntnic/ntnic_mod_reg.h @@ -7,6 +7,7 @@ #define __NTNIC_MOD_REG_H__ #include +#include "flow_api.h" #include "nthw_fpga_model.h" #include "nthw_platform_drv.h" #include "nthw_drv.h" @@ -117,4 +118,11 @@ void register_rst9563_ops(struct rst9563_ops *ops); struct rst9563_ops *get_rst9563_ops(void); void rst9563_ops_init(void); +struct flow_filter_ops { + int (*flow_filter_init)(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_device, + int adapter_no); +}; + +const struct flow_filter_ops *get_flow_filter_ops(void); + #endif /* __NTNIC_MOD_REG_H__ */ -- 2.45.0