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 35E3B45B04; Thu, 10 Oct 2024 16:15:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C06A640A77; Thu, 10 Oct 2024 16:14:46 +0200 (CEST) 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 E1C2E4066F for ; Thu, 10 Oct 2024 16:14:35 +0200 (CEST) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03lp2177.outbound.protection.outlook.com [104.47.51.177]) by mx-outbound11-198.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Oct 2024 14:14:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=e3M4ng9VjnfoCWY+1Epg3okV9b8kdDn8YtdO5gfNq32bY0gmQHIh6FvpkU+rXOaTIJ7yXpPCXv0KU6S8aoAl64kXfuNhOmy4W/T7oJNg3sr57gL2RS0Qn38/DxF+YhpQIz1Cp59D2XhOIUAEzOSv9Y/5dTVm9Spzya6pgvJacXW0jNr4wFv91SZaAzbgJklBxjpNw/I7fyYh1c7GmKZX5PM/z474ya0eIpiH97FYmuLwvCPensVJ/G+lLMLBj+E0WvFEl5zKgrhjaKtGo4zv7d5mBtjbhZvYX/bv7yGk4HaYnEtWUDdi9SSXOT5FiAebP4LJukS/FoqFuhMDoBvh1g== 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=FMj4ZueEc5DbxvH8yziYaJYYn4IFo9jfD7Pn/cNp/a8=; b=AMS42k6nVrSQtS+yDbAn98ifsIk4SksOxeXuW154EgHmgKha54bU2BAB7INhCWOql3FMIbUW5y1mdFe5gVML5XRPyLk1twkgvXdSk3VOURnjVorWywSeYXgaw1eYO7OCy8eTccIUfxUj/DAI2+r2duMR6leFqX/HkIvKtb8SwEu7ysxEYHYB0nR3YdLhBipvviHJ1IaJ+E2ow1REAjRxxLiArsUvNMuXDe2+41wIiJGfZZ9EvbofizIURFhogApvXn25rOhqSmYysJkkFzZfvPjOcLlDxyZeY3yDZMROZWD7yZPb6VJ5IpgKLBqV+8PU6leZ6i1AO41+jX8QzJpy0Q== 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=FMj4ZueEc5DbxvH8yziYaJYYn4IFo9jfD7Pn/cNp/a8=; b=ObWGfCdkdKa3sw13k/UxxHucgBh+Vtrbm0QuyRMOWiPLmebsAPOYxxMUMgSCXLU/QRjOH+/DZrd8S/LxW/RrqdGNv0RkLcC6E8703rXOfHVHWnrdndQ8WwUBr9UWt5XmRo7x18cWsIYw/t/6VInbPa+v42g7K6T9oACZb9fr1o8= Received: from DU2PR04CA0061.eurprd04.prod.outlook.com (2603:10a6:10:232::6) by VE1P190MB1006.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:1af::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.16; Thu, 10 Oct 2024 14:14:31 +0000 Received: from DU6PEPF0000B61B.eurprd02.prod.outlook.com (2603:10a6:10:232:cafe::1f) by DU2PR04CA0061.outlook.office365.com (2603:10a6:10:232::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18 via Frontend Transport; Thu, 10 Oct 2024 14:14:31 +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 DU6PEPF0000B61B.mail.protection.outlook.com (10.167.8.132) with Microsoft SMTP Server id 15.20.8048.13 via Frontend Transport; Thu, 10 Oct 2024 14:14:31 +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 v3 08/50] net/ntnic: add flow backend initialization API Date: Thu, 10 Oct 2024 16:13:23 +0200 Message-ID: <20241010141416.4063591-9-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241010141416.4063591-1-sil-plv@napatech.com> References: <20241006203728.330792-2-sil-plv@napatech.com> <20241010141416.4063591-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000B61B:EE_|VE1P190MB1006:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 865aa01d-8a01-464f-cb70-08dce935dc38 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?9WaO46Ol5ErdEyTdJo5nP+NJxnuEgr6Ayd4LNCN3jSyjQrLTtax9cXGAEeBv?= =?us-ascii?Q?kFJXHJyoLnDvbDuWe3jbuzQRPj6NDqsOggBsGAPDaLJvV+aaXziaICvu71/Z?= =?us-ascii?Q?jtWYsfmXzNVYEge5Q9Q2WKgzLV8hNGKxmcJyon6iQ8upQhKQ+NkXxLPTTS9g?= =?us-ascii?Q?hdUcMo2qbkD8BjauEylWl/kQULfmRnkaBgRHk+SBJYvCsn9BuM0ciQMZuV9Z?= =?us-ascii?Q?AIq0ggFwcK8MQlsDnUIdzMNwDkz4nypnoKPoXv9m939ieFvv2sGbba21+lxZ?= =?us-ascii?Q?+rhlm6JyYaxYUHOiDElWrGoUP4k1gLGLoY+/fYtCDnvf9MG/Jpve3Qu+urcC?= =?us-ascii?Q?nmWfZb8TPy8zo3g1bgDnnXo8mCm0GIll1a+M8MNe+96bC0r05irhC2IMLnHc?= =?us-ascii?Q?WI1NNr5hozDrkQ3cBk710F5GakYDqGkmv5SfOTg0Sh0mf/KT+/ab+aFPHB5z?= =?us-ascii?Q?lqExBa9F5r5yJDazM9HrMcxUXcpotQWn0LhuaR5C0uXjnhpPCtgNB2U8iXT4?= =?us-ascii?Q?fZO4lmksZCMMpHk7mNCww0cnKABa/BUZ/VB1iHlocqAZtymNWhju+xBO96kv?= =?us-ascii?Q?NjGXxm1HFT99ntHFnlfrbZGCAqV+g99zQ4h2xP8bT3X/TZ6i4SbqMXrwiXR9?= =?us-ascii?Q?h3XhK370XCNJuWNiB9sHFGFOhOczdmawD99nOGqqWejxxAqipdNO9gau0XdB?= =?us-ascii?Q?urQyvWhQJfRVgeoOz4ODhUbc4DimiELcEJckNQIj2wfczKdfLC54EkMjGoca?= =?us-ascii?Q?CumWC5wirONI5nHBDqu0lFIXhlA7m9RehttiY4jVd4mAtaZiKPCs6yWQ85oI?= =?us-ascii?Q?GZ1fRFQoTy3VWtP/cf3aLIRpYctwhha/QXoP8PohqZ1gKg6VCJGJHgY+T7jq?= =?us-ascii?Q?mKrwyIIDDZnb/j3mlVdEGCmFr7Z4/zF90qa23g7aKxeVY3kNM8b7JxXNeWMK?= =?us-ascii?Q?7izhBo0xlGTmpm92hFVRtZcS4GyiomrIUne982XldCAdsCCHXzwXb+OgV50W?= =?us-ascii?Q?zuINTCNtskZo7mfIZ92haTXCwC07IqdmKnmCYWM0/V2erDlUE9beJWMN41/x?= =?us-ascii?Q?CQePvP1PiRWb+ciY3m5LnHwWCssRlmVyMggQ7BMBoYECxykcwCQnGkcgm3b+?= =?us-ascii?Q?3u1oo0u41cOZWC8Oud2iKeDwE2gDPDiLvJXItAH43WjUCiDL7ps280+1JoZW?= =?us-ascii?Q?SsDZwnY62wHFJA8OYFGbeDxqzBFr46tiWrAw6m/lvUAc3jimM99GnmRazYtn?= =?us-ascii?Q?JROSDTNU+vM6Lh3kMzMzBw3mtL0GUGA/+SP7eDoHN3VG18H4ti3N1xSEWK7g?= =?us-ascii?Q?G1H27lhlchzIz2rVmQQWVtu5iXZmi9gP9GEu/WaFEikNoKGveZzTzLHezpWd?= =?us-ascii?Q?UuEuYtYBgUjV1cRCsAkrVBLCdGPQ?= 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)(1800799024)(376014)(36860700013)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: D5SunLUtRlryhKtnpoKTtderyl7mpCUAbZh8hIWvmC70NT8B6Tg1RD8QU/Fv1JpBz86nVBSgKKzTNuXKhI4qrn7p+p74lmSyRSyLC+Z1Z5DtZgbDrTFUCbPRckIDR1i1GdzrKIrzVkWLVElcKrYKtW/rTrMT9N98Lh9BO5jpiOCvYLoaGNnYfblOSEYXuyA5BXFKG9mFGHRuqDPEdLnzcBw3PxT9qSbp5LKXJ9SB2nyLFO4Qsa58YriTdClmXXa86f3Q0HlsCgNZjLhAxIwJOsN5dajLJHyy1xv2dRGkMB4TTODC/ao1qe00KYbtPn9FBEcGXiF83UNnT9noK6i/N3stOfZd40TRVDBczGoI7p8b65Vf9in1JbezTNC6HtJOUEEzpyUBIrnsuR57+B03ExuftWKK3GiuulqdgFgWu1Sb5gw+w81mEy41a1nhYTsWmEVN4SSGTX45zsBVEvENKLFgdn2jxtKa0x/gfxowpFIyw3iexjxZAUyPF5fGsxlh1HdqEYRMnjJ15/KftEQaP4UbWUBf2uvasQVJMzf6T5uDQbsqnrJqzr6NeeeboPGDsdktkCJ/uwpchX44UpZH8I2lX3n45uC5U2tVco1HwSEQKTJSuV+fVBTtwdIi89deDIQDNAOy3lvsglpQIqBwZmotElW/m5/GJWMVYTK1eyc= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 14:14:31.3734 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 865aa01d-8a01-464f-cb70-08dce935dc38 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: DU6PEPF0000B61B.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1P190MB1006 X-BESS-ID: 1728569674-303014-12758-25605-1 X-BESS-VER: 2019.1_20241004.2057 X-BESS-Apparent-Source-IP: 104.47.51.177 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVqaWJuZAVgZQ0MTC0ijF0sjC0M gyzTjFxDIxJck8JS3NLM3SKDEl1TJRqTYWAG/HJFxBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259630 [from cloudscan19-117.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 backend. Signed-off-by: Oleksandr Kolomeiets --- v2 * Update release notes v3 * Remove newline characters from logs. --- doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/include/flow_api.h | 2 ++ drivers/net/ntnic/include/flow_filter.h | 14 ++++++++++ drivers/net/ntnic/meson.build | 2 ++ drivers/net/ntnic/nthw/flow_api/flow_api.c | 17 ++++++++++++ drivers/net/ntnic/nthw/flow_api/flow_filter.c | 27 +++++++++++++++++++ drivers/net/ntnic/ntnic_mod_reg.c | 15 +++++++++++ drivers/net/ntnic/ntnic_mod_reg.h | 9 +++++++ 8 files changed, 87 insertions(+) create mode 100644 drivers/net/ntnic/include/flow_filter.h create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_api.c create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_filter.c diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index ee848d5a3d..28d27366f1 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -105,6 +105,7 @@ New Features * Fix issues related to release 24.07 * Extended and fixed the implementation of the logging * Added NT flow filter init API + * Added NT flow backend initialization API Removed Items ------------- diff --git a/drivers/net/ntnic/include/flow_api.h b/drivers/net/ntnic/include/flow_api.h index 036e652b76..112bcabdb5 100644 --- a/drivers/net/ntnic/include/flow_api.h +++ b/drivers/net/ntnic/include/flow_api.h @@ -6,6 +6,8 @@ #ifndef _FLOW_API_H_ #define _FLOW_API_H_ +#include "ntlog.h" + /* registered NIC backends */ struct flow_nic_dev; diff --git a/drivers/net/ntnic/include/flow_filter.h b/drivers/net/ntnic/include/flow_filter.h new file mode 100644 index 0000000000..01cfce03d7 --- /dev/null +++ b/drivers/net/ntnic/include/flow_filter.h @@ -0,0 +1,14 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#ifndef __FLOW_FILTER_HPP__ +#define __FLOW_FILTER_HPP__ + +#include "flow_api.h" +#include "nthw_fpga_model.h" + +int flow_filter_init(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_device, int adapter_no); + +#endif /* __FLOW_FILTER_HPP__ */ diff --git a/drivers/net/ntnic/meson.build b/drivers/net/ntnic/meson.build index e9f2110b8f..00b1ae4c70 100644 --- a/drivers/net/ntnic/meson.build +++ b/drivers/net/ntnic/meson.build @@ -42,6 +42,8 @@ sources = files( 'nthw/core/nthw_pcie3.c', 'nthw/core/nthw_sdc.c', 'nthw/core/nthw_si5340.c', + 'nthw/flow_api/flow_api.c', + 'nthw/flow_api/flow_filter.c', 'nthw/model/nthw_fpga_model.c', 'nthw/nthw_platform.c', 'nthw/nthw_rac.c', diff --git a/drivers/net/ntnic/nthw/flow_api/flow_api.c b/drivers/net/ntnic/nthw/flow_api/flow_api.c new file mode 100644 index 0000000000..b4866d4bdf --- /dev/null +++ b/drivers/net/ntnic/nthw/flow_api/flow_api.c @@ -0,0 +1,17 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#include "ntnic_mod_reg.h" + +#include "flow_filter.h" + +static const struct flow_filter_ops ops = { + .flow_filter_init = flow_filter_init, +}; + +void init_flow_filter(void) +{ + register_flow_filter_ops(&ops); +} diff --git a/drivers/net/ntnic/nthw/flow_api/flow_filter.c b/drivers/net/ntnic/nthw/flow_api/flow_filter.c new file mode 100644 index 0000000000..63e217ba13 --- /dev/null +++ b/drivers/net/ntnic/nthw/flow_api/flow_filter.c @@ -0,0 +1,27 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#include "flow_filter.h" +#include "ntnic_mod_reg.h" + +int flow_filter_init(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_device, int adapter_no) +{ + (void)p_flow_device; + (void)adapter_no; + + void *be_dev = NULL; + + const struct flow_backend_ops *flow_backend_ops = get_flow_backend_ops(); + + if (flow_backend_ops == NULL) { + NT_LOG(ERR, FILTER, "%s: flow_backend module uninitialized", __func__); + return -1; + } + + NT_LOG(DBG, FILTER, "Initializing flow filter api"); + flow_backend_ops->bin_flow_backend_init(p_fpga, &be_dev); + + return 0; +} diff --git a/drivers/net/ntnic/ntnic_mod_reg.c b/drivers/net/ntnic/ntnic_mod_reg.c index 45cc767c90..2094e1fbb9 100644 --- a/drivers/net/ntnic/ntnic_mod_reg.c +++ b/drivers/net/ntnic/ntnic_mod_reg.c @@ -89,9 +89,24 @@ struct rst9563_ops *get_rst9563_ops(void) return rst9563_ops; } +static const struct flow_backend_ops *flow_backend_ops; + +const struct flow_backend_ops *get_flow_backend_ops(void) +{ + return flow_backend_ops; +} + static const struct flow_filter_ops *flow_filter_ops; +void register_flow_filter_ops(const struct flow_filter_ops *ops) +{ + flow_filter_ops = ops; +} + const struct flow_filter_ops *get_flow_filter_ops(void) { + if (flow_filter_ops == NULL) + init_flow_filter(); + return flow_filter_ops; } diff --git a/drivers/net/ntnic/ntnic_mod_reg.h b/drivers/net/ntnic/ntnic_mod_reg.h index fd9e595f50..3251f651be 100644 --- a/drivers/net/ntnic/ntnic_mod_reg.h +++ b/drivers/net/ntnic/ntnic_mod_reg.h @@ -118,12 +118,21 @@ void register_rst9563_ops(struct rst9563_ops *ops); struct rst9563_ops *get_rst9563_ops(void); void rst9563_ops_init(void); +struct flow_backend_ops { + const struct flow_api_backend_ops *(*bin_flow_backend_init)(nthw_fpga_t *p_fpga, + void **be_dev); +}; + +const struct flow_backend_ops *get_flow_backend_ops(void); + struct flow_filter_ops { int (*flow_filter_init)(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_device, int adapter_no); int (*flow_filter_done)(struct flow_nic_dev *dev); }; +void register_flow_filter_ops(const struct flow_filter_ops *ops); const struct flow_filter_ops *get_flow_filter_ops(void); +void init_flow_filter(void); #endif /* __NTNIC_MOD_REG_H__ */ -- 2.45.0