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 5C40445635; Wed, 17 Jul 2024 15:34:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E633427C0; Wed, 17 Jul 2024 15:33:34 +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 8148E40674 for ; Wed, 17 Jul 2024 15:33:28 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2113.outbound.protection.outlook.com [104.47.18.113]) by mx-outbound23-33.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Jul 2024 13:33:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gfAkE3a9OAwpMslEKEd7q3HZv6GF4KVmUDy2bwOu7DHFuVDrJ7zddX0+UTZm7Y2h/jsBKR0U0xz8cMSmguKsO7Dr2HB3pfo4GABMBDhX1le8Eyt/OIFfYO1J4CldRn5YhM8/+yT6bs5vkj8MjVpR+35x0CSqJIuS7un3jrPnFpL9mTxO+xcMlBLweYl4AEareuRYETvutNNZ4DL2GWdgnJUESG6ObxW3yX7qQwnnACN+xeAcphQeO9oKM8GdlvtwQPzG+zZvqrIQPIbohCRDgJ9gCbTADy6fkVW4bnKd3jNn5WHitUUiqBhodSSydLwZlH5kOgqbq//kz7Bfn/EeXQ== 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=j3SNc1OG0d/m2zuYW2XK94l+FESfjj/XfRmSOQW54lA=; b=Wsh796Vby0ccVZ1h3Fij8Dy0dCtOgyKw6Hs8t4jTxn8bqtW4ykGZ4lATrbAFD5cpL79Y7KnEuDoxC0730kcQXGvoYRvqG+p/Qp7s5iRf5EM27Pbri7B/8MlG+rsYKjYHEU+CXWTlJHFCOG3gQlhBfc4llhQcQLeMSVgQW1c7kT+yFEpa+CUn0Ks5aLQ9O8znNExshNDxeZf76ofHBNPz1n+tP3f/p6lsGH+023eCMLUe1EoIrisWq0f8nn32zOs5H8qon39uFKnY6uEtcsWSlAN+kW83ByDLWVn7GjTHsC4PgOoIlGqa3Ev3GE6Ji0hXyoiCRctc4Ald7+nFxiRKww== 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=j3SNc1OG0d/m2zuYW2XK94l+FESfjj/XfRmSOQW54lA=; b=KkaNtT3gzclfKkq773i/aGuiaGAm0s+K6cVJ4ljjSPnlWo2+kHxfybbl/0606p3aHY34kXXd1AeLA34cRqsEhcbLVJ4d8G4xgzJoSTs1dGxQjrL0CJbmMbhReGrfFd4ZZOHQa2VR/EFD1XWsExBcAzCZWXVT9y/TYPX2E4ivjWE= Received: from AM0PR04CA0090.eurprd04.prod.outlook.com (2603:10a6:208:be::31) by DB8P190MB0700.EURP190.PROD.OUTLOOK.COM (2603:10a6:10:123::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.14; Wed, 17 Jul 2024 13:33:24 +0000 Received: from AM3PEPF0000A799.eurprd04.prod.outlook.com (2603:10a6:208:be:cafe::15) by AM0PR04CA0090.outlook.office365.com (2603:10a6:208:be::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29 via Frontend Transport; Wed, 17 Jul 2024 13:33:24 +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 AM3PEPF0000A799.mail.protection.outlook.com (10.167.16.104) with Microsoft SMTP Server id 15.20.7784.11 via Frontend Transport; Wed, 17 Jul 2024 13:33:24 +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 v10 12/21] net/ntnic: add support of the NT200A0X smartNIC Date: Wed, 17 Jul 2024 15:32:59 +0200 Message-ID: <20240717133313.3104239-12-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240717133313.3104239-1-sil-plv@napatech.com> References: <20240530144929.4127931-1-sil-plv@napatech.com> <20240717133313.3104239-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF0000A799:EE_|DB8P190MB0700:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 63214352-9d14-458e-f59d-08dca6650855 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?vi8tXZcZTBLjLyryaP+uASEPgVL8wNjKfjHbelHOvgJd5KgTGpyJuCdhRj00?= =?us-ascii?Q?e+h37dbCwST7f8ZSzYnTByzzwhOoB/8rqLtQTay4jFOeaH4dqGeXLV/aUm33?= =?us-ascii?Q?G4LQPnNjq3a01bNYqreGWK0whemqOktSTmDz/ICt4Iq0/ou9rajPXHBG84SS?= =?us-ascii?Q?fJE+eVQ09WSuWR0auVIG+iwbBq10Z59U4ovCy9CDJN8hMZzZIJQHaHpcZaTr?= =?us-ascii?Q?4WI8yBXwIjLhDPaF7chXgpSRbDgpVPBm5DlUahWg5t6cCBBMl30yK8tSNqob?= =?us-ascii?Q?JkAWL3VMwIkvQ2FFjxxRxnRGr5SENrfGaTuVrfeNGwUIkWV+ZmB+/u2yNe6P?= =?us-ascii?Q?GREX6hv5qr2sKNi9DjFwJ5lyEU/RA2rlBOGlAmLcSMYu1OFDNa2tq2q5QiPl?= =?us-ascii?Q?aVne0tWWEzWaeqyI4WMEjiHWjTBTzicB6k1U/GM389F40AoEiRNg6Ofa5moD?= =?us-ascii?Q?rOk+kEIow22uajOM01c/ZkgqH4wGotjEtkBkEVblk0hG2sQV/tdzdnAMQkeX?= =?us-ascii?Q?+P/Z4D5I7MOoNz6UKioZoiH1ygnMI7j/ZS/hVHGPQplIS6hM3gJazlc9r5jQ?= =?us-ascii?Q?wA2Cnd2SlSBAC5l2jjj1HVOOu001gv7lF80qd92lnf4zicgpwszzO2YbPBM4?= =?us-ascii?Q?nCflm/o2tud289MP9c767Q5CoWpp6eO63bJw8T7S2HgQjBgS7se6K1WEaWSy?= =?us-ascii?Q?LrHos1u5Ys8SkM/51sv1odMvn9prjrg70S+Xtc2PwNtmixZVSiYB61oLOgXf?= =?us-ascii?Q?sz2QN1OCCsRFIDfA4TsFtFr9/pBkxGRnVx6furLpYkqHvpUIvYBStUUHZdI0?= =?us-ascii?Q?gsdHoJnZdHhlA9oiNI8gWP/kYLmKHXNtMQCHfK5uAeKcG3X1J/d4sJIwlolR?= =?us-ascii?Q?jzJcUcwq4PIC778vlxMsBZAveMsuQ42Y2TS3SEz55rYrLRHZ4E6FcR/1bSVH?= =?us-ascii?Q?N0d3iZHHosp49ax97xERoD5DeNDRaqGoxv2bpnQFFDFM5EIXuNxlkRCxoAJq?= =?us-ascii?Q?7I0Ior3vFm9tZNXB7GxG0+RUIyM+I/nri6c9DQkebhs3hPmtC0Ea58w2Vs1V?= =?us-ascii?Q?hELlB4k61+jtFi6i9NXMVzV5eQYI277c6MiInLlsICWMs2taQSDnnduxKGG/?= =?us-ascii?Q?rCLxkNlvPLOMcgw1a+8iDor91Sc7LSQCteE9zg5O32TwFDHjX0au14lq7jV+?= =?us-ascii?Q?Wl/0OemwkMnQaJ/V0Rxk9XVIOK28Qy6mo++i3Ln3g2cb9oUHqROu8CQB1PR/?= =?us-ascii?Q?dqqXfVx5De+77p8NgnPPlAVbnm7quH75n1r1bOAXvoOQ+jRRouJeTagL2IjF?= =?us-ascii?Q?/oBTTkzT9hPEG/a8ckzOkGK0HPq8jAYH5xQ9HgAi0UMRuQBq66DqrORPFUXJ?= =?us-ascii?Q?PG2/gjLa5nthcoKURvS2fXZiOYFEtUyb5K1CeaZLMSKaPCuYFqc5KyhFP8by?= =?us-ascii?Q?GCEwAzFPg0UP2ATif6AaRsRC7bHSCaZZ?= 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: emyMMS1TNNhFMNe4fxw/aS4cVFhE16Ek+Y/8yiwtfX8SsHc5T4zjXpcH7CmfGe65NJHADG8Xf3pKwd7cOcViLPV+Fml8wvzIaOHtKzejqnJcHp7gbst1TP+DFG2jaVC5ZEOAJdRQC8Zj4L3zl2gLMzk00VaePLWDQiN9xsvvvP1fA7mJ5iT7N1o5VQeywijn5r3UTScp7siFDHnKTskBPagOC9OFROVJFXNO3zEsiHuCTbgrRv5MjXQPo6C+NzqHfpktfLvr1w0fCNyif+TSWPkjJo+2fGbMxvg2HjW/6yCh49SJtQp18TiwaBUFsE81eTYsXeYYAZy824AzZDBCGvt5XioLcItXNBpwVEwX9xTozfYI63nAp0OFn1voFCmfO15qqrZxrN3W9DICh04Q3ya5gA3zHwwBviViJvD7L0C1g00eOFuTcd21U8aQhhIY9uWO6JCHWwFH+hsRAROg4V6AUItT6yaPSxtQ1ep7E5xU1FADjWRGc23YER2+4JC/tj9j/z6G6uksInQF3Gi8TRkziGG501a5z1Vvk4kxNZmf4cfE8oDzQMWQGPJdCnfaR4VpRYrB9Nnz+sk2TnoXAFKzpwEH1+wrFtc6w2/IO63GOFyhg7iThxIrKj7Kb9VKotxwAfYR7Gvlu7IIPaaQig== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2024 13:33:24.0120 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63214352-9d14-458e-f59d-08dca6650855 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: AM3PEPF0000A799.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8P190MB0700 X-BESS-ID: 1721223199-305921-12787-14939-4 X-BESS-VER: 2019.1_20240716.1757 X-BESS-Apparent-Source-IP: 104.47.18.113 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVubGZsZAVgZQ0MQkycQixTjJzC LZxDjRLNnMxMTSPMXMMDkt0TQlzShFqTYWAN8nJMtBAAAA X-BESS-Outbound-Spam-Score: 0.70 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.257687 [from cloudscan15-79.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 --- v10 * Use 8 spaces as indentation in meson --- 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 381884349b..1bdd11f227 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 74d4f12425..e6e930f09b 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 b68fcba25b..5d3da88c58 100644 --- a/drivers/net/ntnic/ntnic_ethdev.c +++ b/drivers/net/ntnic/ntnic_ethdev.c @@ -25,6 +25,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 */ @@ -475,9 +476,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.43.0