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 839C245501; Wed, 26 Jun 2024 21:57:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF7CE40A70; Wed, 26 Jun 2024 21:56:16 +0200 (CEST) Received: from egress-ip11a.ess.de.barracuda.com (egress-ip11a.ess.de.barracuda.com [18.184.203.234]) by mails.dpdk.org (Postfix) with ESMTP id 650224068A for ; Wed, 26 Jun 2024 21:56:10 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2111.outbound.protection.outlook.com [104.47.18.111]) by mx-outbound42-4.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 26 Jun 2024 19:56:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YElodDV1VBycHAsmNe0wCTiO1wSMJd9q/xVXz/8B7c/cL4hv62G94678pPV9MqHUIQLgZDXWixCmcVQDxlEQtdXzpWNLyC1nv7aU7wunwhnO+kWWgG8lgbyk8LvOTLg35ZGvriGavBBNBBX59YyFQB7NAf+ekwR3vU7/RfPiN+J0twWeMkd3majXVj6/J5n2NtZcjpxopqp6Id3XpbAyEVZbkh1kiKp/CWC4kzUkTWTX2uOHqVWty0IxoleMlSeyvbYFIqkORLaVLC/4DITulQQQCnHejzaIPymrgS8zgzEDOR1ZFOxC9Wgk4nmiW/3XMHMs6ox9r1vafivqqFBUlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=hsc7zC58Em8Y1WFpX4IwKXrXZNvWn1LkEce863wQbsw=; b=iuaNQuYq+xeK6aXCZDc3S1XFKd10u+Uz9kUJYgE3wf85ZNc3rPVOf3m47rhbTMesTYpIZTlJtldgxa3leo0qFOiwSAJ4mNN1kl+eczSyYYZiyjf+/Vn9suCqy6GKcRGlTMrS1NqgbTAggOg5tr9rmS/Hc9UtNhs9MbkXNBqq252/S5c2uK5hXKanUW1gXXeot4OFOvjQfLxIrna1TVWgQvLRZwksucPd6q7SGkUNBrXhH7cQpZuajAh8LRAT+4JJm1Mig4CdmlDdAZgjMJZWKmqtM/jbz/zVDzok9Qcl0bFOTy7brAY68AbOA1MfVnXHZZCtaXdJ1ocTPZch1zHQqA== 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=hsc7zC58Em8Y1WFpX4IwKXrXZNvWn1LkEce863wQbsw=; b=Yo20xZ2h5ONM9qLj26CMhggSr0M8uxaPJSp+I02ThjRTycH3Ekl6wHx6qvqAlyeiShOufAUvL0/rmGLl18kLYklGVHrzYjxFfCN/e1zG9JOGswd7ArqCDONh1H/cenouJZoxAeuhqq8d/6K8Ba6zf1Yra6Qx3uALjyONZQZUOi0= Received: from AS4P250CA0020.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:5e3::9) by PA4P190MB1182.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:10c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.30; Wed, 26 Jun 2024 19:56:07 +0000 Received: from AMS0EPF000001AC.eurprd05.prod.outlook.com (2603:10a6:20b:5e3:cafe::4a) by AS4P250CA0020.outlook.office365.com (2603:10a6:20b:5e3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.25 via Frontend Transport; Wed, 26 Jun 2024 19:56:07 +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 AMS0EPF000001AC.mail.protection.outlook.com (10.167.16.152) with Microsoft SMTP Server id 15.20.7677.15 via Frontend Transport; Wed, 26 Jun 2024 19:56:07 +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 v4 12/23] net/ntnic: add support of the NT200A0X smartNIC Date: Wed, 26 Jun 2024 21:55:22 +0200 Message-ID: <20240626195545.1793419-12-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240626195545.1793419-1-sil-plv@napatech.com> References: <20240530144929.4127931-1-sil-plv@napatech.com> <20240626195545.1793419-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF000001AC:EE_|PA4P190MB1182:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: b474f041-36b0-477c-860e-08dc961a0519 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230038|1800799022|82310400024|36860700011|376012; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?wlTwnRMRckwnKSSEPSdwR4FkBpgjXx0VueWoqKquggZ/NK+u2mm+4pp7mjPS?= =?us-ascii?Q?38NSsUT1uiPgM/8Nfp6tfyhivs61mgGlbSSmbA4cupIHR2Z614SIcZe+CcLn?= =?us-ascii?Q?7BuXAEVotnqeRZ/37WriLBjzU+KlvVFS6AeHWjffwHyeNGzewlYjCl2GNAi2?= =?us-ascii?Q?FxDEqpQ3KRX7xBgIFeGk1VLfEL9xYD2VdwJkfiJBhJoJQxX8fCMrerobRkKz?= =?us-ascii?Q?zEoyuPhIJ6WPcTyVkTpf2kGP1HueTJzwdIBU4Pcx17pboaoxnPbnXZHM4+jr?= =?us-ascii?Q?T04RVp7pALhXcQNUrLsJfe6OCxKtkmig27aKTkANI5aXtSjhWuepotUc/SrI?= =?us-ascii?Q?hvk8i3iI9BDlcAx8/ukGM867T7+EfQraZliY5D0KKb+BBmtHxWncqRsIlQjI?= =?us-ascii?Q?iJKfI9dJo92wP0ubAqB64RtHtJeY4N5ATGNSueAZOdgJJscoWwhoyEz34qp2?= =?us-ascii?Q?1Z1fnqoJSmspMj+4XZzNN8VpoJOp21f1hXJTlJSx6u25N66h8YuFnGWXlkbm?= =?us-ascii?Q?D3JYdIaES3j2ofUM9P4Tb36JEmgkNdTyaon3DO3MA+P4q7Uq+bF2Bhu6SIZn?= =?us-ascii?Q?nsdQNryUQoTQncbn1X4yGxlM/Jx3Kyw+QUVnvvjxuEPW9EAKLbto+Vv06x7Z?= =?us-ascii?Q?Y2J7WIMb0Q/+v8PJCgkDyp0HxXMwzTWRIMEsERnE5i9mrRClmGGhKS+gg+Lo?= =?us-ascii?Q?lYDWuAZVovRt3DH7/uI0sR58muvgtjmdcszbhBFpSjtJbZWYguBxtnh+RchD?= =?us-ascii?Q?DNbT7U0LMDpX+J30Cd8rMQSIxAcvnfL6hj0qGdtSnEmfkruqE4KKgySACyM2?= =?us-ascii?Q?Ca/A8lMpofZNIbuZqhAR3i+amUNfFhALNEJTw2CX9Yd9AtA697RGCGC1g/2U?= =?us-ascii?Q?D8HUyBIqtxRiOKjreCnnAoWk4PN5bJuKi02PL+1mg2LfPe7e4y+Xpjm2+Ogj?= =?us-ascii?Q?GlMb0OVeQTXFXyJs9OZ/G9PP7nDOZd3F8S45WP702z4swCds3Oi3NXOzOosQ?= =?us-ascii?Q?/FX9AJvjCng1yrl0PSZiMMWBKyfxHgLw63yTBz1wZrIqjYeo4Ir837HtDkqQ?= =?us-ascii?Q?+/uEngNkKkzypR9qngrfbZTl51FwHn/OyUFH0p2A6FiY6UU2o0StYEFz37Rh?= =?us-ascii?Q?7adUk1nlh6+DZN80fwv/q3dQsjakyW6wqZf1nctgd9YHv4xGu8+CeA7/UfuP?= =?us-ascii?Q?gzJOoYJezxdT13mjfR31QtcuP2NJSVQMBy6PYmR4adUn04njCCiXKo6M6nDu?= =?us-ascii?Q?VD4qsXSjzOIMlqJsZYKXzmARoD8qto/OwsOzl1My3ympp1mEJtRj9tP4utAk?= =?us-ascii?Q?fMtrtCh2qDe7jTaYX1n6XdBCd+/fiKDDj2QEBPrTBCAbxu4H0UQKYnMuMC2r?= =?us-ascii?Q?OQ7LmW9+eFf9Dic7MXqNK76jj7n+WMjwQ6L3b8LDORpOrlWqhQ=3D=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:(13230038)(1800799022)(82310400024)(36860700011)(376012); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: sXLief5yIVJhi0goAbd9drJiBIkuQviWbggwxtiTPMOyNfDZlbHvHHARDwg0y//dq4auhR1Md/JIQvpTSj21YLLZ5QwV2lHmF/s2bbna4FU+m9R6VwMq4NA6KYqvxR7q4aocVZiO8X4D27pwAof79N8FTvesgT69QaSPyP2tmmIbdtkkqXO8s3Ml3si8HFeo++Us+Z9Y3aTbUQvHG/NuAiUKe1m1rFFwxu/jE9Wt8qQIR72Vi8HByi1dMUp6MwdE7CD8mxu66erfdKXkV7DPx0rN7WlGr4nwjJ/kxhCgZc4u9Q00snvf3SwT0JqBxaSzndsg+6vq/E92cJASkOgvEhUA6Kr2gi1620tILX913EMHwP2CU9aGCg7RcdLSuRJwMOOGApRHM+TCDyO4iEypkAQzxocZhNZNZYclNkNWKPvjhvjw8rzJGkUQbYfQhB1SD8FOjGeSXO2bOaQl2RtusmWBWaoJmm+CJQBjxinj4+CAH8S4qGJ41jidS5py4+zv7vF77P2jygvgY+tKrPPCOU1uiFPSZjq/UkqbfhEs/FQ8D6FqMkXq+lQh75XfZuHfyX2f459ixUjN9j/gyKU/yLXHWUev4sPcrhayvqqtVjW4IDURA6O5OiFaamMHMMH6x1Gs1q9tHkvvXQHhcHHAaQ== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jun 2024 19:56:07.7080 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b474f041-36b0-477c-860e-08dc961a0519 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: AMS0EPF000001AC.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4P190MB1182 X-BESS-ID: 1719431769-310756-3629-2906-1 X-BESS-VER: 2019.1_20240620.2317 X-BESS-Apparent-Source-IP: 104.47.18.111 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVuYmxmZAVgZQ0MjALMXQMsXQxN AkMSXJKDUx1cjQ0tLQwNTUOM001SxVqTYWAGzGCGdBAAAA X-BESS-Outbound-Spam-Score: 0.70 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.257218 [from cloudscan19-163.eu-central-1b.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 | 12 +++++ 8 files changed, 116 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 99083dd2dd..a87a06204e 100644 --- a/drivers/net/ntnic/adapter/nt4ga_adapter.c +++ b/drivers/net/ntnic/adapter/nt4ga_adapter.c @@ -129,6 +129,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 fced38e41a..79d89b1031 100644 --- a/drivers/net/ntnic/meson.build +++ b/drivers/net/ntnic/meson.build @@ -30,6 +30,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 c1961055d5..364ef8df17 100644 --- a/drivers/net/ntnic/ntnic_ethdev.c +++ b/drivers/net/ntnic/ntnic_ethdev.c @@ -24,6 +24,16 @@ /* Global static variables: */ static rte_spinlock_t hwlock = RTE_SPINLOCK_INITIALIZER; +/* + * The set of PCI devices this driver supports + */ +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 */ +}; + /* * Store and get adapter info */ @@ -514,10 +524,12 @@ static struct rte_pci_driver rte_nthw_pmd = { .name = "net_ntnic", }, + .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