1c5cfe765SSerhii Iliushyk.. SPDX-License-Identifier: BSD-3-Clause 2c5cfe765SSerhii Iliushyk Copyright(c) 2024 Napatech A/S 3c5cfe765SSerhii Iliushyk 4c5cfe765SSerhii IliushykNTNIC Poll Mode Driver 5c5cfe765SSerhii Iliushyk====================== 6c5cfe765SSerhii Iliushyk 7c5cfe765SSerhii IliushykThe NTNIC PMD provides poll mode driver support for Napatech smartNICs. 8c5cfe765SSerhii Iliushyk 9c5cfe765SSerhii Iliushyk 10c5cfe765SSerhii IliushykDesign 11c5cfe765SSerhii Iliushyk------ 12c5cfe765SSerhii Iliushyk 13c5cfe765SSerhii IliushykThe NTNIC PMD is designed as a pure user-space driver, 14c5cfe765SSerhii Iliushykand requires no special Napatech kernel modules. 15c5cfe765SSerhii Iliushyk 16c5cfe765SSerhii IliushykThe Napatech smartNIC presents one control PCI device (PF0). 17c5cfe765SSerhii IliushykNTNIC PMD accesses smartNIC PF0 via vfio-pci kernel driver. 18c5cfe765SSerhii IliushykAccess to PF0 for all purposes is exclusive, 19c5cfe765SSerhii Iliushykso only one process should access it. 20c5cfe765SSerhii IliushykThe physical ports are located behind PF0 as DPDK port 0 and 1. 21c5cfe765SSerhii Iliushyk 22c5cfe765SSerhii Iliushyk 23c5cfe765SSerhii IliushykSupported NICs 24c5cfe765SSerhii Iliushyk-------------- 25c5cfe765SSerhii Iliushyk 26c5cfe765SSerhii Iliushyk- NT200A02 2x100G SmartNIC 27c5cfe765SSerhii Iliushyk 28c5cfe765SSerhii Iliushyk - FPGA ID 9563 (Inline Flow Management) 29c5cfe765SSerhii Iliushyk 30c5cfe765SSerhii IliushykAll information about NT200A02 can be found by link below: 31c5cfe765SSerhii Iliushykhttps://www.napatech.com/products/nt200a02-smartnic-inline/ 32c5cfe765SSerhii Iliushyk 339c2e6e75SDanylo Vodopianov 34ddf184d0SSerhii IliushykFeatures 35ddf184d0SSerhii Iliushyk-------- 36ddf184d0SSerhii Iliushyk 37ddf184d0SSerhii Iliushyk- FW version 389147e9f9SSerhii Iliushyk- Speed capabilities 399147e9f9SSerhii Iliushyk- Link status (Link update only) 409147e9f9SSerhii Iliushyk- Unicast MAC filter 419147e9f9SSerhii Iliushyk- Multicast MAC filter 429147e9f9SSerhii Iliushyk- Promiscuous mode (Enable only. The device always run promiscuous mode) 43e02fdb65SSerhii Iliushyk- Flow API support. 44e02fdb65SSerhii Iliushyk- Support for multiple rte_flow groups. 45b8890554SSerhii Iliushyk- Multiple TX and RX queues. 46b8890554SSerhii Iliushyk- Scattered and gather for TX and RX. 47b8890554SSerhii Iliushyk- Jumbo frame support. 48b8890554SSerhii Iliushyk- Traffic mirroring. 4956232827SDanylo Vodopianov- VLAN filtering. 50339ca124SDanylo Vodopianov- Packet modification: NAT, TTL decrement, DSCP tagging 51c6821abfSDanylo Vodopianov- Tunnel types: GTP. 52c6821abfSDanylo Vodopianov- Encapsulation and decapsulation of GTP data. 53c6821abfSDanylo Vodopianov- RX VLAN stripping via raw decap. 54c6821abfSDanylo Vodopianov- TX VLAN insertion via raw encap. 559bd46cf2SDanylo Vodopianov- CAM and TCAM based matching. 569bd46cf2SDanylo Vodopianov- Exact match of 140 million flows and policies. 577fa0bf29SDanylo Vodopianov- Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification. 588eed292bSSerhii Iliushyk- RSS hash 598eed292bSSerhii Iliushyk- RSS key update 608eed292bSSerhii Iliushyk- RSS based on VLAN or 5-tuple. 618eed292bSSerhii Iliushyk- RSS using different combinations of fields: L3 only, L4 only or both, 628eed292bSSerhii Iliushyk and source only, destination only or both. 638eed292bSSerhii Iliushyk- Several RSS hash keys, one for each flow type. 648eed292bSSerhii Iliushyk- Default RSS operation with no hash key specification. 65a1ba8c47SDanylo Vodopianov- Port and queue statistics. 66cf6007eaSDanylo Vodopianov- RMON statistics in extended stats. 67cf6007eaSDanylo Vodopianov- Link state information. 68e7e49ce6SDanylo Vodopianov- Flow statistics 69c0d44442SDanylo Vodopianov- Flow aging support 704033e053SDanylo Vodopianov- Flow metering, including meter policy API. 71dc52e60cSDanylo Vodopianov- Flow update. Update of the action list for specific flow 721042162dSDanylo Vodopianov- Asynchronous flow support 73*6019656dSOleksandr Kolomeiets- MTU update 74ddf184d0SSerhii Iliushyk 75c5cfe765SSerhii IliushykLimitations 76c5cfe765SSerhii Iliushyk~~~~~~~~~~~ 77c5cfe765SSerhii Iliushyk 78c5cfe765SSerhii IliushykLinux kernel versions before 5.7 are not supported. 79c5cfe765SSerhii IliushykKernel version 5.7 added vfio-pci support for creating VFs from the PF 80c5cfe765SSerhii Iliushykwhich is required for the PMD to use vfio-pci on the PF. 81c5cfe765SSerhii IliushykThis support has been back-ported to older Linux distributions 82c5cfe765SSerhii Iliushykand they are also supported. 83c5cfe765SSerhii IliushykIf vfio-pci is not required, kernel version 4.18 is supported. 843489b87bSDanylo Vodopianov 853489b87bSDanylo Vodopianov 869c2e6e75SDanylo VodopianovConfiguration 879c2e6e75SDanylo Vodopianov------------- 889c2e6e75SDanylo Vodopianov 899c2e6e75SDanylo VodopianovCommand line arguments 909c2e6e75SDanylo Vodopianov~~~~~~~~~~~~~~~~~~~~~~ 919c2e6e75SDanylo Vodopianov 929c2e6e75SDanylo VodopianovFollowing standard DPDK command line arguments are used by the PMD: 939c2e6e75SDanylo Vodopianov 949c2e6e75SDanylo Vodopianov``-a`` 959c2e6e75SDanylo Vodopianov Used to specifically define the NT adapter by PCI ID. 969c2e6e75SDanylo Vodopianov 979c2e6e75SDanylo Vodopianov``--iova-mode`` 989c2e6e75SDanylo Vodopianov Must be set to ``pa`` for Physical Address mode. 999c2e6e75SDanylo Vodopianov 1009c2e6e75SDanylo VodopianovNTNIC specific arguments can be passed to the PMD in the PCI device parameter list:: 1019c2e6e75SDanylo Vodopianov 1029c2e6e75SDanylo Vodopianov <application> ... -a 0000:03:00.0[{,<NTNIC specific argument>}] 1039c2e6e75SDanylo Vodopianov 1049c2e6e75SDanylo VodopianovThe NTNIC specific argument format is:: 1059c2e6e75SDanylo Vodopianov 1069c2e6e75SDanylo Vodopianov <object>.<attribute>=[<object-ids>:]<value> 1079c2e6e75SDanylo Vodopianov 1089c2e6e75SDanylo VodopianovMultiple arguments for the same device are separated by ‘,’ comma. 1099c2e6e75SDanylo Vodopianov<object-ids> can be a single value or a range. 1109c2e6e75SDanylo Vodopianov 1119c2e6e75SDanylo Vodopianov``rxqs`` parameter [int] 1129c2e6e75SDanylo Vodopianov 1139c2e6e75SDanylo Vodopianov Specify number of Rx queues to use:: 1149c2e6e75SDanylo Vodopianov 1159c2e6e75SDanylo Vodopianov -a <domain>:<bus>:00.0,rxqs=4,txqs=4 1169c2e6e75SDanylo Vodopianov 1179c2e6e75SDanylo Vodopianov By default, the value is set to 1. 1189c2e6e75SDanylo Vodopianov 1199c2e6e75SDanylo Vodopianov``txqs`` parameter [int] 1209c2e6e75SDanylo Vodopianov 1219c2e6e75SDanylo Vodopianov Specify number of Tx queues to use:: 1229c2e6e75SDanylo Vodopianov 1239c2e6e75SDanylo Vodopianov -a <domain>:<bus>:00.0,rxqs=4,txqs=4 1249c2e6e75SDanylo Vodopianov 1259c2e6e75SDanylo Vodopianov By default, the value is set to 1. 1269c2e6e75SDanylo Vodopianov 1279c2e6e75SDanylo Vodopianov 1283489b87bSDanylo VodopianovLogging and Debugging 1293489b87bSDanylo Vodopianov--------------------- 1303489b87bSDanylo Vodopianov 1313489b87bSDanylo VodopianovNTNIC supports several groups of logging 1323489b87bSDanylo Vodopianovthat can be enabled with ``--log-level`` parameter: 1333489b87bSDanylo Vodopianov 1343489b87bSDanylo VodopianovNTNIC 1353489b87bSDanylo Vodopianov Logging info from the main PMD code. i.e. code that is related to DPDK:: 1363489b87bSDanylo Vodopianov 1373489b87bSDanylo Vodopianov --log-level=pmd.net.ntnic.ntnic,8 1383489b87bSDanylo Vodopianov 1393489b87bSDanylo VodopianovNTHW 1403489b87bSDanylo Vodopianov Logging info from NTHW. i.e. code that is related to the FPGA and the adapter:: 1413489b87bSDanylo Vodopianov 1423489b87bSDanylo Vodopianov --log-level=pmd.net.ntnic.nthw,8 1433489b87bSDanylo Vodopianov 1443489b87bSDanylo VodopianovFILTER 1453489b87bSDanylo Vodopianov Logging info from filter. i.e. code that is related to the binary filter:: 1463489b87bSDanylo Vodopianov 1473489b87bSDanylo Vodopianov --log-level=pmd.net.ntnic.filter,8 1483489b87bSDanylo Vodopianov 1493489b87bSDanylo VodopianovTo enable logging on all levels use wildcard in the following way:: 1503489b87bSDanylo Vodopianov 1513489b87bSDanylo Vodopianov --log-level=pmd.net.ntnic.*,8 152c0d44442SDanylo Vodopianov 153c0d44442SDanylo VodopianovFlow Scanner 154c0d44442SDanylo Vodopianov------------ 155c0d44442SDanylo Vodopianov 156c0d44442SDanylo VodopianovFlow Scanner is DPDK mechanism that constantly and periodically scans 157c0d44442SDanylo Vodopianovthe flow tables to check for aged-out flows. 158c0d44442SDanylo VodopianovWhen flow timeout is reached, 159c0d44442SDanylo Vodopianovi.e. no packets were matched by the flow within timeout period, 160c0d44442SDanylo Vodopianov``RTE_ETH_EVENT_FLOW_AGED`` event is reported, and flow is marked as aged-out. 161c0d44442SDanylo Vodopianov 162c0d44442SDanylo VodopianovTherefore, flow scanner functionality is closely connected to the flows' age action. 163c0d44442SDanylo Vodopianov 164c0d44442SDanylo VodopianovThere are list of characteristics that age timeout action has: 165c0d44442SDanylo Vodopianov 166c0d44442SDanylo Vodopianov- functions only in group > 0; 167c0d44442SDanylo Vodopianov- flow timeout is specified in seconds; 168c0d44442SDanylo Vodopianov- flow scanner checks flows age timeout once in 1-480 seconds, 169c0d44442SDanylo Vodopianov therefore, flows may not age-out immediately, 170c0d44442SDanylo Vodopianov depending on how big are intervals of flow scanner mechanism checks; 171c0d44442SDanylo Vodopianov- aging counters can display maximum of **n - 1** aged flows 172c0d44442SDanylo Vodopianov when aging counters are set to **n**; 173c0d44442SDanylo Vodopianov- overall 15 different timeouts can be specified for the flows at the same time 174c0d44442SDanylo Vodopianov (note that this limit is combined for all actions, therefore, 175c0d44442SDanylo Vodopianov 15 different actions can be created at the same time, 176c0d44442SDanylo Vodopianov maximum limit of 15 can be reached only across different groups - 177c0d44442SDanylo Vodopianov when 5 flows with different timeouts are created per one group, 178c0d44442SDanylo Vodopianov otherwise the limit within one group is 14 distinct flows); 179c0d44442SDanylo Vodopianov- after flow is aged-out it's not automatically deleted; 180c0d44442SDanylo Vodopianov- aged-out flow can be updated with ``flow update`` command, 181c0d44442SDanylo Vodopianov and its aged-out status will be reverted; 182