1565829dbSWei Hu (Xavier).. SPDX-License-Identifier: BSD-3-Clause 2be1650f7SMin Hu (Connor) Copyright(c) 2018-2019 HiSilicon Limited. 3565829dbSWei Hu (Xavier) 4565829dbSWei Hu (Xavier)HNS3 Poll Mode Driver 5565829dbSWei Hu (Xavier)=============================== 6565829dbSWei Hu (Xavier) 78809f78cSBruce RichardsonThe hns3 PMD (**librte_net_hns3**) provides poll mode driver support 8be1650f7SMin Hu (Connor)for the inbuilt HiSilicon Network Subsystem(HNS) network engine 93f1436d7SJie Haifound in the HiSilicon Kunpeng 920 SoC (HIP08) and Kunpeng 930 SoC (HIP09/HIP10). 10565829dbSWei Hu (Xavier) 11565829dbSWei Hu (Xavier)Features 12565829dbSWei Hu (Xavier)-------- 13565829dbSWei Hu (Xavier) 14565829dbSWei Hu (Xavier)Features of the HNS3 PMD are: 15565829dbSWei Hu (Xavier) 16565829dbSWei Hu (Xavier)- Multiple queues for TX and RX 17565829dbSWei Hu (Xavier)- Receive Side Scaling (RSS) 18565829dbSWei Hu (Xavier)- Packet type information 19565829dbSWei Hu (Xavier)- Checksum offload 206dca716cSHongbo Zheng- TSO offload 211f295c40SWei Hu (Xavier)- LRO offload 22565829dbSWei Hu (Xavier)- Promiscuous mode 23565829dbSWei Hu (Xavier)- Multicast mode 24565829dbSWei Hu (Xavier)- Port hardware statistics 25565829dbSWei Hu (Xavier)- Jumbo frames 26565829dbSWei Hu (Xavier)- Link state information 2702a7b556SHao Chen- Interrupt mode for RX 2853b9f2b9SLijun Ou- VLAN stripping and inserting 2953b9f2b9SLijun Ou- QinQ inserting 3053b9f2b9SLijun Ou- DCB 3153b9f2b9SLijun Ou- Scattered and gather for TX and RX 3245bf45a8SLijun Ou- Vector Poll mode driver 3353b9f2b9SLijun Ou- SR-IOV VF 3453b9f2b9SLijun Ou- Multi-process 3553b9f2b9SLijun Ou- MAC/VLAN filter 3653b9f2b9SLijun Ou- MTU update 37565829dbSWei Hu (Xavier)- NUMA support 3845bf45a8SLijun Ou- Generic flow API 3938b539d9SMin Hu (Connor)- IEEE1588/802.1AS timestamping 4097d443f7SHuisong Li- Basic stats 4197d443f7SHuisong Li- Extended stats 4297d443f7SHuisong Li- Traffic Management API 4397d443f7SHuisong Li- Speed capabilities 4497d443f7SHuisong Li- Link Auto-negotiation 4597d443f7SHuisong Li- Link flow control 4697d443f7SHuisong Li- Dump register 4797d443f7SHuisong Li- Dump private info from device 4897d443f7SHuisong Li- FW version 49565829dbSWei Hu (Xavier) 50565829dbSWei Hu (Xavier)Prerequisites 51565829dbSWei Hu (Xavier)------------- 52565829dbSWei Hu (Xavier)- Get the information about Kunpeng920 chip using 53a951fbbeSLijun Ou `<https://www.hisilicon.com/en/products/Kunpeng>`_. 54565829dbSWei Hu (Xavier) 5521938cf4SMin Hu (Connor)- Follow the DPDK :ref:`Getting Started Guide for Linux <linux_gsg>` to 5621938cf4SMin Hu (Connor) setup the basic DPDK environment. 57565829dbSWei Hu (Xavier) 58b583b9a1SFerruh YigitLink status event Pre-conditions 59b583b9a1SFerruh Yigit~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60565829dbSWei Hu (Xavier) 61b583b9a1SFerruh YigitFirmware 1.8.0.0 and later versions support reporting link changes to the PF. 62b583b9a1SFerruh YigitTherefore, to use the LSC for the PF driver, ensure that the firmware version 63b583b9a1SFerruh Yigitalso supports reporting link changes. 64b583b9a1SFerruh YigitIf the VF driver needs to support LSC, special patch must be added: 652de9a0f1SDongdong Liu`<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=18b6e31f8bf4ac7af7b057228f38a5a530378e4e>`_. 662de9a0f1SDongdong Liu 67b583b9a1SFerruh YigitNote: The patch has been uploaded to 5.13 of the Linux kernel mainline. 6821938cf4SMin Hu (Connor) 69b583b9a1SFerruh Yigit 70b583b9a1SFerruh YigitConfiguration 71b583b9a1SFerruh Yigit------------- 72b583b9a1SFerruh Yigit 73b583b9a1SFerruh YigitCompilation Options 7421938cf4SMin Hu (Connor)~~~~~~~~~~~~~~~~~~~ 7521938cf4SMin Hu (Connor) 7621938cf4SMin Hu (Connor)The following options can be modified in the ``config/rte_config.h`` file. 7721938cf4SMin Hu (Connor) 7821938cf4SMin Hu (Connor)- ``RTE_LIBRTE_HNS3_MAX_TQP_NUM_PER_PF`` (default ``256``) 7921938cf4SMin Hu (Connor) 80f64a879dSHuisong Li Number of MAX queues reserved for PF on HIP09 and HIP10. 81f64a879dSHuisong Li The MAX queue number is also determined by the value the firmware report. 8221938cf4SMin Hu (Connor) 83b583b9a1SFerruh YigitRuntime Configuration 84b583b9a1SFerruh Yigit~~~~~~~~~~~~~~~~~~~~~ 85a124f9e9SChengwen Feng 86a124f9e9SChengwen Feng- ``rx_func_hint`` (default ``none``) 87a124f9e9SChengwen Feng 88a124f9e9SChengwen Feng Used to select Rx burst function, supported value are ``vec``, ``sve``, 89a124f9e9SChengwen Feng ``simple``, ``common``. 90a124f9e9SChengwen Feng ``vec``, if supported use the ``vec`` Rx function which indicates the 91a124f9e9SChengwen Feng default vector algorithm, neon for Kunpeng Arm platform. 92a124f9e9SChengwen Feng ``sve``, if supported use the ``sve`` Rx function which indicates the 93a124f9e9SChengwen Feng sve algorithm. 94a124f9e9SChengwen Feng ``simple``, if supported use the ``simple`` Rx function which indicates 958e321f7dSMin Hu (Connor) the scalar simple algorithm. 96a124f9e9SChengwen Feng ``common``, if supported use the ``common`` Rx function which indicates 97a124f9e9SChengwen Feng the scalar scattered algorithm. 98a124f9e9SChengwen Feng 99a124f9e9SChengwen Feng When provided parameter is not supported, ``vec`` usage condition will 100a124f9e9SChengwen Feng be first checked, if meets, use the ``vec``. Then, ``simple``, at last 101a124f9e9SChengwen Feng ``common``. 102a124f9e9SChengwen Feng 103cdf6a5fbSMin Hu (Connor) For example:: 104258e6e1bSDongdong Liu 105cdf6a5fbSMin Hu (Connor) -a 0000:7d:00.0,rx_func_hint=simple 106cdf6a5fbSMin Hu (Connor) 107a124f9e9SChengwen Feng- ``tx_func_hint`` (default ``none``) 108a124f9e9SChengwen Feng 109a124f9e9SChengwen Feng Used to select Tx burst function, supported value are ``vec``, ``sve``, 110a124f9e9SChengwen Feng ``simple``, ``common``. 111a124f9e9SChengwen Feng ``vec``, if supported use the ``vec`` Tx function which indicates the 112a124f9e9SChengwen Feng default vector algorithm, neon for Kunpeng Arm platform. 113a124f9e9SChengwen Feng ``sve``, if supported use the ``sve`` Tx function which indicates the 114a124f9e9SChengwen Feng sve algorithm. 115a124f9e9SChengwen Feng ``simple``, if supported use the ``simple`` Tx function which indicates 116a124f9e9SChengwen Feng the scalar simple algorithm. 117a124f9e9SChengwen Feng ``common``, if supported use the ``common`` Tx function which indicates 118a124f9e9SChengwen Feng the scalar algorithm. 119a124f9e9SChengwen Feng 120a124f9e9SChengwen Feng When provided parameter is not supported, ``vec`` usage condition will 121a124f9e9SChengwen Feng be first checked, if meets, use the ``vec``. Then, ``simple``, at last 122a124f9e9SChengwen Feng ``common``. 123a124f9e9SChengwen Feng 124cdf6a5fbSMin Hu (Connor) For example:: 125258e6e1bSDongdong Liu 126cdf6a5fbSMin Hu (Connor) -a 0000:7d:00.0,tx_func_hint=common 127cdf6a5fbSMin Hu (Connor) 12870791213SChengwen Feng- ``dev_caps_mask`` (default ``0``) 12970791213SChengwen Feng 13070791213SChengwen Feng Used to mask the capability which queried from firmware. 13170791213SChengwen Feng This args take hexadecimal bitmask where each bit represents whether mask 13270791213SChengwen Feng corresponding capability. eg. If the capability is 0xFFFF queried from 13370791213SChengwen Feng firmware, and the args value is 0xF which means the bit0~bit3 should be 13470791213SChengwen Feng masked off, then the capability will be 0xFFF0. 13570791213SChengwen Feng Its main purpose is to debug and avoid problems. 13670791213SChengwen Feng 137cdf6a5fbSMin Hu (Connor) For example:: 138258e6e1bSDongdong Liu 139cdf6a5fbSMin Hu (Connor) -a 0000:7d:00.0,dev_caps_mask=0xF 140cdf6a5fbSMin Hu (Connor) 1412fc3e696SChengchang Tang- ``mbx_time_limit_ms`` (default ``500``) 142620cd2d5SDongdong Liu 1432fc3e696SChengchang Tang Used to define the mailbox time limit by user. 1442fc3e696SChengchang Tang Current, the max waiting time for MBX response is 500ms, but in 1452fc3e696SChengchang Tang some scenarios, it is not enough. Since it depends on the response 1462fc3e696SChengchang Tang of the kernel mode driver, and its response time is related to the 1472fc3e696SChengchang Tang scheduling of the system. In this special scenario, most of the 1482fc3e696SChengchang Tang cores are isolated, and only a few cores are used for system 1492fc3e696SChengchang Tang scheduling. When a large number of services are started, the 1502fc3e696SChengchang Tang scheduling of the system will be very busy, and the reply of the 1512fc3e696SChengchang Tang mbx message will time out, which will cause our PMD initialization 1522fc3e696SChengchang Tang to fail. So provide access to set mailbox time limit for user. 1532fc3e696SChengchang Tang 1542fc3e696SChengchang Tang For example:: 155620cd2d5SDongdong Liu 1562fc3e696SChengchang Tang -a 0000:7d:00.0,mbx_time_limit_ms=600 15780006b59SChengwen Feng 15806b9ee34SHuisong Li- ``fdir_vlan_match_mode`` (default ``strict``) 15906b9ee34SHuisong Li 16006b9ee34SHuisong Li Used to select VLAN match mode. This runtime config can be ``strict`` 16106b9ee34SHuisong Li or ``nostrict`` and is only valid for PF devices. 16206b9ee34SHuisong Li If driver works on ``strict`` mode (default mode), hardware does strictly 16306b9ee34SHuisong Li match the input flow base on VLAN number. 16406b9ee34SHuisong Li 16506b9ee34SHuisong Li For the following scenarios with two rules: 16606b9ee34SHuisong Li 16706b9ee34SHuisong Li .. code-block:: console 16806b9ee34SHuisong Li 16906b9ee34SHuisong Li rule0: 17006b9ee34SHuisong Li pattern: eth type is 0x0806 17106b9ee34SHuisong Li actions: queue index 3 17206b9ee34SHuisong Li rule1: 17306b9ee34SHuisong Li pattern: eth type is 0x0806 / vlan vid is 20 17406b9ee34SHuisong Li actions: queue index 4 17506b9ee34SHuisong Li 17606b9ee34SHuisong Li If application select ``strict`` mode, only the ARP packets with VLAN 17706b9ee34SHuisong Li 20 are directed to queue 4, and the ARP packets with other VLAN ID 17806b9ee34SHuisong Li cannot be directed to the specified queue. If application want to all 17906b9ee34SHuisong Li ARP packets with or without VLAN to be directed to the specified queue, 18006b9ee34SHuisong Li application can select ``nostrict`` mode and just need to set rule0. 18106b9ee34SHuisong Li 18206b9ee34SHuisong Li For example:: 18306b9ee34SHuisong Li 18406b9ee34SHuisong Li -a 0000:7d:00.0,fdir_vlan_match_mode=nostrict 18580006b59SChengwen Feng 186a4732847SChengwen Feng- ``fdir_tuple_config`` (default ``none``) 187a4732847SChengwen Feng 188a4732847SChengwen Feng Used to customize the flow director tuples. Current supported options are follows: 189a4732847SChengwen Feng ``+outvlan-insmac``: means disable inner src mac tuple, and enable outer vlan tuple. 190a4732847SChengwen Feng ``+outvlan-indmac``: means disable inner dst mac tuple, and enable outer vlan tuple. 191a4732847SChengwen Feng ``+outvlan-insip``: means disable inner src ip tuple, and enable outer vlan tuple. 192a4732847SChengwen Feng ``+outvlan-indip``: means disable inner dst ip tuple, and enable outer vlan tuple. 193a4732847SChengwen Feng ``+outvlan-sctptag``: means disable sctp tag tuple, and enable outer vlan tuple. 194a4732847SChengwen Feng ``+outvlan-tunvni``: means disable tunnel vni tuple, and enable outer vlan tuple. 195a4732847SChengwen Feng 196*ac72aae6SDengdui Huang- ``fdir_index_config`` (default ``hash``) 197*ac72aae6SDengdui Huang 198*ac72aae6SDengdui Huang Used to select flow director index strategy, 199*ac72aae6SDengdui Huang the flow director index is the index position in the hardware flow director table. 200*ac72aae6SDengdui Huang Lower index denotes higher priority 201*ac72aae6SDengdui Huang (it means when a packet matches multiple indexes, the smaller index wins). 202*ac72aae6SDengdui Huang Current supported options are as follows: 203*ac72aae6SDengdui Huang ``hash``: The driver generates a flow index based on the hash of the rte_flow key. 204*ac72aae6SDengdui Huang ``priority``: the driver uses the rte_flow priority field as the flow director index. 205*ac72aae6SDengdui Huang 206565829dbSWei Hu (Xavier)Driver compilation and testing 207565829dbSWei Hu (Xavier)------------------------------ 208565829dbSWei Hu (Xavier) 209565829dbSWei Hu (Xavier)Refer to the document :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>` 210565829dbSWei Hu (Xavier)for details. 211565829dbSWei Hu (Xavier) 21263a0f65cSMin Hu (Connor)Sample Application Notes 21363a0f65cSMin Hu (Connor)------------------------ 21463a0f65cSMin Hu (Connor) 21563a0f65cSMin Hu (Connor)VLAN filter 21663a0f65cSMin Hu (Connor)~~~~~~~~~~~ 21763a0f65cSMin Hu (Connor) 21863a0f65cSMin Hu (Connor)VLAN filter only works when Promiscuous mode is off. 21963a0f65cSMin Hu (Connor) 22063a0f65cSMin Hu (Connor)To start ``testpmd``, and add VLAN 10 to port 0: 22163a0f65cSMin Hu (Connor) 22263a0f65cSMin Hu (Connor).. code-block:: console 22363a0f65cSMin Hu (Connor) 22463a0f65cSMin Hu (Connor) ./<build_dir>/app/dpdk-testpmd -l 0-15 -n 4 -- -i --forward-mode=mac 22563a0f65cSMin Hu (Connor) ... 22663a0f65cSMin Hu (Connor) 22763a0f65cSMin Hu (Connor) testpmd> set promisc 0 off 22863a0f65cSMin Hu (Connor) testpmd> vlan set filter on 0 22963a0f65cSMin Hu (Connor) testpmd> rx_vlan add 10 0 23063a0f65cSMin Hu (Connor) 23163a0f65cSMin Hu (Connor) 23263a0f65cSMin Hu (Connor)Flow Director 23363a0f65cSMin Hu (Connor)~~~~~~~~~~~~~ 23463a0f65cSMin Hu (Connor) 23563a0f65cSMin Hu (Connor)The Flow Director works in receive mode to identify specific flows or sets of 23663a0f65cSMin Hu (Connor)flows and route them to specific queues. 23763a0f65cSMin Hu (Connor)The Flow Director filters can match the different fields for different type of 23863a0f65cSMin Hu (Connor)packet: flow type, specific input set per flow type. 23963a0f65cSMin Hu (Connor) 24063a0f65cSMin Hu (Connor) 24163a0f65cSMin Hu (Connor)Start ``testpmd``: 24263a0f65cSMin Hu (Connor) 24363a0f65cSMin Hu (Connor).. code-block:: console 24463a0f65cSMin Hu (Connor) 24563a0f65cSMin Hu (Connor) ./<build_dir>/app/dpdk-testpmd -l 0-15 -n 4 -- -i --rxq=8 --txq=8 \ 24663a0f65cSMin Hu (Connor) --nb-cores=8 --nb-ports=1 24763a0f65cSMin Hu (Connor) 24863a0f65cSMin Hu (Connor)Add a rule to direct ``ipv4-udp`` packet whose ``dst_ip=2.2.2.5, src_ip=2.2.2.3, 24963a0f65cSMin Hu (Connor)src_port=32, dst_port=32`` to queue 1: 25063a0f65cSMin Hu (Connor) 25163a0f65cSMin Hu (Connor).. code-block:: console 25263a0f65cSMin Hu (Connor) 25363a0f65cSMin Hu (Connor) testpmd> flow create 0 ingress pattern eth / ipv4 src is 2.2.2.3 \ 25463a0f65cSMin Hu (Connor) dst is 2.2.2.5 / udp src is 32 dst is 32 / end \ 25563a0f65cSMin Hu (Connor) actions mark id 1 / queue index 1 / end 25663a0f65cSMin Hu (Connor) 257051d4bc9SJie HaiThe flow rules:: 258051d4bc9SJie Hai 259051d4bc9SJie Hai rule-0: flow create 0 ingress pattern eth / end \ 260051d4bc9SJie Hai queue index 1 / end 261051d4bc9SJie Hai rule-1: flow create 0 ingress pattern eth / vlan vid is 10 / end \ 262051d4bc9SJie Hai queue index 1 / end 263051d4bc9SJie Hai rule-2: flow create 0 ingress pattern eth / vlan / vlan vid is 10 / end \ 264051d4bc9SJie Hai queue index 1 / end 265051d4bc9SJie Hai rule-3: flow create 0 ingress pattern eth / vlan vid is 10 / vlan vid is 11 / end \ 266051d4bc9SJie Hai queue index 1 / end 267051d4bc9SJie Hai 268051d4bc9SJie Haiwill match the following packet types with specific VLAN ID at the specified VLAN layer 269051d4bc9SJie Haiand any VLAN ID at the rest VLAN layer. 270051d4bc9SJie Hai 271051d4bc9SJie Hai +--------+------------------+-------------------------------------------+ 272051d4bc9SJie Hai | rules | ``strict`` | ``nostrict`` | 273051d4bc9SJie Hai +========+==================+===========================================+ 274051d4bc9SJie Hai | rule-0 | untagged | untagged || single-tagged || multi-tagged | 275051d4bc9SJie Hai +--------+------------------+-------------------------------------------+ 276051d4bc9SJie Hai | rule-1 | single-tagged | single-tagged || multi-tagged | 277051d4bc9SJie Hai +--------+------------------+-------------------------------------------+ 278051d4bc9SJie Hai | rule-2 | double-tagged | multi-tagged | 279051d4bc9SJie Hai +--------+------------------+-------------------------------------------+ 280051d4bc9SJie Hai | rule-3 | double-tagged | multi-tagged | 281051d4bc9SJie Hai +--------+------------------+-------------------------------------------+ 282051d4bc9SJie Hai 283051d4bc9SJie HaiThe attributes ``has_vlan`` and ``has_more_vlan`` are supported. 284051d4bc9SJie HaiThe usage is as follows:: 285051d4bc9SJie Hai 286051d4bc9SJie Hai rule-4: flow create 0 ingress pattern eth has_vlan is 1 / end \ 287051d4bc9SJie Hai queue index 1 / end 288051d4bc9SJie Hai rule-5: flow create 0 ingress pattern eth has_vlan is 0 / end \ 289051d4bc9SJie Hai queue index 1 / end 290051d4bc9SJie Hai rule-6: flow create 0 ingress pattern eth / vlan has_more_vlan is 1 / \ 291051d4bc9SJie Hai end queue index 1 / end 292051d4bc9SJie Hai rule-7: flow create 0 ingress pattern eth / vlan has_more_vlan is 0 / \ 293051d4bc9SJie Hai end queue index 1 / end 294051d4bc9SJie Hai 295051d4bc9SJie HaiThey will match the following packet types with any VLAN ID. 296051d4bc9SJie Hai 297051d4bc9SJie Hai +--------+------------------+-------------------------------------------+ 298051d4bc9SJie Hai | rules | ``strict`` | ``nostrict`` | 299051d4bc9SJie Hai +========+==================+===========================================+ 300051d4bc9SJie Hai | rule-4 | single-tagged | untagged || single-tagged || multi-tagged | 301051d4bc9SJie Hai +--------+------------------+-------------------------------------------+ 302051d4bc9SJie Hai | rule-5 | untagged | untagged || single-tagged || multi-tagged | 303051d4bc9SJie Hai +--------+------------------+-------------------------------------------+ 304051d4bc9SJie Hai | rule-6 | double-tagged | untagged || single-tagged || multi-tagged | 305051d4bc9SJie Hai +--------+------------------+-------------------------------------------+ 306051d4bc9SJie Hai | rule-7 | single-tagged | untagged || single-tagged || multi-tagged | 307051d4bc9SJie Hai +--------+------------------+-------------------------------------------+ 308051d4bc9SJie Hai 309051d4bc9SJie HaiThese two fields may be used followed by VLAN item, 310051d4bc9SJie Haiand may partially overlap or conflict with the VLAN item. 311051d4bc9SJie HaiFor examples, the rule-8 will be rejected by the driver 312051d4bc9SJie Haiand rule-9, rule-10 are repeated with rule-4. 313051d4bc9SJie HaiSimilar usage for ``has_more_vlan``. 314051d4bc9SJie Hai 315051d4bc9SJie Hai:: 316051d4bc9SJie Hai 317051d4bc9SJie Hai rule-8: flow create 0 ingress pattern eth has_vlan is 0 / vlan / end \ 318051d4bc9SJie Hai queue index 1 / end 319051d4bc9SJie Hai rule-9: flow create 0 ingress pattern eth has_vlan is 1 / vlan / end \ 320051d4bc9SJie Hai queue index 1 / end 321051d4bc9SJie Hai rule-10: flow create 0 ingress pattern eth / vlan / end \ 322051d4bc9SJie Hai queue index 1 / end 323051d4bc9SJie Hai 324051d4bc9SJie Hai 32563a0f65cSMin Hu (Connor)Generic flow API 32663a0f65cSMin Hu (Connor)~~~~~~~~~~~~~~~~ 32763a0f65cSMin Hu (Connor) 32863a0f65cSMin Hu (Connor)- ``RSS Flow`` 32963a0f65cSMin Hu (Connor) 3309036f9feSHuisong Li RSS Flow supports for creating rule base on input tuple, hash key, queues 3319036f9feSHuisong Li and hash algorithm. But hash key, queues and hash algorithm are the global 3329036f9feSHuisong Li configuration for hardware which will affect other rules. 3339036f9feSHuisong Li The rule just setting input tuple is completely independent. 3349036f9feSHuisong Li 335*ac72aae6SDengdui Huang In addition, if the rule priority level is set, no error is reported, 336*ac72aae6SDengdui Huang but the rule priority level does not take effect. 337*ac72aae6SDengdui Huang 3389036f9feSHuisong Li Run ``testpmd``: 3399036f9feSHuisong Li 3409036f9feSHuisong Li .. code-block:: console 3419036f9feSHuisong Li 3429036f9feSHuisong Li dpdk-testpmd -a 0000:7d:00.0 -l 10-18 -- -i --rxq=8 --txq=8 3439036f9feSHuisong Li 3449036f9feSHuisong Li All IP packets can be distributed to 8 queues. 3459036f9feSHuisong Li 3469036f9feSHuisong Li Set IPv4-TCP packet is distributed to 8 queues based on L3/L4 SRC only. 3479036f9feSHuisong Li 3489036f9feSHuisong Li .. code-block:: console 3499036f9feSHuisong Li 3509036f9feSHuisong Li testpmd> flow create 0 ingress pattern eth / ipv4 / tcp / end actions \ 3519036f9feSHuisong Li rss types ipv4-tcp l4-src-only l3-src-only end queues end / end 3529036f9feSHuisong Li 3539036f9feSHuisong Li Disable IPv4 packet RSS hash. 3549036f9feSHuisong Li 3559036f9feSHuisong Li .. code-block:: console 3569036f9feSHuisong Li 3579036f9feSHuisong Li testpmd> flow create 0 ingress pattern eth / ipv4 / end actions rss \ 3589036f9feSHuisong Li types none end queues end / end 3599036f9feSHuisong Li 3609036f9feSHuisong Li Set hash function as symmetric Toeplitz. 36163a0f65cSMin Hu (Connor) 36263a0f65cSMin Hu (Connor) .. code-block:: console 36363a0f65cSMin Hu (Connor) 36463a0f65cSMin Hu (Connor) testpmd> flow create 0 ingress pattern end actions rss types end \ 3659036f9feSHuisong Li queues end func symmetric_toeplitz / end 36663a0f65cSMin Hu (Connor) 3679036f9feSHuisong Li In this case, all packets that enabled RSS are hashed using symmetric 3689036f9feSHuisong Li Toeplitz algorithm. 3699036f9feSHuisong Li 3709036f9feSHuisong Li Flush all RSS rules 37163a0f65cSMin Hu (Connor) 37263a0f65cSMin Hu (Connor) .. code-block:: console 37363a0f65cSMin Hu (Connor) 3749036f9feSHuisong Li testpmd> flow flush 0 37563a0f65cSMin Hu (Connor) 3769036f9feSHuisong Li The RSS configurations of hardwre is back to the one ethdev ops set. 37763a0f65cSMin Hu (Connor) 37863a0f65cSMin Hu (Connor)Statistics 37963a0f65cSMin Hu (Connor)---------- 38063a0f65cSMin Hu (Connor) 38163a0f65cSMin Hu (Connor)HNS3 supports various methods to report statistics: 38263a0f65cSMin Hu (Connor) 38363a0f65cSMin Hu (Connor)Port statistics can be queried using ``rte_eth_stats_get()``. The number 38463a0f65cSMin Hu (Connor)of packets received or sent successfully by the PMD. While the received and 38563a0f65cSMin Hu (Connor)sent packet bytes are through SW only. The imissed counter is the amount of 38663a0f65cSMin Hu (Connor)packets that could not be delivered to SW because a queue was full. The oerror 38763a0f65cSMin Hu (Connor)counter is the amount of packets that are dropped by HW in Tx. 38863a0f65cSMin Hu (Connor) 38963a0f65cSMin Hu (Connor)Extended statistics can be queried using ``rte_eth_xstats_get()``. The extended 39063a0f65cSMin Hu (Connor)statistics expose a wider set of counters counted by the device. The extended 39163a0f65cSMin Hu (Connor)port statistics contains packets statistics per queue, Mac statistics, HW reset 39263a0f65cSMin Hu (Connor)count and IO error count. 39363a0f65cSMin Hu (Connor) 39463a0f65cSMin Hu (Connor)Finally per-flow statistics can by queried using ``rte_flow_query`` when attaching 39563a0f65cSMin Hu (Connor)a count action for specific flow. The flow counter counts the number of packets 39663a0f65cSMin Hu (Connor)received successfully by the port and match the specific flow. 39763a0f65cSMin Hu (Connor) 39863a0f65cSMin Hu (Connor)Performance tuning 39963a0f65cSMin Hu (Connor)------------------ 40063a0f65cSMin Hu (Connor) 40163a0f65cSMin Hu (Connor)Hardware configuration 40263a0f65cSMin Hu (Connor)~~~~~~~~~~~~~~~~~~~~~~ 40363a0f65cSMin Hu (Connor)32 GB DIMMs is used to ensure that each channel is fully configured. 40463a0f65cSMin Hu (Connor)Dynamic CPU Tuning is disabled. 40563a0f65cSMin Hu (Connor) 40663a0f65cSMin Hu (Connor)Queue depth configuration 40763a0f65cSMin Hu (Connor)~~~~~~~~~~~~~~~~~~~~~~~~~ 40863a0f65cSMin Hu (Connor)According to the actual test, the performance is best when the queue depth 40963a0f65cSMin Hu (Connor)ranges from 1024 to 2048. 41063a0f65cSMin Hu (Connor) 41163a0f65cSMin Hu (Connor)IO burst configuration 41263a0f65cSMin Hu (Connor)~~~~~~~~~~~~~~~~~~~~~~ 41363a0f65cSMin Hu (Connor)According to the actual test, the performance is best when IO burst is set to 64. 41463a0f65cSMin Hu (Connor)IO burst is the number of packets per burst. 41563a0f65cSMin Hu (Connor) 41663a0f65cSMin Hu (Connor)Queue number configuration 41763a0f65cSMin Hu (Connor)~~~~~~~~~~~~~~~~~~~~~~~~~~ 41863a0f65cSMin Hu (Connor)When the number of port queues corresponds to the number of CPU cores, the 41963a0f65cSMin Hu (Connor)performance will be better. 42063a0f65cSMin Hu (Connor) 42163a0f65cSMin Hu (Connor)Hugepage configuration 42263a0f65cSMin Hu (Connor)~~~~~~~~~~~~~~~~~~~~~~ 42363a0f65cSMin Hu (Connor)For 4K systems, 1 GB hugepages are recommended. For 64 KB systems, 512 MB 42463a0f65cSMin Hu (Connor)hugepages are recommended. 42563a0f65cSMin Hu (Connor) 42663a0f65cSMin Hu (Connor)CPU core isolation 42763a0f65cSMin Hu (Connor)~~~~~~~~~~~~~~~~~~ 42863a0f65cSMin Hu (Connor)To reduce the possibility of context switching, kernel isolation parameter should 42963a0f65cSMin Hu (Connor)be provided to avoid scheduling the CPU core used by DPDK application threads for 43063a0f65cSMin Hu (Connor)other tasks. Before starting the Linux OS, add the kernel isolation boot parameter. 43163a0f65cSMin Hu (Connor)For example, "isolcpus=1-18 nohz_full=1-18 rcu_nocbs=1-18". 43263a0f65cSMin Hu (Connor) 43399d3bd8bSJie HaiDump registers 43499d3bd8bSJie Hai-------------- 43599d3bd8bSJie Hai 43699d3bd8bSJie HaiHNS3 supports dumping registers values with their names, 43799d3bd8bSJie Haiand supports filtering by module names. 43899d3bd8bSJie HaiThe available module names are ``bios``, ``ssu``, ``igu_egu``, 43999d3bd8bSJie Hai``rpu``, ``ncsi``, ``rtc``, ``ppp``, ``rcb``, ``tqp``, ``rtc``, ``cmdq``, 44099d3bd8bSJie Hai``common_pf``, ``common_vf``, ``ring``, ``tqp_intr``, ``32_bit_dfx``, 44199d3bd8bSJie Hai``64_bit_dfx``. 44263a0f65cSMin Hu (Connor) 443565829dbSWei Hu (Xavier)Limitations or Known issues 444565829dbSWei Hu (Xavier)--------------------------- 44563a0f65cSMin Hu (Connor)Currently, we only support VF device driven by DPDK driver when PF is driven 44663a0f65cSMin Hu (Connor)by kernel mode hns3 ethdev driver. VF is not supported when PF is driven by 44763a0f65cSMin Hu (Connor)DPDK driver. 448565829dbSWei Hu (Xavier) 4493ca3dcd6SMin Hu (Connor)For sake of Rx/Tx performance, IEEE 1588 is not supported when using vec or 4503ca3dcd6SMin Hu (Connor)sve burst function. When enabling IEEE 1588, Rx/Tx burst mode should be 4513ca3dcd6SMin Hu (Connor)simple or common. It is recommended that enable IEEE 1588 before ethdev 4523ca3dcd6SMin Hu (Connor)start. In this way, the correct Rx/Tx burst function can be selected. 4533ca3dcd6SMin Hu (Connor) 454565829dbSWei Hu (Xavier)Build with ICC is not supported yet. 455565829dbSWei Hu (Xavier)X86-32, Power8, ARMv7 and BSD are not supported yet. 456