1a9263e3cSJerin Jacob.. SPDX-License-Identifier: BSD-3-Clause 22ea6f76aSRasesh Mody Copyright(c) 2016 QLogic Corporation 3a9263e3cSJerin Jacob Copyright(c) 2017 Cavium, Inc 42ea6f76aSRasesh Mody 52ea6f76aSRasesh ModyQEDE Poll Mode Driver 62ea6f76aSRasesh Mody====================== 72ea6f76aSRasesh Mody 88809f78cSBruce RichardsonThe QEDE poll mode driver library (**librte_net_qede**) implements support 9db86fbe5SRasesh Modyfor **QLogic FastLinQ QL4xxxx 10G/25G/40G/50G/100G Intelligent Ethernet Adapters (IEA) and Converged Network Adapters (CNA)** family of adapters as well as SR-IOV virtual functions (VF). It is supported on 108e6281f4SRasesh Modyseveral standard Linux distros like RHEL, SLES, Ubuntu etc. 112ea6f76aSRasesh ModyIt is compile-tested under FreeBSD OS. 122ea6f76aSRasesh Mody 132ea6f76aSRasesh ModyMore information can be found at `QLogic Corporation's Website 142ea6f76aSRasesh Mody<http://www.qlogic.com>`_. 152ea6f76aSRasesh Mody 16*b583b9a1SFerruh YigitSupported QLogic Adapters 17*b583b9a1SFerruh Yigit------------------------- 18*b583b9a1SFerruh Yigit 19*b583b9a1SFerruh Yigit- QLogic FastLinQ QL4xxxx 10G/25G/40G/50G/100G Intelligent Ethernet Adapters (IEA) and Converged Network Adapters (CNA) 20*b583b9a1SFerruh Yigit 212ea6f76aSRasesh ModySupported Features 222ea6f76aSRasesh Mody------------------ 232ea6f76aSRasesh Mody 242ea6f76aSRasesh Mody- Unicast/Multicast filtering 252ea6f76aSRasesh Mody- Promiscuous mode 262ea6f76aSRasesh Mody- Allmulti mode 272ea6f76aSRasesh Mody- Port hardware statistics 28bec02288SSony Chacko- Jumbo frames 29db86fbe5SRasesh Mody- Multiple MAC address 30db86fbe5SRasesh Mody- MTU change 31db86fbe5SRasesh Mody- Default pause flow control 32db86fbe5SRasesh Mody- Multiprocess aware 33db86fbe5SRasesh Mody- Scatter-Gather 34cfe28a98SSony Chacko- Multiple Rx/Tx queues 359c5d0a66SHarish Patil- RSS (with RETA/hash table/key) 362ea6f76aSRasesh Mody- TSS 37db86fbe5SRasesh Mody- Stateless checksum offloads (IPv4/IPv6/TCP/UDP) 3829540be7SHarish Patil- LRO/TSO 39db86fbe5SRasesh Mody- VLAN offload - Filtering and stripping 40db86fbe5SRasesh Mody- N-tuple filter and flow director (limited support) 417eaeabf9SShahed Shaikh- NPAR (NIC Partitioning) 425700d0f0SManish Chopra- SR-IOV PF and VF 43c49a438fSRasesh Mody- GRE Tunneling offload 441adc5f2bSRasesh Mody- GENEVE Tunneling offload 45c49a438fSRasesh Mody- VXLAN Tunneling offload 461adc5f2bSRasesh Mody- MPLSoUDP Tx Tunneling offload 472c0784ebSShahed Shaikh- Generic flow API 482ea6f76aSRasesh Mody 491adc5f2bSRasesh ModyCo-existence considerations 501adc5f2bSRasesh Mody--------------------------- 518e6281f4SRasesh Mody 528e6281f4SRasesh Mody- QLogic FastLinQ QL4xxxx CNAs support Ethernet, RDMA, iSCSI and FCoE 538e6281f4SRasesh Mody functionalities. These functionalities are supported using 548e6281f4SRasesh Mody QLogic Linux kernel drivers qed, qede, qedr, qedi and qedf. DPDK is 558e6281f4SRasesh Mody supported on these adapters using qede PMD. 568e6281f4SRasesh Mody 578e6281f4SRasesh Mody- When SR-IOV is not enabled on the adapter, 588e6281f4SRasesh Mody QLogic Linux kernel drivers (qed, qede, qedr, qedi and qedf) and qede 598e6281f4SRasesh Mody PMD can’t be attached to different PFs on a given QLogic FastLinQ 608e6281f4SRasesh Mody QL4xxx adapter. 618e6281f4SRasesh Mody A given adapter needs to be completely used by DPDK or Linux drivers 628e6281f4SRasesh Mody Before binding DPDK driver to one or more PFs on the adapter, 638e6281f4SRasesh Mody please make sure to unbind Linux drivers from all PFs of the adapter. 648e6281f4SRasesh Mody If there are multiple adapters on the system, one or more adapters 658e6281f4SRasesh Mody can be used by DPDK driver completely and other adapters can be used 668e6281f4SRasesh Mody by Linux drivers completely. 678e6281f4SRasesh Mody 688e6281f4SRasesh Mody- When SR-IOV is enabled on the adapter, 698e6281f4SRasesh Mody Linux kernel drivers (qed, qede, qedr, qedi and qedf) can be bound 708e6281f4SRasesh Mody to the PFs of a given adapter and either qede PMD or Linux drivers 718e6281f4SRasesh Mody (qed and qede) can be bound to the VFs of the adapter. 722ea6f76aSRasesh Mody 73e28bfe33SRasesh Mody- For sharing an adapter between DPDK and Linux drivers, SRIOV needs 74e28bfe33SRasesh Mody to be enabled. Bind all the PFs to Linux Drivers(qed/qede). Create 75e28bfe33SRasesh Mody a VF on PFs where DPDK is desired and bind these VFs to qede_pmd. 76e28bfe33SRasesh Mody Binding of PFs simultaneously to DPDK and Linux drivers on a given 77e28bfe33SRasesh Mody adapter is not supported. 78e28bfe33SRasesh Mody 792ea6f76aSRasesh ModyPrerequisites 802ea6f76aSRasesh Mody------------- 812ea6f76aSRasesh Mody 8258bb1ee4SRasesh Mody- Requires storm firmware version **8.40.33.0**. Firmware may be available 832ea6f76aSRasesh Mody inbox in certain newer Linux distros under the standard directory 8458bb1ee4SRasesh Mody ``E.g. /lib/firmware/qed/qed_init_values-8.40.33.0.bin``. 85db86fbe5SRasesh Mody If the required firmware files are not available then download it from 86e28bfe33SRasesh Mody `linux-firmware git repository <http://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/qed>`_. 872ea6f76aSRasesh Mody 881fc3afdfSRasesh Mody- Requires the NIC be updated minimally with **8.30.x.x** Management firmware(MFW) version supported for that NIC. 891fc3afdfSRasesh Mody It is highly recommended that the NIC be updated with the latest available management firmware version to get latest feature set. 901fc3afdfSRasesh Mody Management Firmware and Firmware Upgrade Utility for Cavium FastLinQ(r) branded adapters can be downloaded from 911fc3afdfSRasesh Mody `Driver Download Center <http://driverdownloads.qlogic.com/QLogicDriverDownloads_UI/DefaultNewSearch.aspx>`_. 921fc3afdfSRasesh Mody For downloading Firmware Upgrade Utility, select NIC category, model and Linux distro. 931fc3afdfSRasesh Mody To update the management firmware, refer to the instructions in the Firmware Upgrade Utility Readme document. 941fc3afdfSRasesh Mody For OEM branded adapters please follow the instruction provided by the OEM to update the Management Firmware on the NIC. 95db86fbe5SRasesh Mody 96db86fbe5SRasesh Mody- SR-IOV requires Linux PF driver version **8.20.x.x** or higher. 97db86fbe5SRasesh Mody If the required PF driver is not available then download it from 98db86fbe5SRasesh Mody `QLogic Driver Download Center <http://driverdownloads.qlogic.com/QLogicDriverDownloads_UI/DefaultNewSearch.aspx>`_. 99db86fbe5SRasesh Mody For downloading PF driver, select adapter category, model and Linux distro. 100db86fbe5SRasesh Mody 1012ea6f76aSRasesh ModyPerformance note 1022ea6f76aSRasesh Mody~~~~~~~~~~~~~~~~ 1032ea6f76aSRasesh Mody 1042ea6f76aSRasesh Mody- For better performance, it is recommended to use 4K or higher RX/TX rings. 1052ea6f76aSRasesh Mody 106*b583b9a1SFerruh YigitCompilation Options 107*b583b9a1SFerruh Yigit~~~~~~~~~~~~~~~~~~~ 1082ea6f76aSRasesh Mody 10968d99d00SCiara PowerThe following option can be modified in the ``config/rte_config.h`` file. 1102ea6f76aSRasesh Mody 11168d99d00SCiara Power- ``RTE_LIBRTE_QEDE_FW`` (default **""**) 1122ea6f76aSRasesh Mody 1132ea6f76aSRasesh Mody Gives absolute path of firmware file. 114e28bfe33SRasesh Mody ``Eg: "/lib/firmware/qed/qed_init_values-8.40.33.0.bin"`` 1152ea6f76aSRasesh Mody Empty string indicates driver will pick up the firmware file 116db86fbe5SRasesh Mody from the default location /lib/firmware/qed. 117db86fbe5SRasesh Mody CAUTION this option is more for custom firmware, it is not 118db86fbe5SRasesh Mody recommended for use under normal condition. 1192ea6f76aSRasesh Mody 12068d99d00SCiara PowerThe following options can be enabled with Meson flags. 12168d99d00SCiara Power 12268d99d00SCiara Power- ``RTE_LIBRTE_QEDE_DEBUG_TX`` (default **disabled**) 12368d99d00SCiara Power 12468d99d00SCiara Power Toggle display of transmit fast path run-time messages. 12568d99d00SCiara Power 12668d99d00SCiara Power- ``RTE_LIBRTE_QEDE_DEBUG_RX`` (default **disabled**) 12768d99d00SCiara Power 12868d99d00SCiara Power Toggle display of receive fast path run-time messages. 12968d99d00SCiara Power 130e28bfe33SRasesh ModyConfig notes 131e28bfe33SRasesh Mody~~~~~~~~~~~~ 132e28bfe33SRasesh Mody 133e28bfe33SRasesh ModyWhen there are multiple adapters and/or large number of Rx/Tx queues 134e28bfe33SRasesh Modyconfigured on the adapters, the default (2560) number of memzone 135e28bfe33SRasesh Modydescriptors may not be enough. Please increase the number of memzone 136e28bfe33SRasesh Modydescriptors to a higher number as needed. When sufficient number of 137e28bfe33SRasesh Modymemzone descriptors are not configured, user can potentially run into 138e28bfe33SRasesh Modyfollowing error. 139e28bfe33SRasesh Mody 140e28bfe33SRasesh Mody .. code-block:: console 141e28bfe33SRasesh Mody 142e28bfe33SRasesh Mody EAL: memzone_reserve_aligned_thread_unsafe(): No more room in config 143e28bfe33SRasesh Mody 144f8d61d39SShijith ThottonDriver compilation and testing 145f8d61d39SShijith Thotton------------------------------ 1462ea6f76aSRasesh Mody 147f8d61d39SShijith ThottonRefer to the document :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>` 148f8d61d39SShijith Thottonfor details. 1492ea6f76aSRasesh Mody 1502c0784ebSShahed ShaikhRTE Flow Support 1512c0784ebSShahed Shaikh---------------- 1522c0784ebSShahed Shaikh 1532c0784ebSShahed ShaikhQLogic FastLinQ QL4xxxx NICs has support for the following patterns and 1542c0784ebSShahed Shaikhactions. 1552c0784ebSShahed Shaikh 1562c0784ebSShahed ShaikhPatterns: 1572c0784ebSShahed Shaikh 1582c0784ebSShahed Shaikh.. _table_qede_supported_flow_item_types: 1592c0784ebSShahed Shaikh 1602c0784ebSShahed Shaikh.. table:: Item types 1612c0784ebSShahed Shaikh 1622c0784ebSShahed Shaikh +----+--------------------------------+ 1632c0784ebSShahed Shaikh | # | Pattern Type | 1642c0784ebSShahed Shaikh +====+================================+ 1652c0784ebSShahed Shaikh | 1 | RTE_FLOW_ITEM_TYPE_IPV4 | 1662c0784ebSShahed Shaikh +----+--------------------------------+ 1672c0784ebSShahed Shaikh | 2 | RTE_FLOW_ITEM_TYPE_IPV6 | 1682c0784ebSShahed Shaikh +----+--------------------------------+ 1692c0784ebSShahed Shaikh | 3 | RTE_FLOW_ITEM_TYPE_UDP | 1702c0784ebSShahed Shaikh +----+--------------------------------+ 1712c0784ebSShahed Shaikh | 4 | RTE_FLOW_ITEM_TYPE_TCP | 1722c0784ebSShahed Shaikh +----+--------------------------------+ 1732c0784ebSShahed Shaikh 1742c0784ebSShahed ShaikhActions: 1752c0784ebSShahed Shaikh 1762c0784ebSShahed Shaikh.. _table_qede_supported_ingress_action_types: 1772c0784ebSShahed Shaikh 1782c0784ebSShahed Shaikh.. table:: Ingress action types 1792c0784ebSShahed Shaikh 1802c0784ebSShahed Shaikh +----+--------------------------------+ 1812c0784ebSShahed Shaikh | # | Action Type | 1822c0784ebSShahed Shaikh +====+================================+ 1832c0784ebSShahed Shaikh | 1 | RTE_FLOW_ACTION_TYPE_QUEUE | 1842c0784ebSShahed Shaikh +----+--------------------------------+ 1852c0784ebSShahed Shaikh | 2 | RTE_FLOW_ACTION_TYPE_DROP | 1862c0784ebSShahed Shaikh +----+--------------------------------+ 1872c0784ebSShahed Shaikh 1882ea6f76aSRasesh ModySR-IOV: Prerequisites and Sample Application Notes 189f8d61d39SShijith Thotton-------------------------------------------------- 1902ea6f76aSRasesh Mody 1912ea6f76aSRasesh ModyThis section provides instructions to configure SR-IOV with Linux OS. 1922ea6f76aSRasesh Mody 1938809f78cSBruce Richardson**Note**: librte_net_qede will be used to bind to SR-IOV VF device and Linux native kernel driver (qede) will function as SR-IOV PF driver. Requires PF driver to be 8.20.x.x or higher. 1942ea6f76aSRasesh Mody 1952ea6f76aSRasesh Mody#. Verify SR-IOV and ARI capability is enabled on the adapter using ``lspci``: 1962ea6f76aSRasesh Mody 1972ea6f76aSRasesh Mody .. code-block:: console 1982ea6f76aSRasesh Mody 1992ea6f76aSRasesh Mody lspci -s <slot> -vvv 2002ea6f76aSRasesh Mody 2012ea6f76aSRasesh Mody Example output: 2022ea6f76aSRasesh Mody 2032ea6f76aSRasesh Mody .. code-block:: console 2042ea6f76aSRasesh Mody 2052ea6f76aSRasesh Mody [...] 2062ea6f76aSRasesh Mody Capabilities: [1b8 v1] Alternative Routing-ID Interpretation (ARI) 2072ea6f76aSRasesh Mody [...] 2082ea6f76aSRasesh Mody Capabilities: [1c0 v1] Single Root I/O Virtualization (SR-IOV) 2092ea6f76aSRasesh Mody [...] 2102ea6f76aSRasesh Mody Kernel driver in use: igb_uio 2112ea6f76aSRasesh Mody 2122ea6f76aSRasesh Mody#. Load the kernel module: 2132ea6f76aSRasesh Mody 2142ea6f76aSRasesh Mody .. code-block:: console 2152ea6f76aSRasesh Mody 2162ea6f76aSRasesh Mody modprobe qede 2172ea6f76aSRasesh Mody 2182ea6f76aSRasesh Mody Example output: 2192ea6f76aSRasesh Mody 2202ea6f76aSRasesh Mody .. code-block:: console 2212ea6f76aSRasesh Mody 2222ea6f76aSRasesh Mody systemd-udevd[4848]: renamed network interface eth0 to ens5f0 2232ea6f76aSRasesh Mody systemd-udevd[4848]: renamed network interface eth1 to ens5f1 2242ea6f76aSRasesh Mody 2252ea6f76aSRasesh Mody#. Bring up the PF ports: 2262ea6f76aSRasesh Mody 2272ea6f76aSRasesh Mody .. code-block:: console 2282ea6f76aSRasesh Mody 2292ea6f76aSRasesh Mody ifconfig ens5f0 up 2302ea6f76aSRasesh Mody ifconfig ens5f1 up 2312ea6f76aSRasesh Mody 2322ea6f76aSRasesh Mody#. Create VF device(s): 2332ea6f76aSRasesh Mody 2342ea6f76aSRasesh Mody Echo the number of VFs to be created into ``"sriov_numvfs"`` sysfs entry 2352ea6f76aSRasesh Mody of the parent PF. 2362ea6f76aSRasesh Mody 2372ea6f76aSRasesh Mody Example output: 2382ea6f76aSRasesh Mody 2392ea6f76aSRasesh Mody .. code-block:: console 2402ea6f76aSRasesh Mody 2412ea6f76aSRasesh Mody echo 2 > /sys/devices/pci0000:00/0000:00:03.0/0000:81:00.0/sriov_numvfs 2422ea6f76aSRasesh Mody 2432ea6f76aSRasesh Mody 2442ea6f76aSRasesh Mody#. Assign VF MAC address: 2452ea6f76aSRasesh Mody 2462ea6f76aSRasesh Mody Assign MAC address to the VF using iproute2 utility. The syntax is:: 2472ea6f76aSRasesh Mody 2482ea6f76aSRasesh Mody ip link set <PF iface> vf <VF id> mac <macaddr> 2492ea6f76aSRasesh Mody 2502ea6f76aSRasesh Mody Example output: 2512ea6f76aSRasesh Mody 2522ea6f76aSRasesh Mody .. code-block:: console 2532ea6f76aSRasesh Mody 2542ea6f76aSRasesh Mody ip link set ens5f0 vf 0 mac 52:54:00:2f:9d:e8 2552ea6f76aSRasesh Mody 2562ea6f76aSRasesh Mody 2572ea6f76aSRasesh Mody#. PCI Passthrough: 2582ea6f76aSRasesh Mody 2592ea6f76aSRasesh Mody The VF devices may be passed through to the guest VM using ``virt-manager`` or 2602ea6f76aSRasesh Mody ``virsh``. QEDE PMD should be used to bind the VF devices in the guest VM 261f8d61d39SShijith Thotton using the instructions from Driver compilation and testing section above. 262f8d61d39SShijith Thotton 263f8d61d39SShijith Thotton 264f8d61d39SShijith Thotton#. Running testpmd 265a0173139SStephen Hemminger (Supply ``--log-level="pmd.net.qede.driver:info`` to view informational messages): 266f8d61d39SShijith Thotton 267f8d61d39SShijith Thotton Refer to the document 268f8d61d39SShijith Thotton :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>` to run 269f8d61d39SShijith Thotton ``testpmd`` application. 270f8d61d39SShijith Thotton 271f8d61d39SShijith Thotton Example output: 272f8d61d39SShijith Thotton 273f8d61d39SShijith Thotton .. code-block:: console 274f8d61d39SShijith Thotton 275e3f15be4SSarosh Arif dpdk-testpmd -l 0,4-11 -n 4 -- -i --nb-cores=8 --portmask=0xf --rxd=4096 \ 276f8d61d39SShijith Thotton --txd=4096 --txfreet=4068 --enable-rx-cksum --rxq=4 --txq=4 \ 277f8d61d39SShijith Thotton --rss-ip --rss-udp 278f8d61d39SShijith Thotton 279f8d61d39SShijith Thotton [...] 280f8d61d39SShijith Thotton 281f8d61d39SShijith Thotton EAL: PCI device 0000:84:00.0 on NUMA socket 1 282f8d61d39SShijith Thotton EAL: probe driver: 1077:1634 rte_qede_pmd 283f8d61d39SShijith Thotton EAL: Not managed by a supported kernel driver, skipped 284f8d61d39SShijith Thotton EAL: PCI device 0000:84:00.1 on NUMA socket 1 285f8d61d39SShijith Thotton EAL: probe driver: 1077:1634 rte_qede_pmd 286f8d61d39SShijith Thotton EAL: Not managed by a supported kernel driver, skipped 287f8d61d39SShijith Thotton EAL: PCI device 0000:88:00.0 on NUMA socket 1 288f8d61d39SShijith Thotton EAL: probe driver: 1077:1656 rte_qede_pmd 289f8d61d39SShijith Thotton EAL: PCI memory mapped at 0x7f738b200000 290f8d61d39SShijith Thotton EAL: PCI memory mapped at 0x7f738b280000 291f8d61d39SShijith Thotton EAL: PCI memory mapped at 0x7f738b300000 292f8d61d39SShijith Thotton PMD: Chip details : BB1 293f8d61d39SShijith Thotton PMD: Driver version : QEDE PMD 8.7.9.0_1.0.0 294f8d61d39SShijith Thotton PMD: Firmware version : 8.7.7.0 295f8d61d39SShijith Thotton PMD: Management firmware version : 8.7.8.0 296f8d61d39SShijith Thotton PMD: Firmware file : /lib/firmware/qed/qed_init_values_zipped-8.7.7.0.bin 297f8d61d39SShijith Thotton [QEDE PMD: (84:00.0:dpdk-port-0)]qede_common_dev_init:macaddr \ 298f8d61d39SShijith Thotton 00:0e:1e:d2:09:9c 299f8d61d39SShijith Thotton [...] 300f8d61d39SShijith Thotton [QEDE PMD: (84:00.0:dpdk-port-0)]qede_tx_queue_setup:txq 0 num_desc 4096 \ 301f8d61d39SShijith Thotton tx_free_thresh 4068 socket 0 302f8d61d39SShijith Thotton [QEDE PMD: (84:00.0:dpdk-port-0)]qede_tx_queue_setup:txq 1 num_desc 4096 \ 303f8d61d39SShijith Thotton tx_free_thresh 4068 socket 0 304f8d61d39SShijith Thotton [QEDE PMD: (84:00.0:dpdk-port-0)]qede_tx_queue_setup:txq 2 num_desc 4096 \ 305f8d61d39SShijith Thotton tx_free_thresh 4068 socket 0 306f8d61d39SShijith Thotton [QEDE PMD: (84:00.0:dpdk-port-0)]qede_tx_queue_setup:txq 3 num_desc 4096 \ 307f8d61d39SShijith Thotton tx_free_thresh 4068 socket 0 308f8d61d39SShijith Thotton [QEDE PMD: (84:00.0:dpdk-port-0)]qede_rx_queue_setup:rxq 0 num_desc 4096 \ 309f8d61d39SShijith Thotton rx_buf_size=2148 socket 0 310f8d61d39SShijith Thotton [QEDE PMD: (84:00.0:dpdk-port-0)]qede_rx_queue_setup:rxq 1 num_desc 4096 \ 311f8d61d39SShijith Thotton rx_buf_size=2148 socket 0 312f8d61d39SShijith Thotton [QEDE PMD: (84:00.0:dpdk-port-0)]qede_rx_queue_setup:rxq 2 num_desc 4096 \ 313f8d61d39SShijith Thotton rx_buf_size=2148 socket 0 314f8d61d39SShijith Thotton [QEDE PMD: (84:00.0:dpdk-port-0)]qede_rx_queue_setup:rxq 3 num_desc 4096 \ 315f8d61d39SShijith Thotton rx_buf_size=2148 socket 0 316f8d61d39SShijith Thotton [QEDE PMD: (84:00.0:dpdk-port-0)]qede_dev_start:port 0 317f8d61d39SShijith Thotton [QEDE PMD: (84:00.0:dpdk-port-0)]qede_dev_start:link status: down 318f8d61d39SShijith Thotton [...] 319f8d61d39SShijith Thotton Checking link statuses... 320f8d61d39SShijith Thotton Port 0 Link Up - speed 25000 Mbps - full-duplex 321f8d61d39SShijith Thotton Port 1 Link Up - speed 25000 Mbps - full-duplex 322f8d61d39SShijith Thotton Port 2 Link Up - speed 25000 Mbps - full-duplex 323f8d61d39SShijith Thotton Port 3 Link Up - speed 25000 Mbps - full-duplex 324f8d61d39SShijith Thotton Done 325f8d61d39SShijith Thotton testpmd> 326