Add initial ntnic ethdev skeleton and register PCI probe functions Update documentation: Device description and feature list
Signed-off-by: Serhii Iliushyk <sil-...@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 diff --git a/.mailmap b/.mailmap index 6b396107d0..42c4d1473d 100644 --- a/.mailmap +++ b/.mailmap @@ -1289,6 +1289,7 @@ Sergey Madaminov <sergey.madami...@gmail.com> Sergey Mironov <grr...@gmail.com> Sergey Temerkhanov <sergey.temerkha...@intel.com> Sergio Gonzalez Monroy <sergio.gonzalez.mon...@intel.com> +Serhii Iliushyk <sil-...@napatech.com> Seth Arnold <seth.arn...@canonical.com> Seth Howell <seth.how...@intel.com> Shachar Beiser <shacha...@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 <c...@napatech.com> +M: Serhii Iliushyk <sil-...@napatech.com> +F: drivers/net/ntnic/ +F: doc/guides/nics/ntnic.rst +F: doc/guides/nics/features/ntnic.ini + NVIDIA mlx4 M: Matan Azrad <ma...@nvidia.com> M: Viacheslav Ovsiienko <viachesl...@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); -- 2.45.0