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 C632145509; Thu, 27 Jun 2024 09:39:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F1D2D40B8D; Thu, 27 Jun 2024 09:39:31 +0200 (CEST) Received: from egress-ip42a.ess.de.barracuda.com (egress-ip42a.ess.de.barracuda.com [18.185.115.201]) by mails.dpdk.org (Postfix) with ESMTP id DA7B5406A2 for ; Thu, 27 Jun 2024 09:39:28 +0200 (CEST) Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02lp2234.outbound.protection.outlook.com [104.47.11.234]) by mx-outbound11-228.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 27 Jun 2024 07:39:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JXEqveMJpApRgpee4l6lDqrZwFqoBirZgR3eZGBj3DoVi/dMy0KmQNHCGruRv+GQnubl9n5JYTONkbFhwtAeA9Sb43jYWOfwCVrwt6M05aICZSn7Yt/peXy+0tKvY1bAWC1oK9V9c0Fes64c1A3rPAdqtRoMWdxWV/OOZ0zS79YwCt104aEc9qsvkNw6G7b3+LKOOFamsGNFjcEvOe5IGyA/Ee9O3yxcSZVAy2dWWvU5B1vZbp3+QTZMs/J+CQr1czMJ7Z9eth21LAHmkGqDEM1v5ssD1kNfTcKQU0Pbt5HomZv7iRb5fIodpdEaokaHeSmb1cPyLh6Fk9YJLZ5osw== 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=ThSrVmhBwsxLGmvwxsgv9y4dm0nmf3KA6noYAhnGXoE=; b=KBogKVSZXZRl8yg9PcCWDhDjNWSPctZCvdjFUTsCab/FqHyvUtDeVyKK3z15XPXQVy42/5LEQX5mcFQ9cs1fwheY0JJY9gPeHUfC5QhQGT+TBlmHhf8VZXWgJdvP6Czgriw5TbusYWlH+bqFf18SjUilTG3rBypLbn50w+U3OIXh/z83nrRSLpuIbneyBqMvXBZZFIZZZ0kSA0GevToJzb2INoapOXsMuAbfJ/e7YHjL8lT3ezGmxejrWwEc91ZiEkXrU6zUB+SwakDKO6vRIx/TqjuHOtgZcLYBAnHUmE2fIIGoAp3faajk555szQgBzI5xkfNLZmJ5VZlG99pszQ== 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=ThSrVmhBwsxLGmvwxsgv9y4dm0nmf3KA6noYAhnGXoE=; b=WOHewzQMtr4lTPWUIXjnw1Alwy5/7IU/bJcxaUjror4v9bhO1XEtVOfqCvbiQrL1LF4VQgjyS81Lm/2uDTeJJTPzltax0EHI6XysFc7ZYPIeiF+fu3/UnAcGk0jayYgnMukfzvXvWXdC7cxhoHoKcEVdLEhBMlKOlEgxrVwBr0Y= Received: from DUZPR01CA0334.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b8::25) by VE1P190MB0814.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:1ac::16) 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:22 +0000 Received: from DB1PEPF000509E2.eurprd03.prod.outlook.com (2603:10a6:10:4b8:cafe::59) by DUZPR01CA0334.outlook.office365.com (2603:10a6:10:4b8::25) 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:22 +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:21 +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 v5 01/23] net/ntnic: add ethdev and makes PMD available Date: Thu, 27 Jun 2024 09:38:42 +0200 Message-ID: <20240627073918.2039719-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: DB1PEPF000509E2:EE_|VE1P190MB0814:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 43c8f742-9cb8-4bd6-835d-08dc967c42ef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info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xxs68H0bELoC6x2cqBSdoJn3sxn87t76fQ?= =?us-ascii?Q?CNXWYNpNsMHvqMPcsNv79gZjdkOu4KTdh3UZo4zO1cDyKzThAOFv83HCxff9?= =?us-ascii?Q?+KdtOfo0J/6QAXbsL6nSprjop+xNLizSzf+CkUj7gOVkEGMUGHzrKxQM3cq1?= =?us-ascii?Q?LadwKNNcw6VVJYYVw/qRuIXClWLn1xEIwT+XyTAPkzUbjNCi2VrUcqoqB9dC?= =?us-ascii?Q?pDikTNGiywgxdudmO6hmjNSKPKYLHro1WoqQ/ssChfEUL9FgzPn/nvFpKUvL?= =?us-ascii?Q?Dh6oM1zoPojZNo9H3pYUcymRyZoGj3/JvzUT7eSqzlQ63yU4ba6F3ZL6H5Cx?= =?us-ascii?Q?HM0SQa7A5+rA82SptdsJPVOrPejZ1UVfvGwPFCoKxXfb/MN0kPa7cFfOKxMo?= =?us-ascii?Q?Bm3S7CUVPZroWpejPkqK0mqObNYO2iuDdUfinG7lQdTAEq1HxJtXmIZQBoE8?= =?us-ascii?Q?y3iXmFiqkkC5Zy7OkLLLucHTYPo0hdCsyY/BRFogxMHn55ySlpkoUEeTNSf1?= =?us-ascii?Q?Tg3mjdLlGZVGvsF94zrskHOK2lpXFMa6r1UAWKjtMlbY8h3RojrMh/qJ0LRO?= =?us-ascii?Q?TqBWERUBD7A7PFonAbd7N9aZPPXG8dOR?= 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)(1800799024)(36860700013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: vZHPVLmbz9mRQgvP2850RpLQRRuRFAjDgi9nh1l2vo4NWt5p5r4OAzZrkm/YWVXUhwrWvbYUt3hxFEnoHC2B5Wu12tDKYDYXJ1X8hcF4QDXQfGn8p9ipTmAKGDA8EgK8mClLfmrVqEbuGWFFo1MerOu0S3oyzdLxB/mdrGMtpu8sO5q07GwbIQd5lVCu1B8wfJ8kO+LQXMjUvhWHEewcQXQ7MRH/BIol85L9rAjXbSHKK3YHsBrtb0t4WVJrCcbYC89CLNj9vm/NjusOHThXIt28e6hTn4JHnOMWp/Hqp9laDHi+LvHYAM5PSQObWcVLvjng8DezFmTdO58NIS9wkDotDNIVgsCtwmhuhWj2m3sE77DC7dOyroCxFG9/KNUNfuE9TF6O0dBxmPEY6OGYCalPEHoEYoU/6Ltd+JA0iAKSScW0gdaqU9+W+XHymoo/NS1ntsRsPPjlzeBi7APtWv8y2OnXkHTcPRVvvQNDnVbh9iSg755j3k2n7UfoRVxoHq035nZRIlw96n7xkXoU01eTLjUfXBGy8K8r/MAj835fqdVFnlLoIo2ZQi+SvtadOLVJ0TNm037WMlqJlGWBMyqMHrubOXtrUkO0LG1TNGWkexOQOLRFxCmMjEfxb5dTGB+olvq8E3TdSABO3c/lfA== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 07:39:21.9746 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43c8f742-9cb8-4bd6-835d-08dc967c42ef 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: VE1P190MB0814 X-BESS-ID: 1719473967-303044-12649-2695-1 X-BESS-VER: 2019.1_20240620.2317 X-BESS-Apparent-Source-IP: 104.47.11.234 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVqaWxpZAVgZQ0MgyKc3YwjgtJd XM0iQl2cI0LS0pxTTVMtnCwtgk0SJRqTYWAG1auhZBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.257231 [from cloudscan14-6.eu-central-1a.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=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 ntnic ethdev base implementation Signed-off-by: Serhii Iliushyk --- .mailmap | 1 + MAINTAINERS | 7 ++++ doc/guides/nics/features/ntnic.ini | 9 +++++ doc/guides/nics/index.rst | 1 + doc/guides/nics/ntnic.rst | 43 ++++++++++++++++++++++++ drivers/net/meson.build | 1 + drivers/net/ntnic/meson.build | 24 ++++++++++++++ drivers/net/ntnic/ntnic_ethdev.c | 53 ++++++++++++++++++++++++++++++ 8 files changed, 139 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 6b396107d0..42c4d1473d 100644 --- a/.mailmap +++ b/.mailmap @@ -1289,6 +1289,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 c9adff9846..d640ff88b5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -857,6 +857,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..25abc6df89 --- /dev/null +++ b/doc/guides/nics/features/ntnic.ini @@ -0,0 +1,9 @@ +; +; Supported features of the 'ntnic' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Link status = Y +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..68996eac35 --- /dev/null +++ b/doc/guides/nics/ntnic.rst @@ -0,0 +1,43 @@ +.. 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) + + +Features +-------- + +- Link state information. + + +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/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..227949eacb --- /dev/null +++ b/drivers/net/ntnic/meson.build @@ -0,0 +1,24 @@ +# 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 + +# cflags +cflags += [ + '-std=c11', +] + +# includes +includes = [ + include_directories('.'), +] + +# all sources +sources = files( + 'ntnic_ethdev.c', +) +# END diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c new file mode 100644 index 0000000000..9cc727ac4b --- /dev/null +++ b/drivers/net/ntnic/ntnic_ethdev.c @@ -0,0 +1,53 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + + +#include +#include +#include +#include +#include +#include +#include + +/* Global static variables: */ + +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 res; + res = nthw_pci_dev_init(pci_dev); + return res; +} + +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 = { + .driver = { + .name = "net_ntnic", + }, + + .probe = nthw_pci_probe, + .remove = nthw_pci_remove, +}; + +RTE_PMD_REGISTER_PCI(net_ntnic, rte_nthw_pmd); -- 2.45.0