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

Message ID 20240711120737.698176-1-sil-plv@napatech.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series [v6,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 11, 2024, 12:07 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
---
 .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
  

Comments

Ferruh Yigit July 11, 2024, 4:53 p.m. UTC | #1
On 7/11/2024 1:07 PM, Serhii Iliushyk wrote:
> +++ 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
>

These features are not enabled in this patch, can you please distribute
these updates to the patches that enables these features.
Same for feature list in ntnic.rst
  
Ferruh Yigit July 11, 2024, 4:54 p.m. UTC | #2
On 7/11/2024 1:07 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>
>

Hi Serhii,

I put a few minor comments.

What is the latest testing status of the driver, as it doesn't have
datapath support yet, I believe it is difficult to do functional testing.
To set the expectation right for the users, do you think does it make
sense to highlight this with some not in maintainers file update,
something like:
"Napatech ntnic - Experimental"


And can you please add a release notes update with the first, skeleton,
patch. You can give a little more detail about the status of the driver
there.
  

Patch

diff --git a/.mailmap b/.mailmap
index 6b396107d0..42c4d1473d 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1289,6 +1289,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 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 <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..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 <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);