.. SPDX-License-Identifier: Marvell-MIT Copyright (c) 2024 Marvell. ****************************** Universal SmartNIC Turnkey App ****************************** Introduction ============ Universal Smart NIC app is a powerful tool that harnesses the performance and efficiency of hardware accelerators in DPUs. It also mitigates some hardware gaps by providing optimized software solution for advanced features like as port hair pinning, tunnel-transport, port hotplugging, etc. .. figure:: ./img/smart-nic.png Port hairpinning facilitates packet routing between Ethernet MAC, PCI endpoint port, and network function virtualization (NFVs). With this feature NFV service chaining can be achieved. Port hotplugging refers to dynamically adding or removing network ports from a virtual or host machine without requiring the VM or host machine to be powered off or restarted. In demanding situations, administrators can hotplug additional network ports to meet the high traffic flow without affecting other VMs operations. Feature List ------------ Its adaptability ensures seamless integration and enhanced functionality. Completed ````````` * Rich command line interface (CLI) with telnet support * Port hairpininng Planned ``````` * 100Gbps virtio * MAC Learning * Network function service chaining. Pending ``````` * Port hotplugging * 200Gbs IPsec * SA sharing between CPT and SW * IPsec strong swan integration * virtio block support for storage * tunnel-transport * Pre-fragmentation, post fragmentation * Full back pressure support in all Traffic directions * PFC support on RPM * support for virtio queues Getting the sources and compile =============================== Smart NIC app is part of the ``DAO`` package and follow :doc:`steps to build DAO <../gsg/build>` Binding required devices ------------------------ Smart NIC app needs RPM and SDP ports for inter connectivity between host and outside network. Binding SDP and RPM VFs ``````````````````````` Check for device ID ``0xa0f7`` viz SDP VF and bind to vfio-pci .. code-block:: console # dpdk-devbind.py -s 0002:1f:00.1 'Octeon Tx2 SDP Virtual Function a0f7' if=sdp31-0 drv=rvu_nicvf unused=vfio-pci 0002:1f:00.2 'Octeon Tx2 SDP Virtual Function a0f7' if=sdp31-1 drv=rvu_nicvf unused=vfio-pci # dpdk-devbind.py -b vfio-pci 0002:1f:00.1 # dpdk-devbind.py -b vfio-pci 0002:1f:00.2 Create VFs, check for device ID ``0xa064`` viz RPM (NIX) VF and bind to vfio-pci .. code-block:: console # echo 2 > /sys/bus/pci/devices/0002\:02\:00.0/sriov_numvfs # dpdk-devbind.py -s 0002:02:00.1 'Octeon Tx2 RVU Virtual Function a064' if=eth1 drv=rvu_nicvf unused=vfio-pci 0002:02:00.2 'Octeon Tx2 RVU Virtual Function a064' if=eth5 drv=rvu_nicvf unused=vfio-pci # dpdk-devbind.py -b vfio-pci 0002:02:00.1 # dpdk-devbind.py -b vfio-pci 0002:02:00.2 Launching the application ========================= The application has a number of command line options which can be provided in following syntax: .. code-block:: console dao-smart-nic [EAL Options] -- [application options] Eg. dao-smart-nic [EAL options] -- -s -h BOARD IP -p port [--enable-graph-stats] Application Options ------------------- Following are the application command-line options: ``-h`` Board's IPv4 address which can be used to open telnet session. It is an optional parameter. Default host address is ``0.0.0.0``. ``-p`` Set the L4 port number over which telnet session can be opened. It is an optional parameter. Default port is ``8086``. ``-s`` Script name with absolute path which specifies the use case. It is a mandatory parameter which will be used to create desired graph for a given use case. Detailed command list provided below. ``--enable-graph-stats`` Enable graph statistics printing on console. By default, graph statistics are disabled. ``--help`` Dumps application usage. Example Commands ---------------- .. code-block:: console dao-smart-nic -c 0xf -a 0002:02:00.0 -a 0002:1f:00.1 -a 0002:1f:00.2 -- -s ./app/smart-nic/smart-nic.cli -h 127.0.0.1 -p 50000 --enable-graph-stats Supported CLI commands ---------------------- This section provides details on commands which can be used in ``.cli`` file to express the requested use case configuration. .. table:: Exposed CLIs :widths: auto +--------------------------------------+-----------------------------------+-------------------+----------+ | Command | Description | Scope | Optional | +======================================+===================================+===================+==========+ | | graph [bsz ] | | Command to express the desired | :ref:`1 ` | No | | | [tmo ] [coremask ] | | use case. Also enables/disable | | | | | model pcap_enable| | pcap capturing. | | | | | <0/1> num_pcap_pkts pcap_file| | | | | | | | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | graph start | | Command to start the graph. | :ref:`1 ` | No | | | | This command triggers that no | | | | | | more commands are left to be | | | | | | parsed and graph initialization | | | | | | can be started now. It must be | | | | | | the last command in usecase.cli | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | graph stats show | | Command to dump current graph | :ref:`2 ` | Yes | | | | statistics. | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | graph dump | | Command to dump current graph | :ref:`2 ` | Yes | | | | which includes nodes debug info | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | help graph | | Command to dump graph help | :ref:`2 ` | Yes | | | | message. | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | | mempool size | | Command to create mempool which | :ref:`1 ` | No | | | buffers | | will be further associated to | | | | | | | RxQ to dequeue the packets. | | | | | cache numa | | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | help mempool | | Command to dump mempool help | :ref:`2 ` | Yes | | | | message. | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | | ethdev rxq | | Command to create DPDK port with| :ref:`1 ` | No | | | txq | | given number of Rx and Tx queues| | | | | | . Also attach RxQ with given | | | | | | mempool. Each port can have | | | | | | single mempool only i.e. all | | | | | | RxQs will share the same mempool| | | | | | . | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | ethdev mtu | | Command to configure MTU of DPDK| :ref:`3 ` | Yes | | | | port. | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | | ethdev promiscuous | | Command to enable/disable | :ref:`3 ` | Yes | | | | | promiscuous mode on DPDK port. | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | ethdev show | | Command to dump current ethdev | :ref:`2 ` | Yes | | | | configuration. | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | ethdev stats | | Command to dump current ethdev | :ref:`2 ` | Yes | | | | statistics. | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | help ethdev | | Command to dump ethdev help | :ref:`2 ` | Yes | | | | message. | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | pipeline port add | | Command to add a port to the | :ref:`3 ` | Yes | | | | forwarding plane. | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | pipeline port del | | Command to remove a port from | :ref:`3 ` | Yes | | | | forwarding plane | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | | pipeline port link | | Command to plumb two ports to | :ref:`3 ` | Yes | | | | | enable packet routing between | | | | | | them. | | | +--------------------------------------+-----------------------------------+-------------------+----------+ | | pipeline port unlink | | Command to remove plumbing | :ref:`3 ` | Yes | | | | | between given ports and hence | | | | | | terminating the packet flow. | | | +--------------------------------------+-----------------------------------+-------------------+----------+ .. _scopes: 1. Script only 2. Telnet only 3. Script and telnet both Runtime configuration --------------------- Application allows some configuration to be modified at runtime using a telnet session. Application initiates a telnet server with host address ``0.0.0.0`` and port number ``8086`` by default. If user passes ``-h`` and ``-p`` options while running application, then corresponding IP address and port number will be used for telnet session. After successful launch of application, client can connect to application using given host & port and console will be accessed with prompt ``graph>``. Command to access a telnet session: .. code-block:: console telnet Example: ``dao-smart-nic`` is started with ``-h 127.0.0.1`` and ``-p 50000`` then .. code-block:: console ~# telnet 127.0.0.1 50000 Connected to 127.0.0.1 Welcome! smart-nic> help ethdev ----------------------------- ethdev command help ----------------------------- ethdev rxq txq ethdev promiscuous ethdev mtu ethdev stats ethdev show smart-nic> help pipeline ---------------------------- pipeline command help ---------------------------- pipeline port add pipeline port del pipeline port link pipeline port unlink smart-nic> To exit the telnet session, type ``Ctrl + ]``. This changes the ``graph>`` command prompt to ``telnet>`` command prompt. Now running ``close`` or ``quit`` command on ``telnet>`` prompt will terminate the telnet session. Application running demo ------------------------ .. raw:: html :file: ../_static/demo/run.html