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 ED87745614; Fri, 12 Jul 2024 17:48:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B78CF42F7A; Fri, 12 Jul 2024 17:47:48 +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 BF58A42EEE for ; Fri, 12 Jul 2024 17:47:45 +0200 (CEST) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02lp2235.outbound.protection.outlook.com [104.47.11.235]) by mx-outbound8-179.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 12 Jul 2024 15:47:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BtXgPluOZR4eOwzagUtixyu2o3xdM1D+N7DF7C2odl5eUi1Ws/pKFA22tU35uEQv6H/N9KlLJNUs4iMnRTI1Y0GveXsKAk+F358C62Uit0cM4vh3AOhiFBCPGxv/Yp3oDDmKNWcyPQwkCJGpfnkB4zxiI8yNnyOMyZn4oFxCm3IOOYYa3dT3IHBnVYiyke6NdUkOZD/FRfGkbg2dJxpPK7fgdi/IWFnrzSbKhzOI2hF+oNgNEnZe0296twByUkZOVPfJP5rPu2U0kQNoNJpGYmuAIpmq6JS5W7BcohuyMcJHGl0USR8QHzG7XmkoBMTvXIyX557fFs/Dk8777rWZWg== 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=ebvfsr7tAiQklZl7qcKwbGQejVYX25Gmj/0Pzj56NnM=; b=dwUFTW7Trj5t4L/ZubfYZ6OKAevsn0XutnB9hv/066p+OdI+7dIvxpgIa0WF6m7W0fq8jY6R+mi1rfNNFWAYwhHy7g3BkyBAOK5FZYigdN8s+r4PzPKmJrweeokvjV4h9uCJfBvVQqflE6BlYCIilUpC/EaBPjqc9FODDTZKxET+AIVjAinfnJfOWU2AUBAoRNCr/yynWO8YBT8aLAd+Qp/QIHi9fKHNnx37cUICRN4d2s2yJMcz1IP+ikoOzn3e0PAVekTuoVDww9Tp2E7wrht7jdQOQROJehGE9FrzUd0HO0sxkiUT2u6sTWGcF7+MQv+toY0Q3qDXuXyHWHJwqQ== 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=ebvfsr7tAiQklZl7qcKwbGQejVYX25Gmj/0Pzj56NnM=; b=eXojxUdUCx1U2nwI1crp+kleedlH84KCkGr9KBsqWAqKj/LVH/vVapoP0wBu4//3zGvwry1DtmWyJYRZzYVfu+suU1Z+9dtk0qdbkPPsu9guSNz3Ln44p4U75J9B4pea7mGLBbe6me2CfwlLiaRaXOskxpGfV+6iEz9j2pr+gLo= Received: from DU7PR01CA0003.eurprd01.prod.exchangelabs.com (2603:10a6:10:50f::17) by VE1P190MB0864.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:1a4::14) 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:41 +0000 Received: from DU2PEPF00028D0C.eurprd03.prod.outlook.com (2603:10a6:10:50f:cafe::2a) by DU7PR01CA0003.outlook.office365.com (2603:10a6:10:50f::17) 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:40 +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:40 +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, Thomas Monjalon Subject: [PATCH v8 01/21] net/ntnic: add ethdev and makes PMD available Date: Fri, 12 Jul 2024 17:47:11 +0200 Message-ID: <20240712154737.1339646-1-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240530144929.4127931-1-sil-plv@napatech.com> References: <20240530144929.4127931-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_|VE1P190MB0864:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 0e703e9a-2873-417a-13e3-08dca289f661 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?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opcXVdZ56ND/eprA+mJH?= =?us-ascii?Q?r2cJvy2f99JLA5rKKLITlRAgXvy4wdY49hcL1jG8c/J+dEe+oRuNWUHMFkxd?= =?us-ascii?Q?HLsKVJ2ZxbpmMjUJFeAoXprl4YHsh56+An2QlmTVvEoKPkhQt3Ivda9YGG4w?= =?us-ascii?Q?l1/p3uvMYE1lAlZgLKpI0iQTq6l1TVTzZ+56494prnweE8yQwhB7+idLnlXz?= =?us-ascii?Q?gztMWS5ZIPwaWokL0QG5P6l2cgXgCx38A+a5MtqBGEiACuJSyP173QfEp7xY?= =?us-ascii?Q?2JqPIjqQjcq9deox1ttkPVuZ9Xn38hEpPpf1gy5QW0L18KlEjGdgtz4CAZu6?= =?us-ascii?Q?TewQTkr/kLYOSDJl8ywLR8orwowQLAxLMASqANP0JgJLDU50IF/GGLrUB600?= =?us-ascii?Q?bLg5sa7IyZqWT22TigHePQDk14sbEoFW5b2/MxOSJZmOWG9sRcxT0ssQTvcF?= =?us-ascii?Q?aW1agJDuR4TubId9NhkTVhwjYMgjKubsvAfC3pdARBczGLDyrq3sd/613JaW?= =?us-ascii?Q?WpQrxR2ehKGPUW527kHKWv128QUZ?= 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)(36860700013)(1800799024)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: YxyCr+NEjErqO8cfFizik/I+n7NgJ+vzzGB1dp/oVF8ozwr+NJBKR85cH6bbfjySPLl/Z3uGbvQVp8L1c1pqRUY+33c4BSbZicVh/WutG/mnpEbiPcRncQ2ZKxcV0oi6Ao0jAwe+3KzsP6dWnbujWC9S4TCajeXSfBL+SiE35cd+jMNM5j7uCX5SbRqeTS2cW2E6LIaa3P+o7HlZA8PUzKiBmC4RgBUWKON5z2qYk8oiKsfdg0f9DQrCO0VjA8gfUEbSZCLv9EqA+Gp7vzGD6NtLNQ/RVa099CJt/6uFQtub4XjXf9uPCgdTqtsKPmrNMzXfdoZx3y0csJDYQdCR2aqysC9XhOFaTYGt1WtPRdQ+/b+oKkWHHXtkLOahGeedBV4emwFXCU4amWLgDxbI3PjY0WnPceBEoxKwD40gJzdwbseAMsfzPT05xHCnAVZkJZrDG9jnw9tOiPaQUA9WflKn7I9rENGnyT/8IDBnJv5fg4loSzKnq00fXkElFud/xKvJiMEUq/hWVzSJ7ip5a5hn4qX0vJtAHmB7C9xuqNqqDFjwqzjN/QZaXIgGZcoKVXuJwQGhLZFJqrx8f/VbLBIFj51JtFc/NQ40Xdg9ogXQRVUH68MMG3qLDT9fY3oHjOk39nYZS/YXWyJkCD79XQ== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 15:47:40.4419 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e703e9a-2873-417a-13e3-08dca289f661 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: VE1P190MB0864 X-BESS-ID: 1720799264-302227-12677-34434-1 X-BESS-VER: 2019.1_20240702.1505 X-BESS-Apparent-Source-IP: 104.47.11.235 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVubGlhZAVgZQ0NjcKNkw1cDc0N DQwtQ8ySLJPDHVwjLREqgiKSXV3EKpNhYA9AAXdkEAAAA= X-BESS-Outbound-Spam-Score: 0.51 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.257575 [from cloudscan13-3.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.01 BSF_SC7_SG0146_1 META: Custom rule SG0146_1 0.50 BSF_RULE7568M META: Custom Rule 7568M 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.51 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_SC7_SG0146_1, BSF_RULE7568M, BSF_BESS_OUTBOUND 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 initial ntnic ethdev skeleton and register PCI probe functions Update documentation: Device description and feature list Signed-off-by: Serhii Iliushyk --- v6 * Remove unused includes * Remove EOF markers * Remove unnecesarry commpiller flags * Update documentation INI and RST files * Remove uncovered features * Add features according to DPDK reqirements * Add link on NT200A02 description * Rename res(short for result) to ret(short for return) * Fix unnecessary set of the driver name * The driver name is set by macro RTE_PMD_REGISTER_PCI * Set sentinel value for PCI id_table * NULL value can lead to the crush on function rte_pci_match * Remove unnecessary comments v7 * Move features list to the dedicated patches * Update release note file --- .mailmap | 1 + MAINTAINERS | 7 ++++ doc/guides/nics/features/ntnic.ini | 8 +++++ doc/guides/nics/index.rst | 1 + doc/guides/nics/ntnic.rst | 39 ++++++++++++++++++++ doc/guides/rel_notes/release_24_07.rst | 10 ++++++ drivers/net/meson.build | 1 + drivers/net/ntnic/meson.build | 18 ++++++++++ drivers/net/ntnic/ntnic_ethdev.c | 49 ++++++++++++++++++++++++++ 9 files changed, 134 insertions(+) create mode 100644 doc/guides/nics/features/ntnic.ini create mode 100644 doc/guides/nics/ntnic.rst create mode 100644 drivers/net/ntnic/meson.build create mode 100644 drivers/net/ntnic/ntnic_ethdev.c diff --git a/.mailmap b/.mailmap index 552d79eaa6..aad8c552f6 100644 --- a/.mailmap +++ b/.mailmap @@ -1307,6 +1307,7 @@ Sergey Madaminov Sergey Mironov Sergey Temerkhanov Sergio Gonzalez Monroy +Serhii Iliushyk Seth Arnold Seth Howell Shachar Beiser diff --git a/MAINTAINERS b/MAINTAINERS index 533f707d5f..0359368981 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -855,6 +855,13 @@ F: drivers/net/octeon_ep/ F: doc/guides/nics/features/octeon_ep.ini F: doc/guides/nics/octeon_ep.rst +Napatech ntnic +M: Christian Koue Muf +M: Serhii Iliushyk +F: drivers/net/ntnic/ +F: doc/guides/nics/ntnic.rst +F: doc/guides/nics/features/ntnic.ini + NVIDIA mlx4 M: Matan Azrad M: Viacheslav Ovsiienko diff --git a/doc/guides/nics/features/ntnic.ini b/doc/guides/nics/features/ntnic.ini new file mode 100644 index 0000000000..9ceb75a03b --- /dev/null +++ b/doc/guides/nics/features/ntnic.ini @@ -0,0 +1,8 @@ +; +; Supported features of the 'ntnic' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Linux = Y +x86-64 = Y diff --git a/doc/guides/nics/index.rst b/doc/guides/nics/index.rst index 7bfcac880f..c14bc7988a 100644 --- a/doc/guides/nics/index.rst +++ b/doc/guides/nics/index.rst @@ -53,6 +53,7 @@ Network Interface Controller Drivers nfb nfp ngbe + ntnic null octeon_ep octeontx diff --git a/doc/guides/nics/ntnic.rst b/doc/guides/nics/ntnic.rst new file mode 100644 index 0000000000..249d83d511 --- /dev/null +++ b/doc/guides/nics/ntnic.rst @@ -0,0 +1,39 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright(c) 2023 Napatech A/S + +NTNIC Poll Mode Driver +====================== + +The NTNIC PMD provides poll mode driver support for Napatech smartNICs. + + +Design +------ + +The NTNIC PMD is designed as a pure user-space driver, and requires no special +Napatech kernel modules. + +The Napatech smartNIC presents one control PCI device (PF0). NTNIC PMD accesses +smartNIC PF0 via vfio-pci kernel driver. Access to PF0 for all purposes is +exclusive, so only one process should access it. The physical ports are located +behind PF0 as DPDK port 0 and 1. + + +Supported NICs +-------------- + +- NT200A02 2x100G SmartNIC + + - FPGA ID 9563 (Inline Flow Management) + +All information about NT200A02 can be found by link below: +https://www.napatech.com/products/nt200a02-smartnic-inline/ + +Limitations +~~~~~~~~~~~ + +Kernel versions before 5.7 are not supported. Kernel version 5.7 added vfio-pci +support for creating VFs from the PF which is required for the PMD to use +vfio-pci on the PF. This support has been back-ported to older Linux +distributions and they are also supported. If vfio-pci is not required kernel +version 4.18 is supported. diff --git a/doc/guides/rel_notes/release_24_07.rst b/doc/guides/rel_notes/release_24_07.rst index e50afed0d5..332a959618 100644 --- a/doc/guides/rel_notes/release_24_07.rst +++ b/doc/guides/rel_notes/release_24_07.rst @@ -154,6 +154,16 @@ New Features Added an API that allows the user to reclaim the defer queue with RCU. +* **Added Napatech ntnic experimental PMD driver.** + + * Added the experimental PMD driver + + - Ability to initialize the NIC (NT200A02) + - Supporting only one FPGA firmware (9563.55.39) + - Ability to bring up the 100G link + - Supporting QSFP/QSFP+/QSFP28 NIM + - Does not support datapath + - Does not support RTE flow API Removed Items ------------- diff --git a/drivers/net/meson.build b/drivers/net/meson.build index bd38b533c5..fb6d34b782 100644 --- a/drivers/net/meson.build +++ b/drivers/net/meson.build @@ -45,6 +45,7 @@ drivers = [ 'nfb', 'nfp', 'ngbe', + 'ntnic', 'null', 'octeontx', 'octeon_ep', diff --git a/drivers/net/ntnic/meson.build b/drivers/net/ntnic/meson.build new file mode 100644 index 0000000000..194353230b --- /dev/null +++ b/drivers/net/ntnic/meson.build @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020-2023 Napatech A/S + +if not is_linux or not dpdk_conf.has('RTE_ARCH_X86_64') + build = false + reason = 'only supported on x86_64 Linux' + subdir_done() +endif + +# includes +includes = [ + include_directories('.'), +] + +# all sources +sources = files( + 'ntnic_ethdev.c', +) diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c new file mode 100644 index 0000000000..7e5231d2c1 --- /dev/null +++ b/drivers/net/ntnic/ntnic_ethdev.c @@ -0,0 +1,49 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#include +#include +#include + +static const struct rte_pci_id nthw_pci_id_map[] = { + { + .vendor_id = 0, + }, /* sentinel */ +}; + +static int +nthw_pci_dev_init(struct rte_pci_device *pci_dev __rte_unused) +{ + return 0; +} + +static int +nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused) +{ + return 0; +} + +static int +nthw_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, + struct rte_pci_device *pci_dev) +{ + int ret; + ret = nthw_pci_dev_init(pci_dev); + return ret; +} + +static int +nthw_pci_remove(struct rte_pci_device *pci_dev) +{ + return rte_eth_dev_pci_generic_remove(pci_dev, nthw_pci_dev_deinit); +} + +static struct rte_pci_driver rte_nthw_pmd = { + .id_table = nthw_pci_id_map, + .probe = nthw_pci_probe, + .remove = nthw_pci_remove, +}; + +RTE_PMD_REGISTER_PCI(net_ntnic, rte_nthw_pmd); -- 2.45.0