[PATCH v5 01/23] net/ntnic: add ethdev and makes PMD available
Serhii Iliushyk
sil-plv at napatech.com
Thu Jun 27 09:38:42 CEST 2024
Add ntnic ethdev base implementation
Signed-off-by: Serhii Iliushyk <sil-plv at napatech.com>
---
.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.madaminov at gmail.com>
Sergey Mironov <grrwlf at gmail.com>
Sergey Temerkhanov <sergey.temerkhanov at intel.com>
Sergio Gonzalez Monroy <sergio.gonzalez.monroy at intel.com>
+Serhii Iliushyk <sil-plv at napatech.com>
Seth Arnold <seth.arnold at canonical.com>
Seth Howell <seth.howell at intel.com>
Shachar Beiser <shacharbe at 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 at napatech.com>
+M: Serhii Iliushyk <sil-plv at 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 at nvidia.com>
M: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
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 <rte_kvargs.h>
+#include <rte_eal.h>
+#include <rte_dev.h>
+#include <rte_vfio.h>
+#include <rte_ethdev.h>
+#include <rte_bus_pci.h>
+#include <ethdev_pci.h>
+
+/* 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
More information about the dev
mailing list