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 1389445628; Tue, 16 Jul 2024 14:03:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7EFB443352; Tue, 16 Jul 2024 14:02:38 +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 44E3D432F4 for ; Tue, 16 Jul 2024 14:02:33 +0200 (CEST) Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03lp2232.outbound.protection.outlook.com [104.47.51.232]) by mx-outbound21-91.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Jul 2024 12:02:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VCD8N0Q5FQ503l1Em8TKLo3HX0aPAQ7O1fyOT8zKIBeMKJO0fR49Bo/3xgncZCbYyK5RbdJ+aLIUueXVej/gPdWTESDycXf+Z/gXj811uhNzi87iqDdU3GKKCU5D4CScKOz1KyeBRRPIDd7WX5dxPvAPu2icUHk7tgfn1qj6ayFtWTGZReMpmvhuIXWQPxHmRWuCe37M2zBwfuj00NZe6KGiRJ7OJkSFgHY1QBHyQJOcsvxT0nk1aW1Mxi3SYpULDvplQoUm+yFiAqpNmD7QbpU29B6gRZg+/iat1lO4wk7qEHWQWQ+82bCPj0ScMbYAcpFpcoEL+zoQ0veh5JTX5g== 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=4YQSI17Ux1T9g/+REgQzhl6xmz8PzSkZnM3f7qn9K9w=; b=tfgCROHNCbNlMEjm2KVJAlqB14q+aKyxPpV9jJDayV7h00duPliU+bMOourfpUMjNU8VrJ1ao+H4OVspUWgw9nfyIEUE+6JCFY8GnyKXPsQ9ouiJiJyX7xmyPe0uFC9J1pqOWQf4Kduj88QH5pj0pBWoByNr0wTPu94xDuj5mCdIm45o0aFcRw+36A1yNSFYWvNvV2TzXJhZp6uogpJMrbOlNWr6uadvZ3YjKl8n1u4K5Dgd6bpUHgTn2jZZeW21G/4GYyK9Zi3BrQxTUXhcPVoFXyu/CxigiU2J3MGHCaQR9jtlR60jWQ8CyE2Fnz0EsKI6quJlsn3clJdJpqonOg== 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=4YQSI17Ux1T9g/+REgQzhl6xmz8PzSkZnM3f7qn9K9w=; b=jcLJK4HA49++lD8baxMn8FLNW8ATNf2RXQvYG1J295gyoCZkVvqTyWi4NTPd+XtVaA/5wiG+eNm9rpdU6rxNwc4iSUw4tb+IrBKxHtVuVbPT1sgP6QeltrrBC2iTf3646ihdqJjfx9b89B+KRCu/pN4W1zfsW1XWlWoDRC/uSH8= Received: from DU7P195CA0029.EURP195.PROD.OUTLOOK.COM (2603:10a6:10:54d::12) by DB8P190MB0683.EURP190.PROD.OUTLOOK.COM (2603:10a6:10:12c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Tue, 16 Jul 2024 12:02:30 +0000 Received: from DU6PEPF0000A7DD.eurprd02.prod.outlook.com (2603:10a6:10:54d:cafe::bd) by DU7P195CA0029.outlook.office365.com (2603:10a6:10:54d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.14 via Frontend Transport; Tue, 16 Jul 2024 12:02:30 +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 DU6PEPF0000A7DD.mail.protection.outlook.com (10.167.8.37) with Microsoft SMTP Server id 15.20.7784.11 via Frontend Transport; Tue, 16 Jul 2024 12:02:30 +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 v9 12/21] net/ntnic: add support of the NT200A0X smartNIC Date: Tue, 16 Jul 2024 14:02:01 +0200 Message-ID: <20240716120216.3032484-12-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240716120216.3032484-1-sil-plv@napatech.com> References: <20240530144929.4127931-1-sil-plv@napatech.com> <20240716120216.3032484-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU6PEPF0000A7DD:EE_|DB8P190MB0683:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 614a1931-576e-4f5b-4f3e-08dca58f2b53 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?GN+Xw4rz+tRsVGtGfuV4kcoi4hNWfk6Oav6U9UCo7aHaSu6y0azkxHuWzm2I?= =?us-ascii?Q?VJVU/2YuR2pv6O3thbatgdkqjNSJ+nObu8P788gZWpBTIt819k/8LUs+CnRW?= =?us-ascii?Q?umuIm9DejpocgLSo5fKVOr+cDkiLzDOjf11EFYRxGBwGQhMMI3PfeWsAptNg?= =?us-ascii?Q?yFyqfdligZgfKSkZ9i1plcz8yzUmWdaNOvDVfNnz7bYn/BTQFdJxJV+6fgIz?= =?us-ascii?Q?LurhSFCyUIxHgdwIy+NwbFGUBXAUdPEvjYn45VxkESW9KofkmWK+XP7AYtak?= =?us-ascii?Q?MePM+Air35ywP5+zYbG9lKWnuCSqg3Y+I3q/NToJV4gYdAu6M3dRR3CWgSLH?= =?us-ascii?Q?jbfaJKCwtlr0zcLJ3/P/2N1nv0eGWMfuCIECUAQxprehCfNi6crWKeQj5+0e?= =?us-ascii?Q?LoAdMiuVMqDVOqNmzqR931v1xcGwXdkE3MIB1l/J0vJst1d4UD24ONpDifKR?= =?us-ascii?Q?Szas6QCqgc7xFk++BwMxsRKWXS04U5nsLuiKorFNOHOxchstwHgCYfIof4Iy?= =?us-ascii?Q?m+yCtSpI8RmO+BSshWYtAuzb5oPUwjOnKTaVjOn6fi31HCTR701kUzJSFzfK?= =?us-ascii?Q?URfSf98md6t5pShdVpDZ6NNEoS2L2r8oERGfcfUaoXTCwTiWSRbYuR95eFz6?= =?us-ascii?Q?/FY20PtY4Noum4hLiYUTta6rOeeALA9pEu9GR3Q1EUtPEwnMHLaUd9Qi7j/Q?= =?us-ascii?Q?y+EiJcD8kL2ux4jEisEU+sKqLJlsFt78rsnDnJkdIBGzoYs55OnlMx+fX94l?= =?us-ascii?Q?hHwXUcMWo1qnH05S9N1H5dMujAcmUgDRD2QzYkBDge6TQjCc2h8iF4XpD3Px?= =?us-ascii?Q?I+7LFvEikHAgalZoqtHxMS0IpOaon9eG7Vu8yk4py+fqlwOTz8vrmQzXWmga?= =?us-ascii?Q?XZGvIENvEk63TGAwK1ZQ3JX65I3BCQAzCMcmhCu03ktMR03yafdHy8I8X+F/?= =?us-ascii?Q?elnxKvp7denotTqi08VbbiS3Mqf2LW3+aU4iKfjCY8GrNe+7ZDmGvkfxBo4v?= =?us-ascii?Q?dSNgF7YJ69K2Y7zibZ9qw42cmEay6lL4a4OYXlf2Y4YjwvtI/pK1BU0CLhXh?= =?us-ascii?Q?lG8hemShm59fqAzL3zNvrvYRfrEe5k1KffspW54L/ift8Xwdg7FQWmY43iem?= =?us-ascii?Q?Qu+xFR4b7F9pncwbwv3tOYO3DtdFKhri9FW8MLGVQjss1unWabhxzOTL8nVE?= =?us-ascii?Q?3GOAagUU/8CwvbHA4SsJb4wJ5HfXSoNLurY/ABd2eaZzvgMVAChZDCVtO2x6?= =?us-ascii?Q?f9ehk/zXQucpAN1uLmLvTtkJqS5Mo/0ICRE0Ck5GBOVMyY7U6vlpRAXkmDbo?= =?us-ascii?Q?wwD5oYnskBSG4X/zfc+VB7B2CpsSaN/6ujbQFTT48IAfpy9fHCl2mBLQbXcW?= =?us-ascii?Q?Yz/tQwblw+UyaR8mmbpg2Y5HEuEuOKb6e+RW2KBBIlaATM+pSUV5uS25S3X/?= =?us-ascii?Q?H1/6ng5GEVDsF+VQ4+XfTvEiBF46NHee?= 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)(36860700013)(1800799024); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 9TA46cd1XW+nL6jMZ+mI4tlNR2j8msbv+9yny5blZsHCThDw0cCbMABU6h9kJ/CXNE8//Eac/wDUvyTv5WsRDmMhGWCzD2m1VJ72weev8oAN7/kMFzk45zetX0clQDU2sp2A6dyJKaBCfyGUVaFKug95dPL0GgbcUxJvFDTNAD7LWb48aP3siz3rRCLhY8Jn0fbCbkrhlM4KU3pL+TxK6YQRXktYOg32srAdc2NPqlJyA8CsJOZI/5et85ETcIu4qepPj/QTYTbGgcdYOX1aT5ouvZCgf5ufYjZ5D2pqy+8INVDHaiD4q+N4Ny3g4jVE9IQHmsNfnm9Z911d98BerhbcYEt4XWV2+F3WXtAhRtL9GfzNEvNfKgZgRaQqQeIIxFUaIYQjJeDduyAlqim7wZaAZlLKTOaTxgVSKFyIwnmvzDndChMhJBq2oFvyndgIFbHHHBhlKTMGzVYUtwrbpO3PdbL2yEhmLLXMUGDki5t9mrXew9ElIP5eTzRA0zU5zKGjgZ8CjRqcoWbcs5AtV8ifIl8sFRzXbgLjYx8VqDbvGL7nbzrTYuAdiZTFnCmI04DGSUi3IWjGbEjjfEiVU8/j8gSbXBvR+nMB/Tl8wNxxEzWDw0vuijkM1RC81Ra+KPdK6zG2aIujiaPYkC4Id7uNVRqlzN+3o56TmHD6Kqg= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jul 2024 12:02:30.2741 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 614a1931-576e-4f5b-4f3e-08dca58f2b53 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: DU6PEPF0000A7DD.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8P190MB0683 X-BESS-ID: 1721131352-305467-12641-23789-1 X-BESS-VER: 2019.1_20240702.1505 X-BESS-Apparent-Source-IP: 104.47.51.232 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVuZGFhZAVgZQ0DTR1NDQMNHMJM nQwDDFJDXJ0MjIIsXYzCgpMdHUMilZqTYWAAiaftpBAAAA X-BESS-Outbound-Spam-Score: 0.70 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.257662 [from cloudscan16-14.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 | 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 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 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.45.0