1.. SPDX-License-Identifier: BSD-3-Clause 2 Copyright(c) 2024 Napatech A/S 3 4NTNIC Poll Mode Driver 5====================== 6 7The NTNIC PMD provides poll mode driver support for Napatech smartNICs. 8 9 10Design 11------ 12 13The NTNIC PMD is designed as a pure user-space driver, 14and requires no special Napatech kernel modules. 15 16The Napatech smartNIC presents one control PCI device (PF0). 17NTNIC PMD accesses smartNIC PF0 via vfio-pci kernel driver. 18Access to PF0 for all purposes is exclusive, 19so only one process should access it. 20The physical ports are located behind PF0 as DPDK port 0 and 1. 21 22 23Supported NICs 24-------------- 25 26- NT200A02 2x100G SmartNIC 27 28 - FPGA ID 9563 (Inline Flow Management) 29 30All information about NT200A02 can be found by link below: 31https://www.napatech.com/products/nt200a02-smartnic-inline/ 32 33 34Features 35-------- 36 37- FW version 38- Speed capabilities 39- Link status (Link update only) 40- Unicast MAC filter 41- Multicast MAC filter 42- Promiscuous mode (Enable only. The device always run promiscuous mode) 43- Flow API support. 44- Support for multiple rte_flow groups. 45- Multiple TX and RX queues. 46- Scattered and gather for TX and RX. 47- Jumbo frame support. 48- Traffic mirroring. 49- VLAN filtering. 50- Packet modification: NAT, TTL decrement, DSCP tagging 51- Tunnel types: GTP. 52- Encapsulation and decapsulation of GTP data. 53- RX VLAN stripping via raw decap. 54- TX VLAN insertion via raw encap. 55- CAM and TCAM based matching. 56- Exact match of 140 million flows and policies. 57- Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification. 58- RSS hash 59- RSS key update 60- RSS based on VLAN or 5-tuple. 61- RSS using different combinations of fields: L3 only, L4 only or both, 62 and source only, destination only or both. 63- Several RSS hash keys, one for each flow type. 64- Default RSS operation with no hash key specification. 65- Port and queue statistics. 66- RMON statistics in extended stats. 67- Link state information. 68- Flow statistics 69- Flow aging support 70- Flow metering, including meter policy API. 71- Flow update. Update of the action list for specific flow 72- Asynchronous flow support 73- MTU update 74 75Limitations 76~~~~~~~~~~~ 77 78Linux kernel versions before 5.7 are not supported. 79Kernel version 5.7 added vfio-pci support for creating VFs from the PF 80which is required for the PMD to use vfio-pci on the PF. 81This support has been back-ported to older Linux distributions 82and they are also supported. 83If vfio-pci is not required, kernel version 4.18 is supported. 84 85 86Configuration 87------------- 88 89Command line arguments 90~~~~~~~~~~~~~~~~~~~~~~ 91 92Following standard DPDK command line arguments are used by the PMD: 93 94``-a`` 95 Used to specifically define the NT adapter by PCI ID. 96 97``--iova-mode`` 98 Must be set to ``pa`` for Physical Address mode. 99 100NTNIC specific arguments can be passed to the PMD in the PCI device parameter list:: 101 102 <application> ... -a 0000:03:00.0[{,<NTNIC specific argument>}] 103 104The NTNIC specific argument format is:: 105 106 <object>.<attribute>=[<object-ids>:]<value> 107 108Multiple arguments for the same device are separated by ‘,’ comma. 109<object-ids> can be a single value or a range. 110 111``rxqs`` parameter [int] 112 113 Specify number of Rx queues to use:: 114 115 -a <domain>:<bus>:00.0,rxqs=4,txqs=4 116 117 By default, the value is set to 1. 118 119``txqs`` parameter [int] 120 121 Specify number of Tx queues to use:: 122 123 -a <domain>:<bus>:00.0,rxqs=4,txqs=4 124 125 By default, the value is set to 1. 126 127 128Logging and Debugging 129--------------------- 130 131NTNIC supports several groups of logging 132that can be enabled with ``--log-level`` parameter: 133 134NTNIC 135 Logging info from the main PMD code. i.e. code that is related to DPDK:: 136 137 --log-level=pmd.net.ntnic.ntnic,8 138 139NTHW 140 Logging info from NTHW. i.e. code that is related to the FPGA and the adapter:: 141 142 --log-level=pmd.net.ntnic.nthw,8 143 144FILTER 145 Logging info from filter. i.e. code that is related to the binary filter:: 146 147 --log-level=pmd.net.ntnic.filter,8 148 149To enable logging on all levels use wildcard in the following way:: 150 151 --log-level=pmd.net.ntnic.*,8 152 153Flow Scanner 154------------ 155 156Flow Scanner is DPDK mechanism that constantly and periodically scans 157the flow tables to check for aged-out flows. 158When flow timeout is reached, 159i.e. no packets were matched by the flow within timeout period, 160``RTE_ETH_EVENT_FLOW_AGED`` event is reported, and flow is marked as aged-out. 161 162Therefore, flow scanner functionality is closely connected to the flows' age action. 163 164There are list of characteristics that age timeout action has: 165 166- functions only in group > 0; 167- flow timeout is specified in seconds; 168- flow scanner checks flows age timeout once in 1-480 seconds, 169 therefore, flows may not age-out immediately, 170 depending on how big are intervals of flow scanner mechanism checks; 171- aging counters can display maximum of **n - 1** aged flows 172 when aging counters are set to **n**; 173- overall 15 different timeouts can be specified for the flows at the same time 174 (note that this limit is combined for all actions, therefore, 175 15 different actions can be created at the same time, 176 maximum limit of 15 can be reached only across different groups - 177 when 5 flows with different timeouts are created per one group, 178 otherwise the limit within one group is 14 distinct flows); 179- after flow is aged-out it's not automatically deleted; 180- aged-out flow can be updated with ``flow update`` command, 181 and its aged-out status will be reverted; 182