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 522EF45614; Fri, 12 Jul 2024 17:49:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E155043009; Fri, 12 Jul 2024 17:48:04 +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 CDBEE42FCB for ; Fri, 12 Jul 2024 17:47:59 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2105.outbound.protection.outlook.com [104.47.17.105]) by mx-outbound23-2.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 12 Jul 2024 15:47:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pENgIKPoMjoZBhWEvRt8YO7y7Jg0E2PnpVG1t1MVnGi7T4Ced/5Nt30eQDvvE949vmpf7GpjNGOkyXXUKL/zam0xJMJpTWTZSQnJYONf9Yr1MAfwi74/HQGMs/CNvAgt8LS5zcQIaPAJjVYj07VBbeFxva2LPCEq/QIHb+6ML9woyp1Pe6WbPgkVsCgt8XjT901/ucXhy84ZN+Px1DzwCVvwEbNtKmpsl6ZJQCErbL6mIssMQ6Hvx8nGwJLDgGtNnkRpTQ0N+4c4+DvHhEQvisy7HUWalbIFC6rZfFGdFv37lPltCvLg+eu8pDSdw9K1k05pKvWuT/o/fqB84rNVpw== 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=BjN2UffLCfDPcjEpkF6Cpvy7TbA/ULUvy8uztioyL74=; b=XFqDKTjL5qWQZculYhPICIrAMpP+HPA3rk7bEk7KGYOinJR3JJu+mc3QTgT/SJT6egDJGsjtAmbqw+Lp9wBF5C5CLdoxD9m2eLNWq3jkGbX/6Wnlsm1hnhntHvhEbLHEfA7uj1B89zOFY5DBScTiqAT5Yzjtcf219SLtjh9eG3K0h9F+jMZncyAB/NKKORCzdCJyLbXuTHutnQIaS6v6DsA47ZlaIiQ2/3W+g0y24earkOb8X/LQPiE0HNVbt/FQz2AXQD7KygBtkJAxedI31CMIyn1XBY4lIdsl99xllFvCGwM32sMFND/5O0QouI48LfjTyCe9a64a2+Ts4W9m6A== 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=BjN2UffLCfDPcjEpkF6Cpvy7TbA/ULUvy8uztioyL74=; b=RjKVANxTbwWHesmzWxYhDKedY2RR54GoV825jVCTEUvGeQvWV0UeosUyZGQ+SP6SI9c/jFQmA3mffu8HvtRaDaCVLmhmX5EHImCCHLT4C73/Sqv0y/G55k3v0RTDmw3BxH+q975vI6jIbNtwMaU9gNG42YnSeDRZaltgsSSp3XM= Received: from DU7PR01CA0021.eurprd01.prod.exchangelabs.com (2603:10a6:10:50f::9) by VE1P190MB0848.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:1a4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23; Fri, 12 Jul 2024 15:47:56 +0000 Received: from DU2PEPF00028D0C.eurprd03.prod.outlook.com (2603:10a6:10:50f:cafe::29) by DU7PR01CA0021.outlook.office365.com (2603:10a6:10:50f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23 via Frontend Transport; Fri, 12 Jul 2024 15:47:55 +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 DU2PEPF00028D0C.mail.protection.outlook.com (10.167.242.20) with Microsoft SMTP Server id 15.20.7762.17 via Frontend Transport; Fri, 12 Jul 2024 15:47:55 +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 Subject: [PATCH v8 12/21] net/ntnic: add support of the NT200A0X smartNIC Date: Fri, 12 Jul 2024 17:47:22 +0200 Message-ID: <20240712154737.1339646-12-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240712154737.1339646-1-sil-plv@napatech.com> References: <20240530144929.4127931-1-sil-plv@napatech.com> <20240712154737.1339646-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PEPF00028D0C:EE_|VE1P190MB0848:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 15be7bc4-537f-4c74-250c-08dca289ff6c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?X+29TllPRQxhC43MIvvcNOCRHhE7tlLzH3yqaer4vBLJOw8M+UUcPz9nk3np?= =?us-ascii?Q?f9MzOfs1DwAoXB3N/alE58a8Rl4Pd5jgwn6GOkGrYeS75BLBc6jtS+Y4vJVQ?= =?us-ascii?Q?iOK0v1XmUYmySiTehBionYtfoPgmOq0GsPlKAzHIWitfQTtL7tv6caNQbNrp?= =?us-ascii?Q?x7GAP/j1Sm5DKWfoijbvkz/YK9i2yTn8vVJ9m64RcUsQsuEK44ZNfYvfZ9a9?= =?us-ascii?Q?YG8yLYGAGQUakv+ZYFX3IT0BBX6a5qf23BEURa2D3kOzbHadYMLGT/A2PO+U?= =?us-ascii?Q?VFB76cFhcv1GyfsV2BzlDmTW2yWWuwpUbLaEGcGJ9Qc5+9s5nn5Xh5CRoApY?= =?us-ascii?Q?phuf1okR+5QL37IZPc74i20eKel8MkSuOOwKALGT9uXc3F/ZT14QDZfsTtQ5?= =?us-ascii?Q?7V7X70Rhpzm5YA3feoU1uM+htgjgZsMdb8q9WJQN9DzoPyJzdPivCOq2NdjD?= =?us-ascii?Q?p8JxmMri3aLVIZNxICN2Ncrfnfi3IjY66u6xp20Ajvo/aEDuVHyYQ2fdSckV?= =?us-ascii?Q?VGqWNfhlUX51hK7F+e18bXX2xg4dEYwC4UNV26IGkHUniFuS2svx9QTgwxoX?= =?us-ascii?Q?Wy0orB9EV4EqLFVuY306ABdjGIdzAYvZQ3Kbyb+NfblFlFPPqVaqZADwoKEK?= =?us-ascii?Q?5gMQuE73xiEtLz+yRTaZX0UmeV5jrcTNKJHTIKtqw1p7lGh9JfZl4Lqv/Fba?= =?us-ascii?Q?m96YcqJNNVZlsR5mA4K9l2QRhhhPIelqKzeNw6Z7LVIo9HMIFWVYw+RcT2rv?= =?us-ascii?Q?An3GzQa+949vMGicTRgTQ22kaX3HPCtP2A47oYm4m+HCL5AvlHALtZ8urKFF?= =?us-ascii?Q?c6CAwgLUFPedDTZFROsJM2dEZ71MR04BV/tQyATXIVXVJZqOAA2Tpafnt4At?= =?us-ascii?Q?+mfJow2KvAG8+Idvk5IAsILYbxOAP1DVs+nJuvpSvXoaI5CrxteXTUDGbna9?= =?us-ascii?Q?PuNAeKvvieFysDkpbdAkfeQO5mTnQvVIy5gNWGGbG7oRT8VesnFAVnHB5yMV?= =?us-ascii?Q?8Qw4PtQTIiCG3B5VlGzTKf8HqWRZK5HBAo6BLnUcHDHsoqyDvg+hMEGRpS6N?= =?us-ascii?Q?8s/o0ts4BrYX06nHGVdYzLoGeGyTOy3ELcoNsPUFyN1MeH4q68W6IokpgCGd?= =?us-ascii?Q?/3HhIg57bRS1OmOjAmrA6vmNVb/E3TThPc3g8y7FjLrSPjNsMiRwDHQglW4x?= =?us-ascii?Q?vGWf3c1cq7ZEwKT1QNJH2P2/hj0qJRmDD5rbEu8pNUKZ0QHFvWd9UwqgBe5J?= =?us-ascii?Q?Lp/vsbkkbM3wKUnjgtSOcK8kFiQ+RYSSExN1boqekD1YUiwUEZooY4Z9k1vN?= =?us-ascii?Q?ARKjTMcHoNMJmGwxf9UV1x3QzTE8po+9qXYnZEKasbSrQt7wnXqSOOIczkDI?= =?us-ascii?Q?/1SFMtjMj5awDLrSn6C7Jnb9Dj4KNmmWMpN04CLgv1cCiwhehi0SENLEDthX?= =?us-ascii?Q?xOwC/x3SWrCb48pIP632swKKGwagyLOG?= 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)(376014)(1800799024)(36860700013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: QDKlAGT8RBGbL5RIvsR2YHlpKwnc/t2THzMGcZ3eGQ6X59G/Fwj7aQbwJFoi5ofkC9FR/ZV1AQnmtDDMXDiotJMdg5zjNCtzaakbZOmK3dHC6McR/jOmXnHAZRud28LA7/Qwu4zz7Wp/NAeOvgHqEMM8ETC9o/wz7BnIf38rUp7l+EhWqdpwBdtuGahSdUHsvLs1TiNPJh4vSgCyygV3FUNU0vzZ9iy0OjGQB6O8b7h73rM5R44wch8WUCZCh1Vic1/KepYJuoiptx2UFlf/ZAu755SvmJJhAC+iGGlNfLiG1BMSDc7krcfk69iTAYnk7A+zkP+AtbV5G2WVDSKrO150jVXxndTLfZevCcEihxX3r6P+v9TSwckQHG0uClaortY5nFm3RyW4K+LMia8wwhL4jl8hNODzwEwIY9GX8sk5YBK57Zzo3yPVUse1eL6WcVU30aMg1VrfpEMj2zgxAeqGL/smU/mnRO7dhv7MwBHdJp7+2aP+50+ZJCS2Vw9en7y+4JKoK23tOTS1SfJOhqnA4JlUH07ntFJEvskKtOsnNlFSFfdrYADj7AYnvr1kgM3XdFeakpCse3Timnvosn8WCbo8WqNyvfE35HV2xav/tcIuKlERyNcz1R/wD65uoFOnnL3hDDuqEgPh8jL6FA== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 15:47:55.6452 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15be7bc4-537f-4c74-250c-08dca289ff6c 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: DU2PEPF00028D0C.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1P190MB0848 X-BESS-ID: 1720799278-305890-12640-32729-1 X-BESS-VER: 2019.1_20240702.1505 X-BESS-Apparent-Source-IP: 104.47.17.105 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVuZGFhZAVgZQ0DTN0DQx1SA1Od XM0tTcItUiOTnFyCDFPDHF0NzcPNFUqTYWAE7/9E1BAAAA X-BESS-Outbound-Spam-Score: 0.70 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.257575 [from cloudscan15-209.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 0.20 PR0N_SUBJECT META: Subject has letters around special characters (pr0n) X-BESS-Outbound-Spam-Status: SCORE=0.70 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_RULE7568M, BSF_BESS_OUTBOUND, PR0N_SUBJECT 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 Add ntnic support for NT200A0X NIC Signed-off-by: Serhii Iliushyk --- drivers/net/ntnic/adapter/nt4ga_adapter.c | 6 +++ drivers/net/ntnic/meson.build | 1 + .../net/ntnic/nthw/core/include/nthw_fpga.h | 7 +++ .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 54 +++++++++++++++++++ drivers/net/ntnic/nthw/core/nthw_fpga.c | 31 +++++++++++ drivers/net/ntnic/nthw/nthw_platform.c | 3 ++ drivers/net/ntnic/nthw/nthw_platform_drv.h | 2 + drivers/net/ntnic/ntnic_ethdev.c | 3 ++ 8 files changed, 107 insertions(+) create mode 100644 drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c diff --git a/drivers/net/ntnic/adapter/nt4ga_adapter.c b/drivers/net/ntnic/adapter/nt4ga_adapter.c index 3b113b9850..bdad2b1e21 100644 --- a/drivers/net/ntnic/adapter/nt4ga_adapter.c +++ b/drivers/net/ntnic/adapter/nt4ga_adapter.c @@ -127,6 +127,12 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) assert(fpga_info->n_fpga_prod_id > 0); switch (fpga_info->n_fpga_prod_id) { + /* NT200A01: 2x100G (Xilinx) */ + case 9563: /* NT200A02 (Cap) */ + NT_LOG(ERR, NTNIC, "NT200A02 100G link module uninitialized\n"); + res = -1; + break; + default: NT_LOG(ERR, NTNIC, "Unsupported FPGA product: %04d\n", fpga_info->n_fpga_prod_id); diff --git a/drivers/net/ntnic/meson.build b/drivers/net/ntnic/meson.build index 78f31097ab..e375c63bf8 100644 --- a/drivers/net/ntnic/meson.build +++ b/drivers/net/ntnic/meson.build @@ -25,6 +25,7 @@ sources = files( 'nthw/supported/nthw_fpga_9563_055_039_0000.c', 'nthw/supported/nthw_fpga_instances.c', 'nthw/supported/nthw_fpga_mod_str_map.c', + 'nthw/core/nt200a0x/nthw_fpga_nt200a0x.c', 'nthw/core/nthw_fpga.c', 'nthw/core/nthw_hif.c', 'nthw/core/nthw_iic.c', diff --git a/drivers/net/ntnic/nthw/core/include/nthw_fpga.h b/drivers/net/ntnic/nthw/core/include/nthw_fpga.h index 1943f6e225..ba86b4d8d2 100644 --- a/drivers/net/ntnic/nthw/core/include/nthw_fpga.h +++ b/drivers/net/ntnic/nthw/core/include/nthw_fpga.h @@ -18,5 +18,12 @@ int nthw_fpga_shutdown(struct fpga_info_s *p_fpga_info); int nthw_fpga_get_param_info(struct fpga_info_s *p_fpga_info, nthw_fpga_t *p_fpga); +struct nt200a0x_ops { + int (*nthw_fpga_nt200a0x_init)(struct fpga_info_s *p_fpga_info); +}; + +void register_nt200a0x_ops(struct nt200a0x_ops *ops); +struct nt200a0x_ops *get_nt200a0x_ops(void); +void nt200a0x_ops_init(void); #endif /* __NTHW_FPGA_H__ */ diff --git a/drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c b/drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c new file mode 100644 index 0000000000..7db6a03d88 --- /dev/null +++ b/drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c @@ -0,0 +1,54 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#include "ntlog.h" + +#include "nthw_fpga.h" +#include "ntnic_mod_reg.h" + +static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info) +{ + assert(p_fpga_info); + + const char *const p_adapter_id_str = p_fpga_info->mp_adapter_id_str; + int res = -1; + + bool included = true; + + /* reset specific */ + switch (p_fpga_info->n_fpga_prod_id) { + case 9563: + included = false; + break; + + default: + NT_LOG(ERR, NTHW, "%s: Unsupported FPGA product: %04d\n", p_adapter_id_str, + p_fpga_info->n_fpga_prod_id); + res = -1; + break; + } + + if (!included) { + NT_LOG(ERR, NTHW, "%s: NOT INCLUDED FPGA product: %04d\n", p_adapter_id_str, + p_fpga_info->n_fpga_prod_id); + res = -1; + } + + if (res) { + NT_LOG_DBGX(ERR, NTHW, "%s: FPGA=%04d res=%d\n", p_adapter_id_str, + p_fpga_info->n_fpga_prod_id, res); + return res; + } + + return res; +} + +static struct nt200a0x_ops nt200a0x_ops = { .nthw_fpga_nt200a0x_init = nthw_fpga_nt200a0x_init }; + +void nt200a0x_ops_init(void) +{ + NT_LOG(INF, NTHW, "NT200A0X OPS INIT\n"); + register_nt200a0x_ops(&nt200a0x_ops); +} diff --git a/drivers/net/ntnic/nthw/core/nthw_fpga.c b/drivers/net/ntnic/nthw/core/nthw_fpga.c index df238ec4ef..98d29744cb 100644 --- a/drivers/net/ntnic/nthw/core/nthw_fpga.c +++ b/drivers/net/ntnic/nthw/core/nthw_fpga.c @@ -152,7 +152,18 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) nthw_rac_rab_flush(p_nthw_rac); p_fpga_info->mp_nthw_rac = p_nthw_rac; + bool included = true; + struct nt200a0x_ops *nt200a0x_ops = get_nt200a0x_ops(); + switch (p_fpga_info->n_nthw_adapter_id) { + case NT_HW_ADAPTER_ID_NT200A02: + if (nt200a0x_ops != NULL) + res = nt200a0x_ops->nthw_fpga_nt200a0x_init(p_fpga_info); + + else + included = false; + + break; default: NT_LOG(ERR, NTHW, "%s: Unsupported HW product id: %d\n", p_adapter_id_str, p_fpga_info->n_nthw_adapter_id); @@ -160,6 +171,12 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) break; } + if (!included) { + NT_LOG(ERR, NTHW, "%s: NOT INCLUDED HW product: %d\n", p_adapter_id_str, + p_fpga_info->n_nthw_adapter_id); + res = -1; + } + if (res) { NT_LOG(ERR, NTHW, "%s: status: 0x%08X\n", p_adapter_id_str, res); return res; @@ -220,3 +237,17 @@ int nthw_fpga_shutdown(struct fpga_info_s *p_fpga_info) return res; } + +static struct nt200a0x_ops *nt200a0x_ops; + +void register_nt200a0x_ops(struct nt200a0x_ops *ops) +{ + nt200a0x_ops = ops; +} + +struct nt200a0x_ops *get_nt200a0x_ops(void) +{ + if (nt200a0x_ops == NULL) + nt200a0x_ops_init(); + return nt200a0x_ops; +} diff --git a/drivers/net/ntnic/nthw/nthw_platform.c b/drivers/net/ntnic/nthw/nthw_platform.c index 181330dd37..33e18e549f 100644 --- a/drivers/net/ntnic/nthw/nthw_platform.c +++ b/drivers/net/ntnic/nthw/nthw_platform.c @@ -8,6 +8,9 @@ nthw_adapter_id_t nthw_platform_get_nthw_adapter_id(const uint16_t n_pci_device_id) { switch (n_pci_device_id) { + case NT_HW_PCI_DEVICE_ID_NT200A02: + return NT_HW_ADAPTER_ID_NT200A02; + default: return NT_HW_ADAPTER_ID_UNKNOWN; } diff --git a/drivers/net/ntnic/nthw/nthw_platform_drv.h b/drivers/net/ntnic/nthw/nthw_platform_drv.h index ab26d8149a..42eb0b8b05 100644 --- a/drivers/net/ntnic/nthw/nthw_platform_drv.h +++ b/drivers/net/ntnic/nthw/nthw_platform_drv.h @@ -9,9 +9,11 @@ #include #define NT_HW_PCI_VENDOR_ID (0x18f4) +#define NT_HW_PCI_DEVICE_ID_NT200A02 (0x1C5) enum nthw_adapter_id_e { NT_HW_ADAPTER_ID_UNKNOWN = 0, + NT_HW_ADAPTER_ID_NT200A02, }; typedef enum nthw_adapter_id_e nthw_adapter_id_t; diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c index 10b3c803ae..488c88c782 100644 --- a/drivers/net/ntnic/ntnic_ethdev.c +++ b/drivers/net/ntnic/ntnic_ethdev.c @@ -26,6 +26,7 @@ #define EXCEPTION_PATH_HID 0 static const struct rte_pci_id nthw_pci_id_map[] = { + { RTE_PCI_DEVICE(NT_HW_PCI_VENDOR_ID, NT_HW_PCI_DEVICE_ID_NT200A02) }, { .vendor_id = 0, }, /* sentinel */ @@ -486,9 +487,11 @@ nthw_pci_remove(struct rte_pci_device *pci_dev) static struct rte_pci_driver rte_nthw_pmd = { .id_table = nthw_pci_id_map, + .drv_flags = RTE_PCI_DRV_NEED_MAPPING, .probe = nthw_pci_probe, .remove = nthw_pci_remove, }; RTE_PMD_REGISTER_PCI(net_ntnic, rte_nthw_pmd); +RTE_PMD_REGISTER_PCI_TABLE(net_ntnic, nthw_pci_id_map); RTE_PMD_REGISTER_KMOD_DEP(net_ntnic, "* vfio-pci"); -- 2.45.0