[v9,01/21] net/ntnic: add ethdev and makes PMD available

Message ID 20240716120216.3032484-1-sil-plv@napatech.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series [v9,01/21] net/ntnic: add ethdev and makes PMD available |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Serhii Iliushyk July 16, 2024, 12:01 p.m. UTC
Add initial ntnic ethdev skeleton and register PCI probe functions
Update documentation: Device description and feature list

Signed-off-by: Serhii Iliushyk <sil-plv@napatech.com>
---
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
v9
* Marked driver features as Experimantal
---
 .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
  

Comments

Ferruh Yigit July 16, 2024, 5:33 p.m. UTC | #1
On 7/16/2024 1:01 PM, Serhii Iliushyk wrote:
> Add initial ntnic ethdev skeleton and register PCI probe functions
> Update documentation: Device description and feature list
> 
> Signed-off-by: Serhii Iliushyk <sil-plv@napatech.com>
> ---
> 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
> v9
> * Marked driver features as Experimantal
>

Hi Serhii,

Driver is almost there, I put minor comments to a few patches, but
mainly I recognized './devtools/check-meson.py' is giving some warnings,
can you please check them?

Probably not required to reminder but instead of fixing meson issues as
separate commit, please fix issues where they are introduced at first place.
  

Patch

diff --git a/.mailmap b/.mailmap
index 3f3f0442e5..ee567cf16e 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1321,6 +1321,7 @@  Sergey Madaminov <sergey.madaminov@gmail.com>
 Sergey Mironov <grrwlf@gmail.com>
 Sergey Temerkhanov <sergey.temerkhanov@intel.com>
 Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
+Serhii Iliushyk <sil-plv@napatech.com>
 Seth Arnold <seth.arnold@canonical.com>
 Seth Howell <seth.howell@intel.com>
 Shachar Beiser <shacharbe@mellanox.com>
diff --git a/MAINTAINERS b/MAINTAINERS
index c71ca2a28e..3e6bf0f8ae 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -856,6 +856,13 @@  F: drivers/net/octeon_ep/
 F: doc/guides/nics/features/octeon_ep.ini
 F: doc/guides/nics/octeon_ep.rst
 
+Napatech ntnic - EXPERIMENTAL
+M: Christian Koue Muf <ckm@napatech.com>
+M: Serhii Iliushyk <sil-plv@napatech.com>
+F: drivers/net/ntnic/
+F: doc/guides/nics/ntnic.rst
+F: doc/guides/nics/features/ntnic.ini
+
 NVIDIA mlx4
 M: Matan Azrad <matan@nvidia.com>
 M: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
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..b150fe1481
--- /dev/null
+++ b/doc/guides/nics/ntnic.rst
@@ -0,0 +1,39 @@ 
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2024 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 cd4219efd2..058609b0f3 100644
--- a/doc/guides/rel_notes/release_24_07.rst
+++ b/doc/guides/rel_notes/release_24_07.rst
@@ -104,6 +104,16 @@  New Features
 
   * Updated base code with E610 device family support.
 
+* **Added Napatech ntnic net driver [EXPERIMENTAL].**
+
+  * Added the PMD driver for Napatech smartNIC
+
+    - 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
+
 * **Updated Marvell cnxk net driver.**
 
   * Added support disabling custom meta aura
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 <rte_ethdev.h>
+#include <rte_bus_pci.h>
+#include <ethdev_pci.h>
+
+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);