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 3F90B45B04; Thu, 10 Oct 2024 16:18:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5905740E39; Thu, 10 Oct 2024 16:15:14 +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 3472840DCA for ; Thu, 10 Oct 2024 16:14:57 +0200 (CEST) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03lp2235.outbound.protection.outlook.com [104.47.51.235]) by mx-outbound47-21.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Oct 2024 14:14:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BG/qd5X3cAVxwYKDpWs6TMJlX1uC5KQb5hk9JxbkxYw0oM7sMHDnz2hXIa/fiFmaN0weBt9G/YNcIvdISQcQPxCbwMU33XdRc/C3oRpbGyewCwBGcPC/d8l6reJD5mS0yxsN+lajGN52GPPK/Wx1e78JEGV5ILusLElkM2V/bxSVY99sIqfqx/o/wpafyBj7oldlFEKvY01woPN4KyDfvs8vS971y0f+OqCfaAXN7RuE8iytPzZQgUAIaExdFEGGh9JHYc9wHgrQt9OKrGloLYTENPO2M0+SuFI7pcZ9z5Z2TMx8Vs66JzHXrLmAbhinfkT3ihBBvKDXnmnPTy+uBA== 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=Qa14v8WF+2lnnG1KM/RWDdYHcseM5X0M45qjHkt69BA=; b=jUncW19DEM6MHEDuoUIEdEAftto5+mr3Sw5vFL7Tb3yyNq1coX2ZpNWLH3favogynkY6tpB0k9gs+OgOM8plxB1Ryhg3T6WtZButHSmu1i8+Ln6Y7tC7f3ebX55nFlRyNdXLWAl31hHebaXG5O28rQU2+ADwD3omAmlZBnP6RJPjy8/T5aokavyYeEzvOYc3DkDPul68Z38RhmRq1Kafcyzi9kXaKwCVPOA9yTB0vLl4Icyu8moZL9LO1lzy2OVCN3DYsdSJGpSsjsVUXyIWrD8brxH+uci64IDOHJ8LIfQ+L8+YPiPT9S41nycLtAIFYksoN4TfzdGtYtnnBj/OGg== 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=Qa14v8WF+2lnnG1KM/RWDdYHcseM5X0M45qjHkt69BA=; b=IK1A9kWFFrmypKKDkBYXIWx7944cct7hi8ff0Q9o8ieuD5D3Px5c6nmM1HwIPcXxeNZvjrhCTV8CjTTRQJ5TJoVH6/pmgrzc/HD0zgxLBc2znReQKiyjs8FKW+weKjyu6zgQftoOGNM7X8lShDPnaK0JPe1rcSQLQ3uE+US5ijI= Received: from DU2PR04CA0085.eurprd04.prod.outlook.com (2603:10a6:10:232::30) by AM0P190MB0708.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:198::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.22; Thu, 10 Oct 2024 14:14:53 +0000 Received: from DU6PEPF0000B61B.eurprd02.prod.outlook.com (2603:10a6:10:232:cafe::e7) 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:53 +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:53 +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 31/50] net/ntnic: add hasher (HSH) FPGA module Date: Thu, 10 Oct 2024 16:13:46 +0200 Message-ID: <20241010141416.4063591-32-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_|AM0P190MB0708:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 376777c5-6200-4c77-bfab-08dce935e974 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?SLy0xfdV+GKAl0MJ3ay96YBxzuUu0mAWrLoEWFj6coORvdRD4KNGKnd6G1Mv?= =?us-ascii?Q?pgyWrJUQGH08xeBB59w4hqDgPfZK3b6ujNo54I6sKTABBhha1BQ0gHg8o1Y8?= =?us-ascii?Q?wgU6ACJXbP4smxNBtfSqNehyN6fPfBZ2RNFEyqr1pCEMhG6nBMUxRr1qYGas?= =?us-ascii?Q?yYMr2E/Lq1VlhH8iu2eTYVQ+Io+2DEp82BBAHECBqOKlpWgiYlsBnteFssdK?= =?us-ascii?Q?MXDOhRKS8MK+O6xRgTyVxNxPGAqWSpOCKNd56fxq+/xmPJzP3Nb7aK4gARim?= =?us-ascii?Q?CWuoB1cwxPnE4i97NjngJGOWbkiMZY0KfFnrhHOk+AeaufewROrlxuHXxfc0?= =?us-ascii?Q?rlX5mRqAGHfaMalrIUS/uDGOjTx1KDdtL56U57GxG9hedsbKzKy+a3XmhDrG?= =?us-ascii?Q?4gSL/RxdsJs0YmBemjF9AoDx4HdnmPKfmmw7GPNKYu+HNksxqgARITMvqRoO?= =?us-ascii?Q?zuAFPhXlgP7mhv5eaSPBuICdZ1AHEHciP/J5DlwMnuNruFAMLtnlYSrGMsiW?= =?us-ascii?Q?eac/jbnnq7eGFNTpiJbH/rgm0ahGWYEz14jAE0NZ5v+GriXNjnazU4ALyY97?= =?us-ascii?Q?R0+Um+w5nfD7El/AhAUsI7OeuA+r9p2LnTyxA40LhWoZhl1BR/HxlGMo+wgu?= =?us-ascii?Q?vXmYsQz+JiUN1gTWBD/i26/n/5cqiP1r6TcV2jyIWsyS/rhbJmAqIjKyKujq?= =?us-ascii?Q?80hxmBm+8bkbs3JR7ZYfYUoe2gIuewXY4/GDe9fXgiIr+XQKD/ZqY0ZhV0+m?= =?us-ascii?Q?v4JT+9sBeOQZsbE1Q3PZ6HcjhjhskBSDv8vOzRmBew+TWT85qyq//Pxk3/AU?= =?us-ascii?Q?qNXa7+xaOrULofSASwFb8kC45+2+P+xV174xL554ZUb/8hee4UvS71bbWY7g?= =?us-ascii?Q?TmgWGCQ9ApyLn6fy95NqavazUMYJwNF1a5wjFJegqKmXcdN9vK3spq2yQsG7?= =?us-ascii?Q?knvmRQb5uyTzBXF9fOa8q0O1s3uVPXjtHvCzJBBQHhaH3DaojdEmZ/qM2NnS?= =?us-ascii?Q?viQhy/RCuJxA5iMPpPun/UWtu6P/eFzM/WLS88QfQ0L9du8akyJC7ETc6y7s?= =?us-ascii?Q?PSQ1tcdzPXoHftw/huKhxaEsNz1DrKVHgkZwWycDOhldmck/t0SgrCG6Fvqs?= =?us-ascii?Q?V8iXtNfRLJo3vBmuNeCghWpKuG8H4NZFuk2/KO4KdiTN93Ks7kVkMT4diQLE?= =?us-ascii?Q?uR51wUxs+ma6mOD7DnZDeBAuVW0YeFeEVMH59BHwg5aoEWUoXW7LxHhHBcDc?= =?us-ascii?Q?AFOOYgaRnbgqSybt+seUtMVZAulOXYlFrX28uTqx2PuzRrI1PZzs0QzLWDUb?= =?us-ascii?Q?Lxjth7kU6pFjx9zZCbSgyMzOMtKK6hcxI+J2F/bC88LE3cRhWB8jc5nBBK3s?= =?us-ascii?Q?Izo3fRStPp90h/zsSP3kXuXI2v4q?= 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: oZhfBrYWqNk4aePSyB+BqfBm5a+IZCT9lhhOC8UC01IgWf4I+Gx0xRPx6V/4PZhr66HqZss6l0ty+BH5oWErE1TJjmLhVsZzQ9gwc+wn65jv5j3H89rjWt2tYouLcFthYvv0PQeYUgQxsN817jbi3o2XtHhQV04HZZmNc3yh1Sadyw1Ae5ZsLG92Thz2CVUc8Nx6iLltLleqK+wE8yMmnn9VGPSR25iVIKeBNRS6hyE6nsBoQgf8TX/L9eSQO76o5/z0Zi1srYhZzQAjOQsoyiYtj8y34jvPZ83vRC1bKgFjJaRJ5xl4RJbQqe+CN197T+a1dX/J6/LI7KIMSijk7Bn1TJuZ8SCElnmor6/TOl9NOcZ/J0RQgnl7lqRBHqD2E2KWCkiuK0YwBJiElxXrz5+ddQyw/fwgvyB1fGF1cTMKNOsTgs8m9/glwTs7FsVmX2oVZZ6tpe167jnMCaUuMtka4SW4o4yAlkpaQg8nC4DLZ9ui3HU6I5QHSxlpyeMNwZVs5CDrBnLH7mtF9RYLLEnl359GdAR4Z3pAvZ2dzf2044zIXL4lfwJ2mD/bt9spERrTbvJPGuyZ7uEegeg408J4Mu9sroxw6hN3/P6QPbHMKjIFaUDcdSPyMJI0DL1lRn9FUqZza5/gCDOLTynK8K5Hx9kl60bLIty2H5GqUmM= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 14:14:53.5611 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 376777c5-6200-4c77-bfab-08dce935e974 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: AM0P190MB0708 X-BESS-ID: 1728569696-312053-12648-23470-1 X-BESS-VER: 2019.1_20241004.2057 X-BESS-Apparent-Source-IP: 104.47.51.235 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVpZGFpZAVgZQMC05zTQlLdHS0N LEzNI8ydAwxcLQIi3NIiUxzdTc0NRMqTYWAMae9axBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.259630 [from cloudscan21-174.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 The Hasher module calculates a configurable hash value to be used internally by the FPGA. The module support both Toeplitz and NT-hash. Signed-off-by: Oleksandr Kolomeiets --- v3 * Remove newline characters from logs. * Modify macros according to new logging and fix braces --- drivers/net/ntnic/include/hw_mod_backend.h | 36 ++++++++ drivers/net/ntnic/meson.build | 1 + drivers/net/ntnic/nthw/flow_api/flow_api.c | 3 + .../nthw/flow_api/hw_mod/hw_mod_backend.c | 1 + .../ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c | 91 +++++++++++++++++++ .../supported/nthw_fpga_9563_055_049_0000.c | 39 +++++++- 6 files changed, 170 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c diff --git a/drivers/net/ntnic/include/hw_mod_backend.h b/drivers/net/ntnic/include/hw_mod_backend.h index 78e6d39437..7b62141ffa 100644 --- a/drivers/net/ntnic/include/hw_mod_backend.h +++ b/drivers/net/ntnic/include/hw_mod_backend.h @@ -496,6 +496,41 @@ struct hsh_func_s { struct hw_mod_hsh_v5_s v5; }; }; +enum hw_hsh_e { + /* functions */ + HW_HSH_RCP_PRESET_ALL = 0, + HW_HSH_RCP_COMPARE, + HW_HSH_RCP_FIND, + /* fields */ + HW_HSH_RCP_LOAD_DIST_TYPE = FIELD_START_INDEX, + HW_HSH_RCP_MAC_PORT_MASK, + HW_HSH_RCP_SORT, + HW_HSH_RCP_QW0_PE, + HW_HSH_RCP_QW0_OFS, + HW_HSH_RCP_QW4_PE, + HW_HSH_RCP_QW4_OFS, + HW_HSH_RCP_W8_PE, + HW_HSH_RCP_W8_OFS, + HW_HSH_RCP_W8_SORT, + HW_HSH_RCP_W9_PE, + HW_HSH_RCP_W9_OFS, + HW_HSH_RCP_W9_SORT, + HW_HSH_RCP_W9_P, + HW_HSH_RCP_P_MASK, + HW_HSH_RCP_WORD_MASK, + HW_HSH_RCP_SEED, + HW_HSH_RCP_TNL_P, + HW_HSH_RCP_HSH_VALID, + HW_HSH_RCP_HSH_TYPE, + HW_HSH_RCP_TOEPLITZ, + HW_HSH_RCP_K, + HW_HSH_RCP_AUTO_IPV4_MASK +}; +bool hw_mod_hsh_present(struct flow_api_backend_s *be); +int hw_mod_hsh_alloc(struct flow_api_backend_s *be); +void hw_mod_hsh_free(struct flow_api_backend_s *be); +int hw_mod_hsh_reset(struct flow_api_backend_s *be); +int hw_mod_hsh_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count); struct qsl_func_s { COMMON_FUNC_INFO_S; @@ -688,6 +723,7 @@ struct flow_api_backend_s { struct cat_func_s cat; struct km_func_s km; struct flm_func_s flm; + struct hsh_func_s hsh; /* NIC attributes */ unsigned int num_phy_ports; diff --git a/drivers/net/ntnic/meson.build b/drivers/net/ntnic/meson.build index 9af7e3d813..18aafc57f0 100644 --- a/drivers/net/ntnic/meson.build +++ b/drivers/net/ntnic/meson.build @@ -51,6 +51,7 @@ sources = files( 'nthw/flow_api/hw_mod/hw_mod_backend.c', 'nthw/flow_api/hw_mod/hw_mod_cat.c', 'nthw/flow_api/hw_mod/hw_mod_flm.c', + 'nthw/flow_api/hw_mod/hw_mod_hsh.c', 'nthw/flow_api/hw_mod/hw_mod_km.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_csu.c', diff --git a/drivers/net/ntnic/nthw/flow_api/flow_api.c b/drivers/net/ntnic/nthw/flow_api/flow_api.c index 06451166c5..e78a1f7aed 100644 --- a/drivers/net/ntnic/nthw/flow_api/flow_api.c +++ b/drivers/net/ntnic/nthw/flow_api/flow_api.c @@ -290,6 +290,9 @@ struct flow_nic_dev *flow_api_create(uint8_t adapter_no, const struct flow_api_b if (init_resource_elements(ndev, RES_KM_CATEGORY, ndev->be.km.nb_categories)) goto err_exit; + if (init_resource_elements(ndev, RES_HSH_RCP, ndev->be.hsh.nb_rcp)) + goto err_exit; + if (init_resource_elements(ndev, RES_SLC_LR_RCP, ndev->be.max_categories)) goto err_exit; diff --git a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c index 3e0b83df8c..c8b4c316e5 100644 --- a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +++ b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c @@ -20,6 +20,7 @@ static const struct { { "CAT", hw_mod_cat_alloc, hw_mod_cat_free, hw_mod_cat_reset, hw_mod_cat_present }, { "KM", hw_mod_km_alloc, hw_mod_km_free, hw_mod_km_reset, hw_mod_km_present }, { "FLM", hw_mod_flm_alloc, hw_mod_flm_free, hw_mod_flm_reset, hw_mod_flm_present }, + { "HSH", hw_mod_hsh_alloc, hw_mod_hsh_free, hw_mod_hsh_reset, hw_mod_hsh_present }, }; #define MOD_COUNT (ARRAY_SIZE(module)) diff --git a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c new file mode 100644 index 0000000000..df5c00ac42 --- /dev/null +++ b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c @@ -0,0 +1,91 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#include +#include +#include + +#include "hw_mod_backend.h" + +#define _MOD_ "HSH" +#define _VER_ be->hsh.ver + +bool hw_mod_hsh_present(struct flow_api_backend_s *be) +{ + return be->iface->get_hsh_present(be->be_dev); +} + +int hw_mod_hsh_alloc(struct flow_api_backend_s *be) +{ + int nb; + _VER_ = be->iface->get_hsh_version(be->be_dev); + NT_LOG(DBG, FILTER, "HSH MODULE VERSION %i.%i", VER_MAJOR(_VER_), VER_MINOR(_VER_)); + + /* detect number of HSH categories supported by FPGA */ + nb = be->iface->get_nb_hsh_categories(be->be_dev); + + if (nb <= 0) { + COUNT_ERROR_LOG(hsh_categories); + return COUNT_ERROR; + } + + be->hsh.nb_rcp = (uint32_t)nb; + + /* detect if Toeplitz hashing function is supported by FPGA */ + nb = be->iface->get_nb_hsh_toeplitz(be->be_dev); + + if (nb < 0) { + COUNT_ERROR_LOG(hsh_toeplitz); + return COUNT_ERROR; + } + + be->hsh.toeplitz = (uint32_t)nb; + + switch (_VER_) { + case 5: + if (!callocate_mod((struct common_func_s *)&be->hsh, 1, &be->hsh.v5.rcp, + be->hsh.nb_rcp, sizeof(struct hsh_v5_rcp_s))) + return -1; + + break; + + /* end case 5 */ + default: + UNSUP_VER_LOG; + return UNSUP_VER; + } + + return 0; +} + +void hw_mod_hsh_free(struct flow_api_backend_s *be) +{ + if (be->hsh.base) { + free(be->hsh.base); + be->hsh.base = NULL; + } +} + +int hw_mod_hsh_reset(struct flow_api_backend_s *be) +{ + /* Zero entire cache area */ + zero_module_cache((struct common_func_s *)(&be->hsh)); + + NT_LOG(DBG, FILTER, "INIT HSH RCP"); + return hw_mod_hsh_rcp_flush(be, 0, be->hsh.nb_rcp); +} + +int hw_mod_hsh_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count) +{ + if (count == ALL_ENTRIES) + count = be->hsh.nb_rcp; + + if ((start_idx + count) > (int)be->hsh.nb_rcp) { + INDEX_TOO_LARGE_LOG; + return INDEX_TOO_LARGE; + } + + return be->iface->hsh_rcp_flush(be->be_dev, &be->hsh, start_idx, count); +} diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c b/drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c index a003334a23..4317da8094 100644 --- a/drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c @@ -544,6 +544,42 @@ static nthw_fpga_register_init_s hif_registers[] = { { HIF_UUID3, 176, 32, NTHW_FPGA_REG_TYPE_RO, 462142918, 1, hif_uuid3_fields }, }; +static nthw_fpga_field_init_s hsh_rcp_ctrl_fields[] = { + { HSH_RCP_CTRL_ADR, 4, 0, 0x0000 }, + { HSH_RCP_CTRL_CNT, 16, 16, 0x0000 }, +}; + +static nthw_fpga_field_init_s hsh_rcp_data_fields[] = { + { HSH_RCP_DATA_AUTO_IPV4_MASK, 1, 742, 0x0000 }, + { HSH_RCP_DATA_HSH_TYPE, 5, 416, 0x0000 }, + { HSH_RCP_DATA_HSH_VALID, 1, 415, 0x0000 }, + { HSH_RCP_DATA_K, 320, 422, 0x0000 }, + { HSH_RCP_DATA_LOAD_DIST_TYPE, 2, 0, 0x0000 }, + { HSH_RCP_DATA_MAC_PORT_MASK, 2, 2, 0x0000 }, + { HSH_RCP_DATA_P_MASK, 1, 61, 0x0000 }, + { HSH_RCP_DATA_QW0_OFS, 8, 11, 0x0000 }, + { HSH_RCP_DATA_QW0_PE, 5, 6, 0x0000 }, + { HSH_RCP_DATA_QW4_OFS, 8, 24, 0x0000 }, + { HSH_RCP_DATA_QW4_PE, 5, 19, 0x0000 }, + { HSH_RCP_DATA_SEED, 32, 382, 0x0000 }, + { HSH_RCP_DATA_SORT, 2, 4, 0x0000 }, + { HSH_RCP_DATA_TNL_P, 1, 414, 0x0000 }, + { HSH_RCP_DATA_TOEPLITZ, 1, 421, 0x0000 }, + { HSH_RCP_DATA_W8_OFS, 8, 37, 0x0000 }, + { HSH_RCP_DATA_W8_PE, 5, 32, 0x0000 }, + { HSH_RCP_DATA_W8_SORT, 1, 45, 0x0000 }, + { HSH_RCP_DATA_W9_OFS, 8, 51, 0x0000 }, + { HSH_RCP_DATA_W9_P, 1, 60, 0x0000 }, + { HSH_RCP_DATA_W9_PE, 5, 46, 0x0000 }, + { HSH_RCP_DATA_W9_SORT, 1, 59, 0x0000 }, + { HSH_RCP_DATA_WORD_MASK, 320, 62, 0x0000 }, +}; + +static nthw_fpga_register_init_s hsh_registers[] = { + { HSH_RCP_CTRL, 0, 32, NTHW_FPGA_REG_TYPE_WO, 0, 2, hsh_rcp_ctrl_fields }, + { HSH_RCP_DATA, 1, 743, NTHW_FPGA_REG_TYPE_WO, 0, 23, hsh_rcp_data_fields }, +}; + static nthw_fpga_field_init_s iic_adr_fields[] = { { IIC_ADR_SLV_ADR, 7, 1, 0 }, }; @@ -1398,6 +1434,7 @@ static nthw_fpga_module_init_s fpga_modules[] = { gpio_phy_registers }, { MOD_HIF, 0, MOD_HIF, 0, 0, NTHW_FPGA_BUS_TYPE_PCI, 0, 18, hif_registers }, + { MOD_HSH, 0, MOD_HSH, 0, 5, NTHW_FPGA_BUS_TYPE_RAB1, 1536, 2, hsh_registers }, { MOD_IIC, 0, MOD_IIC, 0, 1, NTHW_FPGA_BUS_TYPE_RAB0, 768, 22, iic_registers }, { MOD_IIC, 1, MOD_IIC, 0, 1, NTHW_FPGA_BUS_TYPE_RAB0, 896, 22, iic_registers }, { MOD_IIC, 2, MOD_IIC, 0, 1, NTHW_FPGA_BUS_TYPE_RAB0, 24832, 22, iic_registers }, @@ -1580,5 +1617,5 @@ static nthw_fpga_prod_param_s product_parameters[] = { }; nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000 = { - 200, 9563, 55, 49, 0, 0, 1726740521, 152, product_parameters, 17, fpga_modules, + 200, 9563, 55, 49, 0, 0, 1726740521, 152, product_parameters, 18, fpga_modules, }; -- 2.45.0