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 41CAC45509; Thu, 27 Jun 2024 09:40:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7496740DFB; Thu, 27 Jun 2024 09:39:43 +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 2B1A440B94 for ; Thu, 27 Jun 2024 09:39:37 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05lp2104.outbound.protection.outlook.com [104.47.17.104]) by mx-outbound22-108.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 27 Jun 2024 07:39:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ip15vH7YVJceO1fP3bwV//AL/z0HuYdEUm+sqZvOsfJLPB7oLvPe5P1FbSs2Ql9wiKW5M+HLKvW+hy6jFyEorH6pxM33gLBdoVXYifASfjQNW0IV7waI2fy84hC7ER7q1LfLMYmSHIF9T9w18oWuMztsnYhcanvre/COZFn8MOJu3GbOSmCKuf+AtW/WkLyPOEC92m6cOsCNiSMDeKL6eWo1nVvgKeFP3q9liXs9+N1Hy1Uga6StxaaT2gngxkoq9MMfscyvCefiDJeYRRILSEK8yx4ropHdB31CmIvQ6d3Bl9mT68x3dr324YgUAm4+6k3MxAZrX7NBV2B1ajqs/A== 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=Q0WSuZHQI4sstMW9EFH4fBgGPUgZry6QZxvq06e/d43G1xB/JXBjoZuk8LWITnRhYqmWsfdbuYq/6/4uDj4DPjD5DxA+nYYhHKtaO1XNKp454AN+tBDmVo79bDeM6hYl11rrrKjywNbJDS/8r3tELlOiWWGDT30/s6Ft/5nc9yyQIygXLNtX56fQgTI8RvDuI2rBE3pT0K6nHGpXySmuCOqrS6TA9MQtBHUR3rbRqBwLKDYWPfTF4M6PlRoy3T6MWpl3JECKYNhh8D7bRvcNpvyuS601BQb4JXfrPWDxSZ91wnTF0wbznrRpUP69NiZOOLksahnPWYZ2w8U5U7OOPA== 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=mKCm5WTLuN0BCD8vuSuX+62UDiM9wEbxPOFzMfIYLFWjNwwm03Y3XPvzqMkvKNERRgrsjiIP9WII1QWwUTtqUzb7KciRVlwYxtPGy8xW2RgHXm01WULX39Z4VoVJb18vJYn1CyVNDwBoj16t+9kze0Aw8RYQtvTfnFgaZXmZ45w= Received: from DUZPR01CA0338.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b8::8) by AM9P190MB1331.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:26b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.35; Thu, 27 Jun 2024 07:39:33 +0000 Received: from DB1PEPF000509E2.eurprd03.prod.outlook.com (2603:10a6:10:4b8:cafe::2d) by DUZPR01CA0338.outlook.office365.com (2603:10a6:10:4b8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.25 via Frontend Transport; Thu, 27 Jun 2024 07:39:33 +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 DB1PEPF000509E2.mail.protection.outlook.com (10.167.242.52) with Microsoft SMTP Server id 15.20.7677.15 via Frontend Transport; Thu, 27 Jun 2024 07:39:33 +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 v5 12/23] net/ntnic: add support of the NT200A0X smartNIC Date: Thu, 27 Jun 2024 09:38:53 +0200 Message-ID: <20240627073918.2039719-12-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240627073918.2039719-1-sil-plv@napatech.com> References: <20240530144929.4127931-1-sil-plv@napatech.com> <20240627073918.2039719-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB1PEPF000509E2:EE_|AM9P190MB1331:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: b06feaf4-befe-4403-73cc-08dc967c49d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?0L7dxQv5HG616WiDFtyxNcBGSOv8m+IdhGHD2LvLJUpc8U4c7quqWoa6GV9m?= =?us-ascii?Q?AL578hGxliaiqhM1SVAridTWxt1qHqL6N0x4uo5MDmarYJHlmnJhM0U5qo1i?= =?us-ascii?Q?p3L4aXMTW8VUMwQ7DljAnmrTCwZytWjLGjtX7C9j6DNNT8xa+pjPgzB/M/JF?= =?us-ascii?Q?9Y4XjmhLW568v0KoW/qkLr3ZZ4WalvsKVBDjXS9H5Mff3gMCd2zs+IDlh8fx?= =?us-ascii?Q?LhfSuCSVoBqsdKb807lTMF+ImeFBK3syQn0OcHqKryDAh9xqaz4WB5VfTho3?= =?us-ascii?Q?UdAm9Y4g77hPk19sbvlg1GwTJt6uXnBPANTxU7zguvMCCVBymbO2kF3SufJE?= =?us-ascii?Q?nZwy8EHf1Pm1cKGd7t1PiQwd3c3SBK52WwMNbDiF+RY1CzLZuhFPOStQV1re?= =?us-ascii?Q?xDQV8y2GTmG1ilaZaUpTbmV6ekTB/LMyCkiDvZU5uV77O50OMuKE/0ZlgOoU?= =?us-ascii?Q?ytgcqfkGy4WvpbJT8HcRqko5xUC74XZ/WkJiKaS+3ZkDS/ezxEzuY10sk1kj?= =?us-ascii?Q?VP1AyxPUmbPVk+R3ADwXHhQieGBzU75zUq25c6VTgT+DsTkyk6/CBxQXEwrf?= =?us-ascii?Q?gWvSGS81ILjl6O2wa/5jBJ7UUgwoaot0PfSF2r7n3xqTptALXCqtR4Nqu8wB?= =?us-ascii?Q?m+NmqgibgYRSAZs6kTFuDbf7gNepLgFGv/5PrLqFN8ircGOWYMsF2R+GmosJ?= =?us-ascii?Q?mHVcnVq8HeW8Q4OIW4EZJtaDaViY94mYxZvDgiW4p+FJnaUI5pP1IfPMXTsj?= =?us-ascii?Q?xdjLKmZIGAIoema09YE+4Iv1ltCTJ0qNLxjURP/qcXo65oSq9jOa7ZPHeNsl?= =?us-ascii?Q?YMfuIGkemS3sf4W6rk2zBUXwxLSNnC0QNU/tjvStkA+fA18bJ8OzWV/GI1rO?= =?us-ascii?Q?EycxiJ47bi+eLxGwI1NuFP1Ap4b0M/kvCR5joSW0WjKCmuzl71K85lF/7ciS?= =?us-ascii?Q?bOt7T4KmSGUiq1On+6Fm1z5h58KP8jEKVMjMGHLupGUwkR/Lv1kqOt+cWz2n?= =?us-ascii?Q?xoGuZ/Ju5D8SnOjeItwQl6WTtHvhBQqeP/oSpOwAvdfTLC2TARyfs21wkaxZ?= =?us-ascii?Q?vDfIpGyRMb1Iq+c++0vQDapxLZqv1O3vhkLNhE2o7ijrdTo0NQOJo1D2r6AY?= =?us-ascii?Q?40zLa8JbyV2czfpq2ijG4y6BQxu2uDhXVZnAgCz/GyyEEZbrs2wbirISf3Cn?= =?us-ascii?Q?hF38VID+3r6fnvfxjtiaUiPtUioSAgRz9o1YNIPElzxIPYkNPUMgw3ySpQP+?= =?us-ascii?Q?RQGGt99cw4KvtcpVapyvUnXnTQNuLjtT3z2k68H43Ct+LYWBfthtoFK5F6CE?= =?us-ascii?Q?6L15UeN7X5GSWME2R2wvzuXcBzMkfHXcOgzWPYpnp+4O83s1y/YKDK3p3l+X?= =?us-ascii?Q?N8f+dAdSDgg8u6bfm/NzR2og2LsQEsBmTxjhf3BZA43Jk0JK1AmWvdTR046b?= =?us-ascii?Q?Bcd0FI5QENlnYyti10OdXNKZ5VEhK6V/?= 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)(36860700013)(1800799024)(376014)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Sms9b10kgIWn7zHn2x7H4ovll/SvLYa6m5cbRUbDk0oB12K/P4HajktSPHduqAAMtMj1YUtf7Ka5IqOUgQU7XiIaEnmZxJq13g4Deu0yFHPypNzq5bMnxeNl15l+TsAJ3GhEr0rSpf0KVjeMDaLmqWmUdT39J/PYie3upXbLhKgo+or85xL1TVcn0fMGqb2TXov25yDSFmkrwq6JWgYJvHoIAXZQdrMInkQnst5QmyY05pYoaiBJX2+EWk9hZQLS6nvrlYdWfg7DOhPEZTms2gjxzPNzswnqRshl2xdfGwBT8GmflxEioM6J/fT9ck1AM8+nygVT7DekSYEUoIuYaFMcPryhA3T/iC6rFfpA9418uOirrVRYhsOMXOp1274sv8tF9Zgs9h5PWOYTFJ7EUC3DEtYWeJ7h+qlIhOrD9u14cuR7gvT+yO7MX/QAQWcenDMVU3ewF+KkjnhZaM4nSmlRgedb+HffWr9pCAKVtGfQ7D2jcw3rUgJQclQB87U9coWfc3PeBeVBeQ1WhXGrJn3HZnEHLGiWjSoHl7j4p65sXVmt4Gs8tOYEgXFrzZU5hFi8k0t80/1YrHNu8ju29NrBvPVRy7unfd/+df1VPk1v+7k58ilQrDc3XiZ5LjOxENiMvJ2alkN/S5y96GSRpg== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 07:39:33.5529 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b06feaf4-befe-4403-73cc-08dc967c49d1 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: DB1PEPF000509E2.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P190MB1331 X-BESS-ID: 1719473975-305740-12658-2615-1 X-BESS-VER: 2019.1_20240620.2317 X-BESS-Apparent-Source-IP: 104.47.17.104 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.257231 [from cloudscan9-62.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 | 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