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 A88AC455F3; Thu, 11 Jul 2024 14:08:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 935E142E64; Thu, 11 Jul 2024 14:07:53 +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 6957542DD9 for ; Thu, 11 Jul 2024 14:07:48 +0200 (CEST) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02lp2104.outbound.protection.outlook.com [104.47.11.104]) by mx-outbound13-152.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 11 Jul 2024 12:07:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s8MiFNfWgBtP+YaattoUqjzY7Mroi03ICihnZQ43AdE9CAOOzZ8x9bdxQKc5rKulr1VfeaQoP6QMmZbJb1i0ZdI0+K9LEnWQnhSF+cpmszlxm09vfdVorXps1dbs+a3k6gV5+a7UiYQ/0Gtp2kzKApKhTcXJ+JFaIv0SFyxkx3f7h0jR9RinOETpJSd7Hc+9P3mco9IqqPbTXwCPK8lKmv4ZSfMp6V1UZ5W7K3AGfQi91zyv5FPlxWvbgLXOXVwPV8l3OHB+GKIwiuNNx+dxZG57akAvRUyrsMz0L2twu77SEFrrfi7JO02QiGViO7RlV5pi4LN5nTneCgp/wO5hQA== 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=C6OCc8GQIBblHUK2wsNsPMvfg472Yak9GUctkvT+Qmo=; b=Ob8ls6xwh9tr9Q+YgotSLZb9O9HibsH43xzy6JaEfYrbz96OztC4vMUFrsVsKYDouaDVFOxstah8l0hMWiDwgK2QK/btEb+LGmzsat+itHbVVmLL1zdKTSCvCqCa29aq8I3SiqMpkrEodQgZgKDACkPKGghfTffwsNwO4ov4g0Ee10IV04dFxK0wMPSka1zAC7yAZXbLIDsRR9h9ogwGQtfnbzo4Wqkt9ULz0Txtg2DsjXY6wHTq6+c4mcunPDhBEmi7pX9kuaJONwyvwJzmbzfh0E5N+PdFqgZMp24CuLWlqymBxt/yX73NsvmmuuDmqJ52G5MwfM2QC3IUMCeSbA== 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=C6OCc8GQIBblHUK2wsNsPMvfg472Yak9GUctkvT+Qmo=; b=F2hrIdnUmPpVzcglvxIZFx7GYw2JVsBe1+3DvNDQJxgTi6sFXLLVLzoK8dfrXVPG2f/rMtHKspVRD8HvYO9E9KMyjN7rJjLChBQeIL+bw3k0slySqi1O+UjzvUBOFjXtk3p5kYGP+ARxAWyRy2rXDjFULgOMqlIo9mzKKXYOimY= Received: from AS9PR04CA0086.eurprd04.prod.outlook.com (2603:10a6:20b:50e::24) by AM7P190MB0744.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:11d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.22; Thu, 11 Jul 2024 12:07:44 +0000 Received: from AMS0EPF0000019F.eurprd05.prod.outlook.com (2603:10a6:20b:50e:cafe::a8) by AS9PR04CA0086.outlook.office365.com (2603:10a6:20b:50e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.20 via Frontend Transport; Thu, 11 Jul 2024 12:07:44 +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 AMS0EPF0000019F.mail.protection.outlook.com (10.167.16.251) with Microsoft SMTP Server id 15.20.7762.17 via Frontend Transport; Thu, 11 Jul 2024 12:07:41 +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 v6 01/21] net/ntnic: add ethdev and makes PMD available Date: Thu, 11 Jul 2024 14:07:12 +0200 Message-ID: <20240711120737.698176-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: AMS0EPF0000019F:EE_|AM7P190MB0744:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: db67839f-7e0b-4e9c-dccc-08dca1a210ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-asc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NGaqOA2Yyhd5lNx9YugM/?= =?us-ascii?Q?DO+ZMcw1yI0IgconxHIDEplRPw34BR6EI/RKwhBX2/0QgkvDmSgSyyJS658H?= =?us-ascii?Q?iJToImrEsKlyCtNbEqAyO8bPqvgqHgpTXM1a01miDHFX3bAF7QvScm9s5yFh?= =?us-ascii?Q?I96Wh0Fp5phsqwMiap+gvIXdPPrf0APTmCJTFAMuhagYo7eEfuR6DMoc9v8W?= =?us-ascii?Q?xmJ+JApM6vc6UVRS5eQD/ThWRaPBCpRPMqDhLUVGwSZckrewqsDvFJ4Pw/op?= =?us-ascii?Q?TyaM2Ntus91bKwZ9Em5zRJHR9sC0gJm8tA4Ba2Vl6rgn6mnSF/EHufWlNr1H?= =?us-ascii?Q?3nO1QQ9etFOR5Y7rwA9EkrQ21YchRhFgR/xSu5+BaaeYeMyD3b+cCFjjcDgZ?= =?us-ascii?Q?jrgYhaA4lxhFMW/8qGt8LPeBLsl6I0rSelHG9iy62ebUtDrnUqiaQAOouc6U?= =?us-ascii?Q?ySzz3VUlNCoVMC1UE4rNh+RA4Ff86nIStvy01RBChwg+KK7ZFRcUTzrgwiH1?= =?us-ascii?Q?P6lUyWt9Smjjf3Y4OMEIUEFTg9Cw?= 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)(1800799024)(36860700013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: YVVPaMwkztRzSLcBxEfRxw0jSbC3lu/5aZUCQouvBWIoCI6/xgcdPUswC7c4bNh/12oPjvmDRyX3D700tbGANXiyGzU2ZBUt5UGtvXwJGaII/zBueCkp2/e98f2/i+lWW688kEeEIu06NsW/MJ8yTk5cFF4NCNJBtB424EIYLVt+gg10nr1HnVEYQ79GL4zAbtiTb2V2Zc98FCkvd+qDhh8rj/ZyJrz6dLVPw7zRlpotoXXJptYb2bP6HdGBeYq0+O1Me6A+EnQ7YWYUinUudZ55txWznlaJxgo5DEGvZIXwBOY3ZSOQfT7OEsFgYkROiOY/Pzjwlv3QCLeKksithrf5uPMLHI24CjK09XU+ni6cNBXk2dXgr5lapce04cYM08I2GAblJyjCprfufl7elzsxRi8BVRh/JQ/34s8tfHCB1CLWis/FFfEuI4yh/msQvtTrqU3EJqUiTgI+nx639WeS1xaifZLm3m5LN2/5hsN6hrSJY3ZogYmCFU1vb+v9jW6k9l+DFP4tA2g/nAT2GvBo0ZNjOA6UJTOTwu+vMSltKxZ7f/oU3mueaLaPb6nWSdfJSii3s6kHK1VuZ9x9EzJM5bIOOPHHNqNX8G5cW3NJwgrhUXYMYTCxtq/xkCrdl9BshGGKKdBBUvGJd6W8zODFJymhtPpzzb+5BE/gxz0= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2024 12:07:41.6659 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db67839f-7e0b-4e9c-dccc-08dca1a210ce 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: AMS0EPF0000019F.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7P190MB0744 X-BESS-ID: 1720699666-303480-31734-4179-1 X-BESS-VER: 2019.1_20240702.1505 X-BESS-Apparent-Source-IP: 104.47.11.104 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVmYWZiZAVgZQMC01xdwizcDSxN LC0NIo0dwy2STFwtAgLc3SIjU52ShVqTYWAFatZ59BAAAA X-BESS-Outbound-Spam-Score: 0.01 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.257551 [from cloudscan12-224.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.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.01 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_SC7_SG0146_1, 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 --- .mailmap | 1 + MAINTAINERS | 7 +++++ doc/guides/nics/features/ntnic.ini | 12 ++++++++ doc/guides/nics/index.rst | 1 + doc/guides/nics/ntnic.rst | 49 ++++++++++++++++++++++++++++++ drivers/net/meson.build | 1 + drivers/net/ntnic/meson.build | 18 +++++++++++ drivers/net/ntnic/ntnic_ethdev.c | 49 ++++++++++++++++++++++++++++++ 8 files changed, 138 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..878b6db02b --- /dev/null +++ b/doc/guides/nics/features/ntnic.ini @@ -0,0 +1,12 @@ +; +; Supported features of the 'ntnic' network poll mode driver. +; +; Refer to default.ini for the full list of available PMD features. +; +[Features] +Speed capabilities = Y +FW version = Y +Unicast MAC filter = Y +Multicast MAC filter = 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..25c74730fe --- /dev/null +++ b/doc/guides/nics/ntnic.rst @@ -0,0 +1,49 @@ +.. 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/ + +Features +-------- + +- FW version +- Speed capabilities +- Link status (Link update only) +- Unicast MAC filter +- Multicast MAC filter +- Promiscuous mode (Enable only. The device always run promiscuous mode) + +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..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