.. BSD LICENSE Copyright 2015 Chelsio Communications. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Chelsio Communications nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. CXGBE Poll Mode Driver ====================== The CXGBE PMD (**librte_pmd_cxgbe**) provides poll mode driver support for **Chelsio T5** 10/40 Gbps family of adapters. More information can be found at `Chelsio Communications Official Website `_. Features -------- CXGBE PMD has support for: - Multiple queues for TX and RX - Receiver Side Steering (RSS) - VLAN filtering - Checksum offload - Promiscuous mode - All multicast mode - Port hardware statistics Limitations ----------- The Chelsio T5 devices provide two/four ports but expose a single PCI bus address, thus, librte_pmd_cxgbe registers itself as a PCI driver that allocates one Ethernet device per detected port. For this reason, one cannot whitelist/blacklist a single port without whitelisting/blacklisting the other ports on the same device. Supported Chelsio T5 NICs ------------------------- - 1G NICs: T502-BT - 10G NICs: T520-BT, T520-CR, T520-LL-CR, T520-SO-CR, T540-CR - 40G NICs: T580-CR, T580-LP-CR, T580-SO-CR - Other T5 NICs: T522-CR Prerequisites ------------- - Requires firmware version **1.13.32.0** and higher. Visit `Chelsio Download Center `_ to get latest firmware bundled with the latest Chelsio Unified Wire package. Installing and loading the latest cxgb4 kernel driver from the Chelsio Unified Wire package should get you the latest firmware. More information can be obtained from the User Guide that is bundled with the Chelsio Unified Wire package. Pre-Installation Configuration ------------------------------ Config File Options ~~~~~~~~~~~~~~~~~~~ The following options can be modified in the ``.config`` file. Please note that enabling debugging options may affect system performance. - ``CONFIG_RTE_LIBRTE_CXGBE_PMD`` (default **y**) Toggle compilation of librte_pmd_cxgbe driver. - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG`` (default **n**) Toggle display of generic debugging messages. - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG_REG`` (default **n**) Toggle display of registers related run-time check messages. - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG_MBOX`` (default **n**) Toggle display of firmware mailbox related run-time check messages. - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX`` (default **n**) Toggle display of transmission data path run-time check messages. - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX`` (default **n**) Toggle display of receiving data path run-time check messages. Driver Compilation ~~~~~~~~~~~~~~~~~~ To compile CXGBE PMD for Linux x86_64 gcc target, run the following "make" command: .. code-block:: console cd make config T=x86_64-native-linuxapp-gcc install Installation ------------ Steps to manually install the latest firmware from the downloaded source files are as follows: #. Load the kernel module: .. code-block:: console modprobe cxgb4 #. Use ifconfig to get the interface name assigned to Chelsio card: .. code-block:: console ifconfig -a | grep "00:07:43" Example output: .. code-block:: console p1p1 Link encap:Ethernet HWaddr 00:07:43:2D:EA:C0 p1p2 Link encap:Ethernet HWaddr 00:07:43:2D:EA:C8 #. Install cxgbtool: .. code-block:: console cd /tools/cxgbtool make install #. Use cxgbtool to load the firmware config file onto the card: .. code-block:: console cxgbtool p1p1 loadcfg /src/network/firmware/t5-config.txt #. Use cxgbtool to load the firmware image onto the card: .. code-block:: console cxgbtool p1p1 loadfw /src/network/firmware/t5fw-*.bin #. Verify with ethtool: .. code-block:: console ethtool -i p1p1 | grep "firmware" Example output: .. code-block:: console firmware-version: 1.13.32.0, TP 0.1.4.8 Sample Application Notes ------------------------- This section demonstrates how to launch **testpmd** with Chelsio T5 devices managed by librte_pmd_cxgbe. #. Load the kernel module: .. code-block:: console modprobe cxgb4 #. Get the PCI bus addresses of the interfaces bound to cxgb4 driver: .. code-block:: console dmesg | tail -2 Example output: .. code-block:: console cxgb4 0000:02:00.4 p1p1: renamed from eth0 cxgb4 0000:02:00.4 p1p2: renamed from eth1 .. note:: Both the interfaces of a Chelsio T5 2-port adapter are bound to the same PCI bus address. #. Unload the kernel module: .. code-block:: console modprobe -ar cxgb4 csiostor #. Request huge pages: .. code-block:: console echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages/nr_hugepages #. Load igb_uio or vfio-pci driver: .. code-block:: console insmod ./x86_64-native-linuxapp-gcc/kmod/igb_uio.ko or .. code-block:: console modprobe vfio-pci #. Bind the Chelsio T5 adapters to igb_uio or vfio-pci loaded in the previous step: .. code-block:: console ./tools/dpdk_nic_bind.py --bind igb_uio 0000:02:00.4 or Setup VFIO permissions for regular users and then bind to vfio-pci: .. code-block:: console sudo chmod a+x /dev/vfio sudo chmod 0666 /dev/vfio/* ./tools/dpdk_nic_bind.py --bind vfio-pci 0000:02:00.4 .. note:: CXGBE PMD currently only supports the binding of PF4 for Chelsio T5 NICs. #. Start testpmd with basic parameters: .. code-block:: console ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf -n 4 -w 0000:02:00.4 -- -i Example output: .. code-block:: console [...] EAL: PCI device 0000:02:00.4 on NUMA socket -1 EAL: probe driver: 1425:5401 rte_cxgbe_pmd EAL: PCI memory mapped at 0x7fd7c0200000 EAL: PCI memory mapped at 0x7fd77cdfd000 EAL: PCI memory mapped at 0x7fd7c10b7000 PMD: rte_cxgbe_pmd: fw: 1.13.33.0, TP: 0.1.4.8 PMD: rte_cxgbe_pmd: Coming up as MASTER: Initializing adapter Interactive-mode selected Configuring Port 0 (socket 0) Port 0: 00:07:43:2D:EA:C0 Configuring Port 1 (socket 0) Port 1: 00:07:43:2D:EA:C8 Checking link statuses... PMD: rte_cxgbe_pmd: Port0: passive DA port module inserted PMD: rte_cxgbe_pmd: Port1: passive DA port module inserted Port 0 Link Up - speed 10000 Mbps - full-duplex Port 1 Link Up - speed 10000 Mbps - full-duplex Done testpmd> .. note:: Flow control pause TX/RX is disabled by default and can be enabled via testpmd as follows: .. code-block:: console testpmd> set flow_ctrl rx on tx on 0 0 0 0 mac_ctrl_frame_fwd off autoneg on 0 testpmd> set flow_ctrl rx on tx on 0 0 0 0 mac_ctrl_frame_fwd off autoneg on 1 To disable again, use: .. code-block:: console testpmd> set flow_ctrl rx off tx off 0 0 0 0 mac_ctrl_frame_fwd off autoneg off 0 testpmd> set flow_ctrl rx off tx off 0 0 0 0 mac_ctrl_frame_fwd off autoneg off 1