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 CC24C45B04; Thu, 10 Oct 2024 16:19:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 07E2E40F1A; Thu, 10 Oct 2024 16:15:27 +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 9962640E1C for ; Thu, 10 Oct 2024 16:15:05 +0200 (CEST) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03lp2240.outbound.protection.outlook.com [104.47.51.240]) by mx-outbound20-48.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 10 Oct 2024 14:15:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RA20rs/Ht5s341XI5tejnioHJB6mwKrGfhplpn7+eEHfIVRF+s8JVwa95e7eEyFOOgFXFtqRnk/TuHrcd/0I4jxJOs8phYWSnePBPX227noV8ZIlwDhbLFkEoGtZR1gDQr2EjGZ4onOsQh9WfbNcbCKvfmBese/5rEbWaFW2AYhno6WALL4NEWIH6ypZd2mP1jpmJgyofePkPenOxUk+77ZBEausyMc88i+ds67pxdFUP7kNOiwZYMNoR0jPWmhsP7ufOp5MPIw5WTjQax3nc7Z+T/qTHU3hKJHxYfAP9wdAFrOoIYE6z0U3BnEqBGSOSbgfn/QkOgEp/mI6MT4tBQ== 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=hX9bOlbJOpzC+1G8nhDUU8/NNjgqoMmtk5+RHWjyXcc=; b=oEnyhXa4WRjSkdlXVkIB9/veNI6PIv4XHnagkmIzCfKDNt656tGLSYI86vBMjIzMscxGTPYsBCTgvW1U+tP50KVCPBOKiLjOvTf7BHzQrZMgxk0iCPQLu9C38rT1UWLeYwssJUBsby4mMnHo5ZH3qXhNmSOmusB2VJK6oAsb9825qKNIqtgAAbdOpq8g6HP155+TxEHgPNqRxbgjOK3utzez2Sbp8tdn0MhBW+v/+++yDr0YU59qDazS2I5CgTjcKwlybjwjFQ6yjYR9lJJQbhPeoM3lzxNadONiVIlP0xgUxt+uaH6xlZxyOV2mBDzgBn00hMhz9PRIuhg8GTPayg== 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=hX9bOlbJOpzC+1G8nhDUU8/NNjgqoMmtk5+RHWjyXcc=; b=j6O7Zndun/8EL1bGQKVWseurUPUqLWQnDVVC9TlWFVqiHy7bB32fkNb0y1mDFDgeXYFvQ+7UG+60V7pb//OhOl5pwXZDnSKKbIqiX8C4H5Ad8voMm40LZrgUjdjSMBoS743yw1hRuyhUujkShwHI4nIBgSgNoVXICh9SgonEU1U= Received: from DU2PR04CA0074.eurprd04.prod.outlook.com (2603:10a6:10:232::19) by VI1P190MB0590.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:123::10) 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:57 +0000 Received: from DU6PEPF0000B61B.eurprd02.prod.outlook.com (2603:10a6:10:232:cafe::a0) by DU2PR04CA0074.outlook.office365.com (2603:10a6:10:232::19) 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:57 +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:56 +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 34/50] net/ntnic: add packet descriptor builder (PDB) FPGA module Date: Thu, 10 Oct 2024 16:13:49 +0200 Message-ID: <20241010141416.4063591-35-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_|VI1P190MB0590:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 9c22b8b8-d56d-447e-d121-08dce935eb6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ymj8RIRlBqmOZ12xr7WqiesFoK/o5+G6PVjIY9tkhL0qfuPPE3jNquvQ/LVX?= =?us-ascii?Q?GrBi4dPsxwwaJ7iXxYpkVev7JmxKzgEmKrt7cguWfS7Ul4MWJzYiAOnChFe+?= =?us-ascii?Q?HXdc0AeRe/5ndrn8OqbV4NHRyqJNXg84nqDQ07xX/uLXlgAEB9+pKropS41g?= =?us-ascii?Q?e8ixaHH/Xj/UZkwvacvtiE6Q5ZPOeiPumqBbftdssfQRetUDhs5arlkUtjPE?= =?us-ascii?Q?nSi94a8DF58tzSpddPJBGpgvBmPzM+RPKUl8ljE2Gi4Mfe58UrmYiRxEqkYp?= =?us-ascii?Q?aF5a83/pbvLjV8XNTs11f79kLo6OHtIKc2OZoalwo0eKebRsfXB4pFPR5sMX?= =?us-ascii?Q?HzhmGzyvkccaHQPncLHQZlrXEnTmA23yeDy7a5fTV57WIc2PAqKD7izTWjW2?= =?us-ascii?Q?zDfr1Z5G14HifUKJQny1UnmNg3HskIpQZ4im0ge+9a9levi8Q4oOBxqz5uIW?= =?us-ascii?Q?pMGmJwUCFiOhojJXJpFnrCx/N4ruZvMlGs3s25QO0nxImP5mfEbBqpq8ZJI6?= =?us-ascii?Q?/QiKm/mp44mKjCs0yQBoKkrI2/b25XCVxES1tnlYyu+rQGjwf0YR309DlUQ/?= =?us-ascii?Q?iIk9IerF0fVVoczmBOQEwjFqjkspgxfA1Laf4VhB24qLZddEZb1Pw+nU60VT?= =?us-ascii?Q?8qUVU4fgUwXJA87izbPTaK4VNWXyGBLG1uakqPhi9vEb3Tw5+NjyLa3di9Jl?= =?us-ascii?Q?x7MnEAU8F3IOXz/blbVnpJWlAp50YKx74kQlO3ipUWIsz7HtVyTsOSJC5Baw?= =?us-ascii?Q?uT/eg3xJ1hzQVT1WYhAYZfaGSM229Q3P2RBS1iZXtRZ+3AmXNcrC7cweGZSb?= =?us-ascii?Q?pjTElTqm9zQlMx2HSBxDP1wrLmme6BkgEtpXENxbz7nb2MfDTd3/ilpLFtPa?= =?us-ascii?Q?eT6NrWX9MlIaEs/Y+MZmSbZsYFZ4wAV768BxaRaquPAlasCC9a1S259Br2O2?= =?us-ascii?Q?eACBgmrkYF5xN+LtnGTmmuR2LekUy8qvWWFeGPYkT6ugZ0rQO8zuSN5o8ofq?= =?us-ascii?Q?5h8rqw2xDW0+oUpiJSyPAN0ZVZh+R7asP2tHBqjUVinig+ViU7E+cZI2OPdv?= =?us-ascii?Q?IaEoV3+mr7vsAEQnEaX1MKMIsIlIoiX6OBnHC2PqB44uXH1LxsdyZ2Q8X4Kw?= =?us-ascii?Q?TYpvHjvZFcgROgCc82Ba5dJ+E9aDL7RYIKeG4ntMJzEp8sPh9HYuxaV4IKFi?= =?us-ascii?Q?X1zVneBSPd3m2G6wafekiQfa4md22hPDWYYRChO8sDjFXv0xWK5WJMipIM4q?= =?us-ascii?Q?oclT/MqtKfAWMc7uoR1CDwSdFBAR0d83ITnIctSdujFFSmVeMvpihjUFXU1i?= =?us-ascii?Q?QeR/7i/fsYUx85bA6cZf0BHxuUfQubgy67lDQTtERrATuidyRL4N1B16tKWd?= =?us-ascii?Q?dcGMxAPzPP4qJx35B1RMZZAvF7WZ?= 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)(376014)(82310400026)(36860700013)(1800799024); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 3LXyOzhLgOdXs2IkEm9FbzW4Yg1+TmLk6Rz1YCSm2QgLaVbqvY5n3G8zFBDy930eMccTzAf+Jym48rvbt+K1HU3ld/zXBBT1u8ihYvkhFEE6fddI9uofkcwYE/cDBhi6fJQECXuKF0PC4vyzeG67Qss/y7sgy0RAc4FygPYrtKuE0HOc0Qifv+XQbODbXDVBHA1LIk/v6fltQRAqv9dG/UVIxlb6EVde6vUKQh+RAw5ciCGsP8gwVxsSEuKsCgqCZzXLsDpaeJcFmCQuK1dx96mQ25cvCDbu9yBgVddBBocvreqBwFE7BXOcKwz9TniRtai2hjI9tJy75IM5J2UbURynQmH/HLWAgizsi1SiyZxo9v2g+8oL/y7y/T70a67MLlNxvnhvbmAGWuDhOQClrwYZ4eVGnPa5OJOD+ne553oTkSi6fVqT8cIgAO9M2MDg5qCeOnFllargSu8Tqj5nNGvWjsuYWAATYTELMiicEEZosmWazar6zXTvBDLJt1u7K09HTlm5eiaPH9nwIovqajoHJifRs17IYJNV3SjjXPe5q+A5kNvM6gHPQFwXp9yLnHAUEoKzD4K2alp30SPs9n/Bl26nfCZM9sjRrIq3Ez99LTpicKMdUUq2YWtvvWdz3BcMkJ188APhiLKy37DgIapavkYKCV8/7Z7HnEAVdPs= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2024 14:14:56.9361 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c22b8b8-d56d-447e-d121-08dce935eb6b 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: VI1P190MB0590 X-BESS-ID: 1728569703-305168-12628-25351-1 X-BESS-VER: 2019.1_20241004.2057 X-BESS-Apparent-Source-IP: 104.47.51.240 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVpbGhsZAVgZQ0NwyKdkoLSktxT zZPNXQ0sLAPNnSJMUkzdTAxDQl0dhEqTYWAMo2hB1BAAAA 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 The Packet Description Builder module creates packet meta-data for example virtio-net headers. 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 | 34 +++++++ 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_pdb.c | 91 +++++++++++++++++++ .../supported/nthw_fpga_9563_055_049_0000.c | 40 +++++++- 6 files changed, 169 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c diff --git a/drivers/net/ntnic/include/hw_mod_backend.h b/drivers/net/ntnic/include/hw_mod_backend.h index b26db9d939..b04ddbf638 100644 --- a/drivers/net/ntnic/include/hw_mod_backend.h +++ b/drivers/net/ntnic/include/hw_mod_backend.h @@ -612,6 +612,39 @@ struct pdb_func_s { struct hw_mod_pdb_v9_s v9; }; }; +enum hw_pdb_e { + /* functions */ + HW_PDB_RCP_PRESET_ALL = 0, + HW_PDB_RCP_COMPARE, + HW_PDB_RCP_FIND, + /* fields */ + HW_PDB_RCP_DESCRIPTOR = FIELD_START_INDEX, + HW_PDB_RCP_DESC_LEN, + HW_PDB_RCP_TX_PORT, + HW_PDB_RCP_TX_IGNORE, + HW_PDB_RCP_TX_NOW, + HW_PDB_RCP_CRC_OVERWRITE, + HW_PDB_RCP_ALIGN, + HW_PDB_RCP_OFS0_DYN, + HW_PDB_RCP_OFS0_REL, + HW_PDB_RCP_OFS1_DYN, + HW_PDB_RCP_OFS1_REL, + HW_PDB_RCP_OFS2_DYN, + HW_PDB_RCP_OFS2_REL, + HW_PDB_RCP_IP_PROT_TNL, + HW_PDB_RCP_PPC_HSH, + HW_PDB_RCP_DUPLICATE_EN, + HW_PDB_RCP_DUPLICATE_BIT, + HW_PDB_RCP_PCAP_KEEP_FCS, + HW_PDB_CONFIG_TS_FORMAT, + HW_PDB_CONFIG_PORT_OFS, +}; +bool hw_mod_pdb_present(struct flow_api_backend_s *be); +int hw_mod_pdb_alloc(struct flow_api_backend_s *be); +void hw_mod_pdb_free(struct flow_api_backend_s *be); +int hw_mod_pdb_reset(struct flow_api_backend_s *be); +int hw_mod_pdb_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count); +int hw_mod_pdb_config_flush(struct flow_api_backend_s *be); struct tpe_func_s { COMMON_FUNC_INFO_S; @@ -782,6 +815,7 @@ struct flow_api_backend_s { struct hsh_func_s hsh; struct qsl_func_s qsl; struct slc_lr_func_s slc_lr; + struct pdb_func_s pdb; /* NIC attributes */ unsigned int num_phy_ports; diff --git a/drivers/net/ntnic/meson.build b/drivers/net/ntnic/meson.build index 4caee8ac41..0415e5a5b2 100644 --- a/drivers/net/ntnic/meson.build +++ b/drivers/net/ntnic/meson.build @@ -53,6 +53,7 @@ sources = files( '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_api/hw_mod/hw_mod_pdb.c', 'nthw/flow_api/hw_mod/hw_mod_qsl.c', 'nthw/flow_api/hw_mod/hw_mod_slc_lr.c', 'nthw/flow_filter/flow_nthw_cat.c', diff --git a/drivers/net/ntnic/nthw/flow_api/flow_api.c b/drivers/net/ntnic/nthw/flow_api/flow_api.c index b58dbf1100..96496b2758 100644 --- a/drivers/net/ntnic/nthw/flow_api/flow_api.c +++ b/drivers/net/ntnic/nthw/flow_api/flow_api.c @@ -301,6 +301,9 @@ struct flow_nic_dev *flow_api_create(uint8_t adapter_no, const struct flow_api_b if (init_resource_elements(ndev, RES_HSH_RCP, ndev->be.hsh.nb_rcp)) goto err_exit; + if (init_resource_elements(ndev, RES_PDB_RCP, ndev->be.pdb.nb_pdb_rcp_categories)) + goto err_exit; + if (init_resource_elements(ndev, RES_QSL_RCP, ndev->be.qsl.nb_rcp_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 d4458980a4..0acc9612cd 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 @@ -26,6 +26,7 @@ static const struct { "SLC LR", hw_mod_slc_lr_alloc, hw_mod_slc_lr_free, hw_mod_slc_lr_reset, hw_mod_slc_lr_present }, + { "PDB", hw_mod_pdb_alloc, hw_mod_pdb_free, hw_mod_pdb_reset, hw_mod_pdb_present }, }; #define MOD_COUNT (ARRAY_SIZE(module)) diff --git a/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c new file mode 100644 index 0000000000..c3facacb08 --- /dev/null +++ b/drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.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_ "PDB" +#define _VER_ be->pdb.ver + +bool hw_mod_pdb_present(struct flow_api_backend_s *be) +{ + return be->iface->get_pdb_present(be->be_dev); +} + +int hw_mod_pdb_alloc(struct flow_api_backend_s *be) +{ + int nb; + _VER_ = be->iface->get_pdb_version(be->be_dev); + NT_LOG(DBG, FILTER, "PDB MODULE VERSION %i.%i", VER_MAJOR(_VER_), VER_MINOR(_VER_)); + + nb = be->iface->get_nb_pdb_categories(be->be_dev); + + if (nb <= 0) { + COUNT_ERROR_LOG(pdb_categories); + return COUNT_ERROR; + } + + be->pdb.nb_pdb_rcp_categories = (uint32_t)nb; + + switch (_VER_) { + case 9: + if (!callocate_mod((struct common_func_s *)&be->pdb, 2, &be->pdb.v9.rcp, + be->pdb.nb_pdb_rcp_categories, sizeof(struct pdb_v9_rcp_s), + &be->pdb.v9.config, 1, sizeof(struct pdb_v9_config_s))) + return -1; + + break; + + /* end case 9 */ + default: + UNSUP_VER_LOG; + return UNSUP_VER; + } + + return 0; +} + +void hw_mod_pdb_free(struct flow_api_backend_s *be) +{ + if (be->pdb.base) { + free(be->pdb.base); + be->pdb.base = NULL; + } +} + +int hw_mod_pdb_reset(struct flow_api_backend_s *be) +{ + int err = 0; + /* Zero entire cache area */ + zero_module_cache((struct common_func_s *)(&be->hsh)); + + NT_LOG(DBG, FILTER, "INIT PDB RCP"); + err |= hw_mod_pdb_rcp_flush(be, 0, ALL_ENTRIES); + + NT_LOG(DBG, FILTER, "INIT PDB CONFIG"); + err |= hw_mod_pdb_config_flush(be); + return err; +} + +int hw_mod_pdb_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count) +{ + if (count == ALL_ENTRIES) + count = be->pdb.nb_pdb_rcp_categories; + + if ((unsigned int)(start_idx + count) > be->pdb.nb_pdb_rcp_categories) { + INDEX_TOO_LARGE_LOG; + return INDEX_TOO_LARGE; + } + + return be->iface->pdb_rcp_flush(be->be_dev, &be->pdb, start_idx, count); +} + +int hw_mod_pdb_config_flush(struct flow_api_backend_s *be) +{ + return be->iface->pdb_config_flush(be->be_dev, &be->pdb); +} 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 7eeb210b80..9f821abf55 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 @@ -1297,6 +1297,43 @@ static nthw_fpga_register_init_s pci_wr_tg_registers[] = { { PCI_WR_TG_TG_WR_RUN, 4, 16, NTHW_FPGA_REG_TYPE_WO, 0, 1, pci_wr_tg_tg_wr_run_fields }, }; +static nthw_fpga_field_init_s pdb_config_fields[] = { + { PDB_CONFIG_PORT_OFS, 6, 3, 0 }, + { PDB_CONFIG_TS_FORMAT, 3, 0, 0 }, +}; + +static nthw_fpga_field_init_s pdb_rcp_ctrl_fields[] = { + { PDB_RCP_CTRL_ADR, 4, 0, 0x0000 }, + { PDB_RCP_CTRL_CNT, 16, 16, 0x0000 }, +}; + +static nthw_fpga_field_init_s pdb_rcp_data_fields[] = { + { PDB_RCP_DATA_ALIGN, 1, 17, 0x0000 }, + { PDB_RCP_DATA_CRC_OVERWRITE, 1, 16, 0x0000 }, + { PDB_RCP_DATA_DESCRIPTOR, 4, 0, 0x0000 }, + { PDB_RCP_DATA_DESC_LEN, 5, 4, 0 }, + { PDB_RCP_DATA_DUPLICATE_BIT, 5, 61, 0x0000 }, + { PDB_RCP_DATA_DUPLICATE_EN, 1, 60, 0x0000 }, + { PDB_RCP_DATA_IP_PROT_TNL, 1, 57, 0x0000 }, + { PDB_RCP_DATA_OFS0_DYN, 5, 18, 0x0000 }, + { PDB_RCP_DATA_OFS0_REL, 8, 23, 0x0000 }, + { PDB_RCP_DATA_OFS1_DYN, 5, 31, 0x0000 }, + { PDB_RCP_DATA_OFS1_REL, 8, 36, 0x0000 }, + { PDB_RCP_DATA_OFS2_DYN, 5, 44, 0x0000 }, + { PDB_RCP_DATA_OFS2_REL, 8, 49, 0x0000 }, + { PDB_RCP_DATA_PCAP_KEEP_FCS, 1, 66, 0x0000 }, + { PDB_RCP_DATA_PPC_HSH, 2, 58, 0x0000 }, + { PDB_RCP_DATA_TX_IGNORE, 1, 14, 0x0000 }, + { PDB_RCP_DATA_TX_NOW, 1, 15, 0x0000 }, + { PDB_RCP_DATA_TX_PORT, 5, 9, 0x0000 }, +}; + +static nthw_fpga_register_init_s pdb_registers[] = { + { PDB_CONFIG, 2, 10, NTHW_FPGA_REG_TYPE_WO, 0, 2, pdb_config_fields }, + { PDB_RCP_CTRL, 0, 32, NTHW_FPGA_REG_TYPE_WO, 0, 2, pdb_rcp_ctrl_fields }, + { PDB_RCP_DATA, 1, 67, NTHW_FPGA_REG_TYPE_WO, 0, 18, pdb_rcp_data_fields }, +}; + static nthw_fpga_field_init_s qsl_qen_ctrl_fields[] = { { QSL_QEN_CTRL_ADR, 5, 0, 0x0000 }, { QSL_QEN_CTRL_CNT, 16, 16, 0x0000 }, @@ -1510,6 +1547,7 @@ static nthw_fpga_module_init_s fpga_modules[] = { MOD_PCI_WR_TG, 0, MOD_PCI_WR_TG, 0, 1, NTHW_FPGA_BUS_TYPE_RAB0, 2304, 7, pci_wr_tg_registers }, + { MOD_PDB, 0, MOD_PDB, 0, 9, NTHW_FPGA_BUS_TYPE_RAB1, 2560, 3, pdb_registers }, { MOD_QSL, 0, MOD_QSL, 0, 7, NTHW_FPGA_BUS_TYPE_RAB1, 1792, 8, qsl_registers }, { MOD_RAC, 0, MOD_RAC, 3, 0, NTHW_FPGA_BUS_TYPE_PCI, 8192, 14, rac_registers }, { MOD_RST9563, 0, MOD_RST9563, 0, 5, NTHW_FPGA_BUS_TYPE_RAB0, 1024, 5, rst9563_registers }, @@ -1672,5 +1710,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, 19, fpga_modules, + 200, 9563, 55, 49, 0, 0, 1726740521, 152, product_parameters, 20, fpga_modules, }; -- 2.45.0