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 CFD3A45AAF; Fri, 4 Oct 2024 17:08:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0812E427A3; Fri, 4 Oct 2024 17:08:13 +0200 (CEST) Received: from egress-ip42b.ess.de.barracuda.com (egress-ip42b.ess.de.barracuda.com [18.185.115.246]) by mails.dpdk.org (Postfix) with ESMTP id 59EC642759 for ; Fri, 4 Oct 2024 17:08:06 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2104.outbound.protection.outlook.com [104.47.18.104]) 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:08:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YLnQmia8AfDj7+adHIYAhdr3ERYd2EbKi+BPntY9weVFz4fN3+xELpyBiORbOIR5lg3OLQKfl++U84+SpsPrIojzxYeB4ZMR1btOeSxKEcg0ejxDsn23toTUkrjp8//NOa29oC2OK9a2vp1U37+GjrfUhIJGx7P5YHU6IJ/0aInO9yd2v3DRiaSAIAQwClYvmkuk2ka/2osMxRBaLkvoPSayHTPh0nRM3qqs7sj/VrKdKzSDkcAZd1oWjRVlygL3c52uHk0LrjpN7Gwf8IcfSabeZe8L/sIO91LwwcfwSQM/dROP6+QNAgTkRu/YV1gKZTGvYMkMueE4dKUQEyciKg== 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=qs+hK2xl4E+pmJuLt3yqFWaJoxgegM9saRAp0qfnoP1vBnI4+6eQuGmx/imcEDxp2z5IXxiMIdQhYB51UbvoL7RCnhGW6hpKMBq/Gqt8zRTRXP8lBcwJ39hV4BjKQieMvHI8eRmcvBTYjdcUH8mBbVN++oaT7Pf7gnjEhKdMEsFO+d6y7Ko1gh/k4UKV5UTveJqGzW0ENeGgmp/8ZGoIsLSBE3PvZSz9cmaG+4c5QcHBjO+tz4dJ6IxIX3hnUypBtcq3sfW3etQ4AcDZHiAC3/kRct2W6ydCT5qMmQb+3MnNfgEVhf6mqCy0uFu+x4T3Skv/GFrkVPekI4r4YN1hCw== 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=bodmMIZy3teCk9ExOELZGLFa7GZ8/e8Qj0asAZjtSzk/afCEhsRtRDNKL7KECZFgxGle189LSDtSmrQy7ln7u84uAD4o02t760imACY8AZ2PK3hUGuA1mgRaSpgp2swkpmisE3jgqLUMPSUhOsGDVWrfyRS8vl+Fu4XGopV+ktQ= Received: from AM0PR02CA0019.eurprd02.prod.outlook.com (2603:10a6:208:3e::32) by DU0P190MB1906.EURP190.PROD.OUTLOOK.COM (2603:10a6:10:3be::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.18; Fri, 4 Oct 2024 15:08:03 +0000 Received: from AMS0EPF000001AC.eurprd05.prod.outlook.com (2603:10a6:208:3e:cafe::26) by AM0PR02CA0019.outlook.office365.com (2603:10a6:208:3e::32) 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:08:03 +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 AMS0EPF000001AC.mail.protection.outlook.com (10.167.16.152) with Microsoft SMTP Server id 15.20.7918.13 via Frontend Transport; Fri, 4 Oct 2024 15:08:02 +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:06:54 +0200 Message-ID: <20241004150749.261020-8-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241004150749.261020-1-sil-plv@napatech.com> References: <20241004150749.261020-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF000001AC:EE_|DU0P190MB1906:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: f2ac2380-76dc-42c3-c5d5-08dce48657d3 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?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PLoEaDzUY9+iJGY6RNrLd?= =?us-ascii?Q?yahTN0vJSGxQYDIxl0XLgfTzh50cfpMZQoS4UmKbE51Gl39h3tSZXOTH+K3P?= =?us-ascii?Q?ZgEG7CN1ho/xK6MNKL40G0Fz+Ga0ZCZJvYORbohFZv/MG3LsdRdLFRi1T5Fy?= =?us-ascii?Q?clUKcJnOvj5gPRTcA/YX9+AkiG+hcN0yacvS4fwYUaXRMnsdyFmTmd0oY0XI?= =?us-ascii?Q?zVeZ2Homr4E17V765lw/TX4lif7EYjZsygxIvB/1prsWHTrx9HyB/fwY1Iis?= =?us-ascii?Q?PkLZCjmzTm4CxkaWqZNE2IF5O1bE6mGQK7sqtdPshvNJjhv48Jqt7jYr8g0D?= =?us-ascii?Q?dVo7ypG88v80W38ME9XaEFIV91kDA86pXyfZDROlyZHWvazeO/yelm6sNBBr?= =?us-ascii?Q?UlYdVE9kvVXfC8vk3149iqDwjffXiBvskEP3htUYhaWkzug7F8SqbZmk2UxX?= =?us-ascii?Q?21wGzyReGqCP+JURWkJ8UyEPX9QZqHXQa2i1f0wIP9tNnbarMurHmUmvIoFe?= =?us-ascii?Q?WZPaaY0=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: urCe9DyihcG4SU8FVS0Zfz8tCoOfpRtrJkZY28gPeQdhk/LeK38Uw1DsfsnWgJzS/vqRzHOPLUwh0mHIGbIXFKeqRt8E+jRgdA/zSWjvAqk4mMlvKl3mcHOQzgh7icO+0YEUvyb+A3wTmO1CMyWqZxa0kpmoFmSc9YTUz7kZcUvvMZX2z8e7wBAg9CVOI3691OHhBrvfkL7uWeE6qXel6ix9ZB5kjjBk7Ozc1J+Y89tS0QUVLBjILqcbgIXH0hQSy2VKQozs2FisX0RpW6G2B6w5Z8UwOD5Fh57ewM1YiYKMg2vtiSI9L92uZhgZGpD6w6jPCKtmhGuXlDy/BHBkbp3Pz10C4mhTyfBqBYxU4Td2D0ODC5jkax+xql9nyrFXSiXmCnvi/piQKxQJgU8+vG3jEQKAsiVURXqGWEpwX3Y7lH4qT8xD2HLfiphI91IZmXUCqhZ5EDbs0OzwIo1E1MzXJrGOE7AFj2d4yD1QZnZKJyG5cLqe1t3hKukAvovpLwNb3Wgvb+JlC8z9L+6CiswitbWSFsyidi92MXSRltMcXkt0gf0pV/09Kr7bSByXa/Q6OF5Ahiss/uUObHEbBpXTAmBuGWKMof/OnL2Nh1wYXB284uI5/qzLghvmjXh+HnS45216YOPpGxE5XJvFtQ== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2024 15:08:02.8296 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f2ac2380-76dc-42c3-c5d5-08dce48657d3 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: AMS0EPF000001AC.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0P190MB1906 X-BESS-ID: 1728054485-305791-12642-33554-1 X-BESS-VER: 2019.1_20240924.1654 X-BESS-Apparent-Source-IP: 104.47.18.104 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 cloudscan12-63.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: 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