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 7DF1E45B04; Thu, 10 Oct 2024 16:17:33 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB76140E21; Thu, 10 Oct 2024 16:15:06 +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 4332C40B9D for ; Thu, 10 Oct 2024 16:14:52 +0200 (CEST) Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02lp2046.outbound.protection.outlook.com [104.47.11.46]) 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:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dHtYB3ouLAlQ0YzhAFk3JMtM6RRvP03YCS8gNAPEqWRL1sUtpepfxYdJuhaZZ/PZ7+clK/KsP1ij2JdVKFogIf0jRdZw7JteccSVje/4KxeaV9gqG25atJH1JoudlL5kzoVOU5wJd3IdqfBAcuibHw/SpNc/omFfBGk5ADHH7xRVKjxdIcH2KpC85M/Tf/qDrlb3Chs3C3wt9aIBO6XabrvLp54sYbwkskVRUDkYlTQtIvHFQjs7qSqBznqCJKpfFzVukmbXFphmwZ5qc74Uz+ipOwRba5pievZNWCVqj4SqEY/DV9Cxmusnfd+eILolqDpeImPfPAkjpiIQyX4PlQ== 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=a0GZMKTD4ClGbBK/89yEsHdsBw8uFM6qHynsg0seOCA=; b=kP66TtrFj13y+5ivvTHSXuYtFwBKkRIfoQFL71dyAgHzOCp11CjY+QZ70B96UVLQ7dgmZZR9uvrHoJAZl4WQouCHnwXOVCVABnBcPuLZL25puVdg0uzJSd67ZyAnZGIPFl5iOQgXuz2/rjd+nQbcsUynpZONmgEU6Apqwcjad8mZYBzxjW7rnZc+nqPsKUEeYSM8/74lgIK5CvPGpl17EBTO05vso/gsoSR/biKtD6DZh8Dot9IS9v6BAbBxmmcLYlYmT50RrWCVNzTYZN+PkQ66gNGeT17pSnEclbbQ04I17AVZS8xhiGdvtORnuOa6y1giqZoAUXm42ECbC7mTVQ== 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=a0GZMKTD4ClGbBK/89yEsHdsBw8uFM6qHynsg0seOCA=; b=I98huyE5PpoXRTse8y1yi3yZSTCEyL+VbSeShOP6mVA0gh5z7OphqXhRcdj8vj4+OOgZRdrikpX0hkz+wB5EEJmMULtd4WL5I0v3adgjJB4EKiSv6LEh0DmDLKogMZbjg6+xmA3+omz5FiPOFdvzBnY2YG67sLuAA1GMXUfODOQ= Received: from DU2PR04CA0085.eurprd04.prod.outlook.com (2603:10a6:10:232::30) by AS8P190MB1206.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:2e1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Thu, 10 Oct 2024 14:14:47 +0000 Received: from DU6PEPF0000B61B.eurprd02.prod.outlook.com (2603:10a6:10:232:cafe::90) by DU2PR04CA0085.outlook.office365.com (2603:10a6:10:232::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.17 via Frontend Transport; Thu, 10 Oct 2024 14:14:47 +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:46 +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 24/50] net/ntnic: add replacer (Tx RPL) flow module Date: Thu, 10 Oct 2024 16:13:39 +0200 Message-ID: <20241010141416.4063591-25-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_|AS8P190MB1206:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 2895720c-e25d-4401-6301-08dce935e56c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?b5NrWuMgKS397a/izdWg1sFGSA7ckAA5w9SDusOygZjz4mpxWBG9zaDMvkOD?= =?us-ascii?Q?Wvp7boK513I4OvQv31HxTOONrYkIKIV98Zc6FpH3FYc3lMLcBc9XQ4ZPlMYM?= =?us-ascii?Q?k9NK6uAOL7PgZmEwnbNBNYAYgAdqUF44E0opuYQcPZCl20qFf4BUtBWe5e5s?= =?us-ascii?Q?2EInRK7zguJGsMHqjQm5K7QT/WO3N7PNgRJw8ExGJxE6fp8CjBIVbmH4jYhh?= =?us-ascii?Q?ZiAxDheBE7PYtPwAKrGxpKUozIXG5boEToAUUAxbRlre22IUQEH8rEkohaBq?= =?us-ascii?Q?0lJp/KynTP6Zx9u+Bd81B0lBmf9ut3w2atoDvCKLvtNMe5ZamcPcHIxt4tCH?= =?us-ascii?Q?0ie+qDMO39VUatOdX+OpA5GgWV55ZK/fgpN56jvpwHrv8mImMbz9K3BIfztQ?= =?us-ascii?Q?q41753a4rWV7bEaWEwMQ301PAhLDor6lBwTsyquqfDL0bwOYYxOZeJh4Ieo3?= =?us-ascii?Q?M9NJSypxiamHyI1T0LCcdoMGQkVja0z6htBFFCaR2nJXMtWuoPk+SVWABI10?= =?us-ascii?Q?B+cPP8cN+4NF+l9X8YNU+tbV7Z15Ooc3VauVnBEuiuXz53O1wvGjo0v22p+f?= =?us-ascii?Q?9b+EANCwBWjj4ZD+GEqWl2PiOf6goLo36D58LmGpsiTTtru8hSTKF2hXAKPj?= =?us-ascii?Q?iExIgLtxUjrAxAMTY1z1LlrqB84R/4qyF9zr9Y3aQy754DPyj11FAXFN02qf?= =?us-ascii?Q?FaGZ39JSEmtQ3g6bGxTadoI1XE50TAYkgbp6vAFaz9JPe5tyrfBa/UoDyLJR?= =?us-ascii?Q?eE/X8zoNLVy9MeYtwBtdYPt4PS+9LIgFhxe1EnGeGrFmnDOh5/4ZJ0l0tCeM?= =?us-ascii?Q?YXydGoJE5gJP7WuIfI0InsqdkmNdjFeqZm21OyBRTn+HC1aikrMcqZW6oV++?= =?us-ascii?Q?r2saZSlFU1JGnuZWbiKmCC2HehoBp8BZDhBD6/KrGum6TJDZFvQ1f0jMvI2e?= =?us-ascii?Q?nOZCJSxOfq244UhaVTs6JsL9PEApWpA4j4HPnOHD0aN5yJSjp5PrzSB9yLil?= =?us-ascii?Q?aRG/ZMDg4iP8DqHQAXPpYQHd769EWQOH2e153uElZCmiebL4rmZaNvVSPUT0?= =?us-ascii?Q?a65YMWXiz8SCUoNUWyIc9JS1Ov2AUGrVdPGJUC7H45xMGU3DjOdZBUUIgO3k?= =?us-ascii?Q?ATtgJoCy01moipWFjRafla8gsAnkRobS3zRADFPFEyOWZD0/NnU6KHFwBLFc?= =?us-ascii?Q?aggmMdqA0tXctSpSsAWGzj9/gUiaI8PW42REkfhRSdSLAGbrnuJ/XYKSjUdF?= =?us-ascii?Q?z8u22IY7Et32/ZY1K0Fv83bvRStuocY/24WTOTLO1Hzron4uWc3iuIuVcGw+?= =?us-ascii?Q?OO0NYHhKAWiXWJZWuYYTXM+r5M8OUOZ+2MTqZFCKcronB3wEQECmau9gJhTo?= =?us-ascii?Q?OPWfXDQ=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)(36860700013)(1800799024)(376014)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: LMwOSaUo24PR0tSsG5pwCb+E4biXhtmf0ZybKGtN5PpaANPtpeQ+aJN3slixvGsRKdyN4mzpD+H5DxktenKUb/f3vWlG1iXM0wMCdheMk4ZASqWlbsoveGb/F7naSuBpsV08dzacUriUHCv1F6AganyVTHAPQkyRJ25a4AfR7BYZQTtA07Z+NbhI3rDIxrUVasMj9vtEl+2dEsOhWqtKYGXG8+fzmwWPigRchJvMzFRenSDMBeuQGXaUDHgcCWo9GMLZuOrETbHBtNgJ7MQrlfdtL3JyImdI3b0E2XUsmXxcHS52Xz6Cv67E5Tz93zxaEU5C/LG29MupTZ2kU+pwy54odgmloVqeGkH36zg8mbtW3yzIdnUtQL+umkg9vDulPbd3UqfxfNXVY2dAOClH0bEp+kqP6a7+pjikL1PU0KxP6/XZ7hs7r/hQI9/3DpahejRjmQ8LMWsxvtqTXt2CXzc0DLq13stjGyRIZyjaODh/FB5BGnaUKeE8haiaS6ePAsLeEOJOFLAKfzDWVHbRrZboS3HBbTSnZzytm9VGwgMUFqDxzWps++Kyxe18KLfZ6Q7Q0t+2HIou6wvZXYit4ker/TKWFEHE308Oj3iPWfvo/ipYiCqxZ3HGC2+63UiA1TKYYmVTblnIozJjaLLk2K+YBw2xzETsAtmMRgQ5Pas= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 14:14:46.8579 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2895720c-e25d-4401-6301-08dce935e56c 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: AS8P190MB1206 X-BESS-ID: 1728569689-303014-12782-25627-2 X-BESS-VER: 2019.1_20241004.2057 X-BESS-Apparent-Source-IP: 104.47.11.46 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVoaGppaWQGYGUDTFJNUizcw4OT HNyMIsyTLVNM3UwNQkMSnZKC3ZOM0sUak2FgD7PetaQgAAAA== X-BESS-Outbound-Spam-Score: 0.50 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259630 [from cloudscan10-73.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.50 BSF_RULE7568M META: Custom Rule 7568M 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.50 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_RULE7568M, 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 The TX Replacer module can replace a range of bytes in a packet. The replacing data is stored in a table in the module and will often contain tunnel data. Signed-off-by: Oleksandr Kolomeiets --- v3 * Remove newline characters from logs. --- drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 13 ++++ .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 78 +++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h | 52 +++++++++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 2 + .../nthw/supported/nthw_fpga_reg_defs_rpl.h | 43 ++++++++++ .../supported/nthw_fpga_reg_defs_tx_rpl.h | 23 ++++++ 8 files changed, 213 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpl.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_rpl.h diff --git a/drivers/net/ntnic/meson.build b/drivers/net/ntnic/meson.build index 7e0900f0eb..e236b82b36 100644 --- a/drivers/net/ntnic/meson.build +++ b/drivers/net/ntnic/meson.build @@ -60,6 +60,7 @@ sources = files( 'nthw/flow_filter/flow_nthw_slc_lr.c', 'nthw/flow_filter/flow_nthw_tx_cpy.c', 'nthw/flow_filter/flow_nthw_tx_ins.c', + 'nthw/flow_filter/flow_nthw_tx_rpl.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_backend/flow_backend.c b/drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c index ad62c4c156..b409824888 100644 --- a/drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +++ b/drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c @@ -19,6 +19,7 @@ #include "flow_nthw_rpp_lr.h" #include "flow_nthw_tx_cpy.h" #include "flow_nthw_tx_ins.h" +#include "flow_nthw_tx_rpl.h" #include "ntnic_mod_reg.h" #include "nthw_fpga_model.h" #include "hw_mod_backend.h" @@ -45,6 +46,7 @@ static struct backend_dev_s { struct rpp_lr_nthw *p_rpp_lr_nthw; /* TPE module */ struct tx_cpy_nthw *p_tx_cpy_nthw; /* TPE module */ struct tx_ins_nthw *p_tx_ins_nthw; /* TPE module */ + struct tx_rpl_nthw *p_tx_rpl_nthw; /* TPE module */ struct csu_nthw *p_csu_nthw; /* TPE module */ struct ifr_nthw *p_ifr_nthw; /* TPE module */ } be_devs[MAX_PHYS_ADAPTERS]; @@ -1843,6 +1845,16 @@ const struct flow_api_backend_ops *bin_flow_backend_init(nthw_fpga_t *p_fpga, vo be_devs[physical_adapter_no].p_tx_ins_nthw = NULL; } + /* Init nthw TX_RPL */ + if (tx_rpl_nthw_init(NULL, p_fpga, physical_adapter_no) == 0) { + struct tx_rpl_nthw *ptr = tx_rpl_nthw_new(); + tx_rpl_nthw_init(ptr, p_fpga, physical_adapter_no); + be_devs[physical_adapter_no].p_tx_rpl_nthw = ptr; + + } else { + be_devs[physical_adapter_no].p_tx_rpl_nthw = NULL; + } + be_devs[physical_adapter_no].adapter_no = physical_adapter_no; *dev = (void *)&be_devs[physical_adapter_no]; @@ -1865,6 +1877,7 @@ static void bin_flow_backend_done(void *dev) rpp_lr_nthw_delete(be_dev->p_rpp_lr_nthw); tx_cpy_nthw_delete(be_dev->p_tx_cpy_nthw); tx_ins_nthw_delete(be_dev->p_tx_ins_nthw); + tx_rpl_nthw_delete(be_dev->p_tx_rpl_nthw); } static const struct flow_backend_ops ops = { diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c new file mode 100644 index 0000000000..35790ef1b2 --- /dev/null +++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c @@ -0,0 +1,78 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#include +#include + +#include "ntlog.h" +#include "nthw_drv.h" +#include "nthw_register.h" + +#include "flow_nthw_tx_rpl.h" + +struct tx_rpl_nthw *tx_rpl_nthw_new(void) +{ + struct tx_rpl_nthw *p = malloc(sizeof(struct tx_rpl_nthw)); + + if (p) + (void)memset(p, 0, sizeof(*p)); + + return p; +} + +void tx_rpl_nthw_delete(struct tx_rpl_nthw *p) +{ + if (p) { + (void)memset(p, 0, sizeof(*p)); + free(p); + } +} + +int tx_rpl_nthw_init(struct tx_rpl_nthw *p, nthw_fpga_t *p_fpga, int n_instance) +{ + const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str; + nthw_module_t *p_mod = nthw_fpga_query_module(p_fpga, MOD_TX_RPL, n_instance); + + assert(n_instance >= 0 && n_instance < 256); + + if (p == NULL) + return p_mod == NULL ? -1 : 0; + + if (p_mod == NULL) { + NT_LOG(ERR, NTHW, "%s: TxRpl %d: no such instance", p_adapter_id_str, + n_instance); + return -1; + } + + p->mp_fpga = p_fpga; + p->m_physical_adapter_no = (uint8_t)n_instance; + p->m_tx_rpl = nthw_fpga_query_module(p_fpga, MOD_TX_RPL, n_instance); + + p->mp_rcp_ctrl = nthw_module_get_register(p->m_tx_rpl, RPL_RCP_CTRL); + p->mp_rcp_ctrl_addr = nthw_register_get_field(p->mp_rcp_ctrl, RPL_RCP_CTRL_ADR); + p->mp_rcp_ctrl_cnt = nthw_register_get_field(p->mp_rcp_ctrl, RPL_RCP_CTRL_CNT); + p->mp_rcp_data = nthw_module_get_register(p->m_tx_rpl, RPL_RCP_DATA); + p->mp_rcp_data_dyn = nthw_register_get_field(p->mp_rcp_data, RPL_RCP_DATA_DYN); + p->mp_rcp_data_ofs = nthw_register_get_field(p->mp_rcp_data, RPL_RCP_DATA_OFS); + p->mp_rcp_data_len = nthw_register_get_field(p->mp_rcp_data, RPL_RCP_DATA_LEN); + p->mp_rcp_data_rpl_ptr = nthw_register_get_field(p->mp_rcp_data, RPL_RCP_DATA_RPL_PTR); + p->mp_rcp_data_ext_prio = nthw_register_get_field(p->mp_rcp_data, RPL_RCP_DATA_EXT_PRIO); + p->mp_rcp_data_eth_type_wr = + nthw_register_query_field(p->mp_rcp_data, RPL_RCP_DATA_ETH_TYPE_WR); + + p->mp_ext_ctrl = nthw_module_get_register(p->m_tx_rpl, RPL_EXT_CTRL); + p->mp_ext_ctrl_addr = nthw_register_get_field(p->mp_ext_ctrl, RPL_EXT_CTRL_ADR); + p->mp_ext_ctrl_cnt = nthw_register_get_field(p->mp_ext_ctrl, RPL_EXT_CTRL_CNT); + p->mp_ext_data = nthw_module_get_register(p->m_tx_rpl, RPL_EXT_DATA); + p->mp_ext_data_rpl_ptr = nthw_register_get_field(p->mp_ext_data, RPL_EXT_DATA_RPL_PTR); + + p->mp_rpl_ctrl = nthw_module_get_register(p->m_tx_rpl, RPL_RPL_CTRL); + p->mp_rpl_ctrl_addr = nthw_register_get_field(p->mp_rpl_ctrl, RPL_RPL_CTRL_ADR); + p->mp_rpl_ctrl_cnt = nthw_register_get_field(p->mp_rpl_ctrl, RPL_RPL_CTRL_CNT); + p->mp_rpl_data = nthw_module_get_register(p->m_tx_rpl, RPL_RPL_DATA); + p->mp_rpl_data_value = nthw_register_get_field(p->mp_rpl_data, RPL_RPL_DATA_VALUE); + + return 0; +} diff --git a/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h new file mode 100644 index 0000000000..7425021692 --- /dev/null +++ b/drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h @@ -0,0 +1,52 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#ifndef __FLOW_NTHW_TX_RPL_H__ +#define __FLOW_NTHW_TX_RPL_H__ + +#include + +#include "nthw_fpga_model.h" + +struct tx_rpl_nthw { + uint8_t m_physical_adapter_no; + nthw_fpga_t *mp_fpga; + + nthw_module_t *m_tx_rpl; + + nthw_register_t *mp_rcp_ctrl; + nthw_field_t *mp_rcp_ctrl_addr; + nthw_field_t *mp_rcp_ctrl_cnt; + + nthw_register_t *mp_rcp_data; + nthw_field_t *mp_rcp_data_dyn; + nthw_field_t *mp_rcp_data_ofs; + nthw_field_t *mp_rcp_data_len; + nthw_field_t *mp_rcp_data_rpl_ptr; + nthw_field_t *mp_rcp_data_ext_prio; + nthw_field_t *mp_rcp_data_eth_type_wr; + + nthw_register_t *mp_ext_ctrl; + nthw_field_t *mp_ext_ctrl_addr; + nthw_field_t *mp_ext_ctrl_cnt; + + nthw_register_t *mp_ext_data; + nthw_field_t *mp_ext_data_rpl_ptr; + + nthw_register_t *mp_rpl_ctrl; + nthw_field_t *mp_rpl_ctrl_addr; + nthw_field_t *mp_rpl_ctrl_cnt; + + nthw_register_t *mp_rpl_data; + nthw_field_t *mp_rpl_data_value; +}; + +struct tx_rpl_nthw *tx_rpl_nthw_new(void); +void tx_rpl_nthw_delete(struct tx_rpl_nthw *p); +int tx_rpl_nthw_init(struct tx_rpl_nthw *p, nthw_fpga_t *p_fpga, int n_instance); + +int tx_rpl_nthw_setup(struct tx_rpl_nthw *p, int n_idx, int n_idx_cnt); + +#endif /* __FLOW_NTHW_TX_RPL_H__ */ diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h b/drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h index 0d5385a313..51b2d99c01 100644 --- a/drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h @@ -40,6 +40,7 @@ #define MOD_SLC_LR (0x969fc50bUL) #define MOD_TX_CPY (0x60acf217UL) #define MOD_TX_INS (0x59afa100UL) +#define MOD_TX_RPL (0x1095dfbbUL) #define MOD_IDX_COUNT (14) /* aliases - only aliases go below this point */ diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h index 605196e30e..8fa41eb7ea 100644 --- a/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h @@ -35,6 +35,7 @@ #include "nthw_fpga_reg_defs_pdb.h" #include "nthw_fpga_reg_defs_qsl.h" #include "nthw_fpga_reg_defs_rac.h" +#include "nthw_fpga_reg_defs_rpl.h" #include "nthw_fpga_reg_defs_rpp_lr.h" #include "nthw_fpga_reg_defs_rst9563.h" #include "nthw_fpga_reg_defs_sdc.h" @@ -42,6 +43,7 @@ #include "nthw_fpga_reg_defs_slc_lr.h" #include "nthw_fpga_reg_defs_tx_cpy.h" #include "nthw_fpga_reg_defs_tx_ins.h" +#include "nthw_fpga_reg_defs_tx_rpl.h" /* aliases */ diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpl.h b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpl.h new file mode 100644 index 0000000000..a163ffc45e --- /dev/null +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpl.h @@ -0,0 +1,43 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2024 Napatech A/S + */ + +/* + * nthw_fpga_reg_defs_rpl.h + * + * Auto-generated file - do *NOT* edit + * + */ + +#ifndef _NTHW_FPGA_REG_DEFS_RPL_ +#define _NTHW_FPGA_REG_DEFS_RPL_ + +/* RPL */ +#define NTHW_MOD_RPL (0x6de535c3UL) +#define RPL_EXT_CTRL (0x4c47804fUL) +#define RPL_EXT_CTRL_ADR (0xe391ddadUL) +#define RPL_EXT_CTRL_CNT (0xf399447cUL) +#define RPL_EXT_DATA (0xe3960256UL) +#define RPL_EXT_DATA_RPL_PTR (0xa8e4d0d9UL) +#define RPL_RCP_CTRL (0xc471325fUL) +#define RPL_RCP_CTRL_ADR (0x1f2d3a2bUL) +#define RPL_RCP_CTRL_CNT (0xf25a3faUL) +#define RPL_RCP_DATA (0x6ba0b046UL) +#define RPL_RCP_DATA_DYN (0xe361554fUL) +#define RPL_RCP_DATA_ETH_TYPE_WR (0xfc7f05c1UL) +#define RPL_RCP_DATA_EXT_PRIO (0xcd2ae9d1UL) +#define RPL_RCP_DATA_LEN (0xb0559aaUL) +#define RPL_RCP_DATA_OFS (0x4168d8e9UL) +#define RPL_RCP_DATA_RPL_PTR (0x3000a098UL) +#define RPL_RPL_CTRL (0xe65376ecUL) +#define RPL_RPL_CTRL_ADR (0x15abf987UL) +#define RPL_RPL_CTRL_CNT (0x5a36056UL) +#define RPL_RPL_DATA (0x4982f4f5UL) +#define RPL_RPL_DATA_VALUE (0x60951eb4UL) + +#endif /* _NTHW_FPGA_REG_DEFS_RPL_ */ + +/* + * Auto-generated file - do *NOT* edit + */ diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_rpl.h b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_rpl.h new file mode 100644 index 0000000000..8c46079cd5 --- /dev/null +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_rpl.h @@ -0,0 +1,23 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2024 Napatech A/S + */ + +/* + * nthw_fpga_reg_defs_tx_rpl.h + * + * Auto-generated file - do *NOT* edit + * + */ + +#ifndef _NTHW_FPGA_REG_DEFS_TX_RPL_ +#define _NTHW_FPGA_REG_DEFS_TX_RPL_ + +/* TX_RPL */ +#define NTHW_MOD_TX_RPL (0x1095dfbbUL) + +#endif /* _NTHW_FPGA_REG_DEFS_TX_RPL_ */ + +/* + * Auto-generated file - do *NOT* edit + */ -- 2.45.0