1 .. SPDX-License-Identifier: BSD-3-Clause
2 Copyright(c) 2014-2018 Chelsio Communications.
8 The CXGBE PMD (**librte_pmd_cxgbe**) provides poll mode driver support
9 for **Chelsio Terminator** 10/25/40/100 Gbps family of adapters. CXGBE PMD
10 has support for the latest Linux and FreeBSD operating systems.
12 CXGBEVF PMD provides poll mode driver support for SR-IOV Virtual functions
13 and has support for the latest Linux operating systems.
15 More information can be found at `Chelsio Communications Official Website
16 <http://www.chelsio.com>`_.
21 CXGBE and CXGBEVF PMD has support for:
23 - Multiple queues for TX and RX
24 - Receiver Side Steering (RSS)
25 Receiver Side Steering (RSS) on IPv4, IPv6, IPv4-TCP/UDP, IPv6-TCP/UDP.
26 For 4-tuple, enabling 'RSS on TCP' and 'RSS on TCP + UDP' is supported.
31 - Port hardware statistics
37 The Chelsio Terminator series of devices provide two/four ports but
38 expose a single PCI bus address, thus, librte_pmd_cxgbe registers
39 itself as a PCI driver that allocates one Ethernet device per detected
42 For this reason, one cannot whitelist/blacklist a single port without
43 whitelisting/blacklisting the other ports on the same device.
47 Supported Chelsio T5 NICs
48 -------------------------
51 - 10G NICs: T520-BT, T520-CR, T520-LL-CR, T520-SO-CR, T540-CR
52 - 40G NICs: T580-CR, T580-LP-CR, T580-SO-CR
53 - Other T5 NICs: T522-CR
57 Supported Chelsio T6 NICs
58 -------------------------
60 - 25G NICs: T6425-CR, T6225-CR, T6225-LL-CR, T6225-SO-CR
61 - 100G NICs: T62100-CR, T62100-LP-CR, T62100-SO-CR
63 Supported SR-IOV Chelsio NICs
64 -----------------------------
66 SR-IOV virtual functions are supported on all the Chelsio NICs listed
67 in :ref:`t5-nics` and :ref:`t6-nics`.
72 - Requires firmware version **1.17.14.0** and higher. Visit
73 `Chelsio Download Center <http://service.chelsio.com>`_ to get latest firmware
74 bundled with the latest Chelsio Unified Wire package.
76 For Linux, installing and loading the latest cxgb4 kernel driver from the
77 Chelsio Unified Wire package should get you the latest firmware. More
78 information can be obtained from the User Guide that is bundled with the
79 Chelsio Unified Wire package.
81 For FreeBSD, the latest firmware obtained from the Chelsio Unified Wire
82 package must be manually flashed via cxgbetool available in FreeBSD source
85 Instructions on how to manually flash the firmware are given in section
86 :ref:`linux-installation` for Linux and section :ref:`freebsd-installation`
89 Pre-Installation Configuration
90 ------------------------------
95 The following options can be modified in the ``.config`` file. Please note that
96 enabling debugging options may affect system performance.
98 - ``CONFIG_RTE_LIBRTE_CXGBE_PMD`` (default **y**)
100 Toggle compilation of librte_pmd_cxgbe driver.
104 This controls compilation of both CXGBE and CXGBEVF PMD.
106 - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG`` (default **n**)
108 Toggle display of generic debugging messages.
110 - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG_REG`` (default **n**)
112 Toggle display of registers related run-time check messages.
114 - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG_MBOX`` (default **n**)
116 Toggle display of firmware mailbox related run-time check messages.
118 - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX`` (default **n**)
120 Toggle display of transmission data path run-time check messages.
122 - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX`` (default **n**)
124 Toggle display of receiving data path run-time check messages.
126 - ``CONFIG_RTE_LIBRTE_CXGBE_TPUT`` (default **y**)
128 Toggle behaviour to prefer Throughput or Latency.
130 .. _driver-compilation:
132 Driver compilation and testing
133 ------------------------------
135 Refer to the document :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
141 .. _linux-installation:
146 Steps to manually install the latest firmware from the downloaded Chelsio
147 Unified Wire package for Linux operating system are as follows:
149 #. Load the kernel module:
151 .. code-block:: console
155 #. Use ifconfig to get the interface name assigned to Chelsio card:
157 .. code-block:: console
159 ifconfig -a | grep "00:07:43"
163 .. code-block:: console
165 p1p1 Link encap:Ethernet HWaddr 00:07:43:2D:EA:C0
166 p1p2 Link encap:Ethernet HWaddr 00:07:43:2D:EA:C8
170 .. code-block:: console
172 cd <path_to_uwire>/tools/cxgbtool
175 #. Use cxgbtool to load the firmware config file onto the card:
177 .. code-block:: console
179 cxgbtool p1p1 loadcfg <path_to_uwire>/src/network/firmware/t5-config.txt
181 #. Use cxgbtool to load the firmware image onto the card:
183 .. code-block:: console
185 cxgbtool p1p1 loadfw <path_to_uwire>/src/network/firmware/t5fw-*.bin
187 #. Unload and reload the kernel module:
189 .. code-block:: console
194 #. Verify with ethtool:
196 .. code-block:: console
198 ethtool -i p1p1 | grep "firmware"
202 .. code-block:: console
204 firmware-version: 1.17.14.0, TP 0.1.4.9
209 This section demonstrates how to launch **testpmd** with Chelsio
210 devices managed by librte_pmd_cxgbe in Linux operating system.
212 #. Load the kernel module:
214 .. code-block:: console
218 #. Get the PCI bus addresses of the interfaces bound to cxgb4 driver:
220 .. code-block:: console
226 .. code-block:: console
228 cxgb4 0000:02:00.4 p1p1: renamed from eth0
229 cxgb4 0000:02:00.4 p1p2: renamed from eth1
233 Both the interfaces of a Chelsio 2-port adapter are bound to the
234 same PCI bus address.
236 #. Unload the kernel module:
238 .. code-block:: console
240 modprobe -ar cxgb4 csiostor
244 Follow instructions available in the document
245 :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
250 Currently, CXGBE PMD only supports the binding of PF4 for Chelsio NICs.
254 .. code-block:: console
257 EAL: PCI device 0000:02:00.4 on NUMA socket -1
258 EAL: probe driver: 1425:5401 rte_cxgbe_pmd
259 EAL: PCI memory mapped at 0x7fd7c0200000
260 EAL: PCI memory mapped at 0x7fd77cdfd000
261 EAL: PCI memory mapped at 0x7fd7c10b7000
262 PMD: rte_cxgbe_pmd: fw: 1.17.14.0, TP: 0.1.4.9
263 PMD: rte_cxgbe_pmd: Coming up as MASTER: Initializing adapter
264 Interactive-mode selected
265 Configuring Port 0 (socket 0)
266 Port 0: 00:07:43:2D:EA:C0
267 Configuring Port 1 (socket 0)
268 Port 1: 00:07:43:2D:EA:C8
269 Checking link statuses...
270 PMD: rte_cxgbe_pmd: Port0: passive DA port module inserted
271 PMD: rte_cxgbe_pmd: Port1: passive DA port module inserted
272 Port 0 Link Up - speed 10000 Mbps - full-duplex
273 Port 1 Link Up - speed 10000 Mbps - full-duplex
279 Flow control pause TX/RX is disabled by default and can be enabled via
280 testpmd. Refer section :ref:`flow-control` for more details.
282 Configuring SR-IOV Virtual Functions
283 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
285 This section demonstrates how to enable SR-IOV virtual functions
286 on Chelsio NICs and demonstrates how to run testpmd with SR-IOV
289 #. Load the kernel module:
291 .. code-block:: console
295 #. Get the PCI bus addresses of the interfaces bound to cxgb4 driver:
297 .. code-block:: console
303 .. code-block:: console
305 cxgb4 0000:02:00.4 p1p1: renamed from eth0
306 cxgb4 0000:02:00.4 p1p2: renamed from eth1
310 Both the interfaces of a Chelsio 2-port adapter are bound to the
311 same PCI bus address.
313 #. Use ifconfig to get the interface name assigned to Chelsio card:
315 .. code-block:: console
317 ifconfig -a | grep "00:07:43"
321 .. code-block:: console
323 p1p1 Link encap:Ethernet HWaddr 00:07:43:2D:EA:C0
324 p1p2 Link encap:Ethernet HWaddr 00:07:43:2D:EA:C8
326 #. Bring up the interfaces:
328 .. code-block:: console
333 #. Instantiate SR-IOV Virtual Functions. PF0..3 can be used for
334 SR-IOV VFs. Multiple VFs can be instantiated on each of PF0..3.
335 To instantiate one SR-IOV VF on each PF0 and PF1:
337 .. code-block:: console
339 echo 1 > /sys/bus/pci/devices/0000\:02\:00.0/sriov_numvfs
340 echo 1 > /sys/bus/pci/devices/0000\:02\:00.1/sriov_numvfs
342 #. Get the PCI bus addresses of the virtual functions:
344 .. code-block:: console
346 lspci | grep -i "Chelsio" | grep -i "VF"
350 .. code-block:: console
352 02:01.0 Ethernet controller: Chelsio Communications Inc T540-CR Unified Wire Ethernet Controller [VF]
353 02:01.1 Ethernet controller: Chelsio Communications Inc T540-CR Unified Wire Ethernet Controller [VF]
357 Follow instructions available in the document
358 :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
359 to bind virtual functions and run testpmd.
363 .. code-block:: console
366 EAL: PCI device 0000:02:01.0 on NUMA socket 0
367 EAL: probe driver: 1425:5803 net_cxgbevf
368 PMD: rte_cxgbe_pmd: Firmware version: 1.17.14.0
369 PMD: rte_cxgbe_pmd: TP Microcode version: 0.1.4.9
370 PMD: rte_cxgbe_pmd: Chelsio rev 0
371 PMD: rte_cxgbe_pmd: No bootstrap loaded
372 PMD: rte_cxgbe_pmd: No Expansion ROM loaded
373 PMD: rte_cxgbe_pmd: 0000:02:01.0 Chelsio rev 0 1G/10GBASE-SFP
374 EAL: PCI device 0000:02:01.1 on NUMA socket 0
375 EAL: probe driver: 1425:5803 net_cxgbevf
376 PMD: rte_cxgbe_pmd: Firmware version: 1.17.14.0
377 PMD: rte_cxgbe_pmd: TP Microcode version: 0.1.4.9
378 PMD: rte_cxgbe_pmd: Chelsio rev 0
379 PMD: rte_cxgbe_pmd: No bootstrap loaded
380 PMD: rte_cxgbe_pmd: No Expansion ROM loaded
381 PMD: rte_cxgbe_pmd: 0000:02:01.1 Chelsio rev 0 1G/10GBASE-SFP
382 Configuring Port 0 (socket 0)
383 Port 0: 06:44:29:44:40:00
384 Configuring Port 1 (socket 0)
385 Port 1: 06:44:29:44:40:10
386 Checking link statuses...
393 .. _freebsd-installation:
398 Steps to manually install the latest firmware from the downloaded Chelsio
399 Unified Wire package for FreeBSD operating system are as follows:
401 #. Load the kernel module:
403 .. code-block:: console
407 #. Use dmesg to get the t5nex instance assigned to the Chelsio card:
409 .. code-block:: console
415 .. code-block:: console
417 t5nex0: <Chelsio T520-CR> irq 16 at device 0.4 on pci2
418 cxl0: <port 0> on t5nex0
419 cxl1: <port 1> on t5nex0
420 t5nex0: PCIe x8, 2 ports, 14 MSI-X interrupts, 31 eq, 13 iq
422 In the example above, a Chelsio T520-CR card is bound to a t5nex0 instance.
424 #. Install cxgbetool from FreeBSD source repository:
426 .. code-block:: console
428 cd <path_to_FreeBSD_source>/tools/tools/cxgbetool/
431 #. Use cxgbetool to load the firmware image onto the card:
433 .. code-block:: console
435 cxgbetool t5nex0 loadfw <path_to_uwire>/src/network/firmware/t5fw-*.bin
437 #. Unload and reload the kernel module:
439 .. code-block:: console
444 #. Verify with sysctl:
446 .. code-block:: console
448 sysctl -a | grep "t5nex" | grep "firmware"
452 .. code-block:: console
454 dev.t5nex.0.firmware_version: 1.17.14.0
459 This section demonstrates how to launch **testpmd** with Chelsio
460 devices managed by librte_pmd_cxgbe in FreeBSD operating system.
462 #. Change to DPDK source directory where the target has been compiled in
463 section :ref:`driver-compilation`:
465 .. code-block:: console
467 cd <DPDK-source-directory>
469 #. Copy the contigmem kernel module to /boot/kernel directory:
471 .. code-block:: console
473 cp x86_64-native-bsdapp-clang/kmod/contigmem.ko /boot/kernel/
475 #. Add the following lines to /boot/loader.conf:
477 .. code-block:: console
479 # reserve 2 x 1G blocks of contiguous memory using contigmem driver
480 hw.contigmem.num_buffers=2
481 hw.contigmem.buffer_size=1073741824
482 # load contigmem module during boot process
485 The above lines load the contigmem kernel module during boot process and
486 allocate 2 x 1G blocks of contiguous memory to be used for DPDK later on.
487 This is to avoid issues with potential memory fragmentation during later
488 system up time, which may result in failure of allocating the contiguous
489 memory required for the contigmem kernel module.
491 #. Restart the system and ensure the contigmem module is loaded successfully:
493 .. code-block:: console
496 kldstat | grep "contigmem"
500 .. code-block:: console
502 2 1 0xffffffff817f1000 3118 contigmem.ko
504 #. Repeat step 1 to ensure that you are in the DPDK source directory.
506 #. Load the cxgbe kernel module:
508 .. code-block:: console
512 #. Get the PCI bus addresses of the interfaces bound to t5nex driver:
514 .. code-block:: console
516 pciconf -l | grep "t5nex"
520 .. code-block:: console
522 t5nex0@pci0:2:0:4: class=0x020000 card=0x00001425 chip=0x54011425 rev=0x00
524 In the above example, the t5nex0 is bound to 2:0:4 bus address.
528 Both the interfaces of a Chelsio 2-port adapter are bound to the
529 same PCI bus address.
531 #. Unload the kernel module:
533 .. code-block:: console
537 #. Set the PCI bus addresses to hw.nic_uio.bdfs kernel environment parameter:
539 .. code-block:: console
541 kenv hw.nic_uio.bdfs="2:0:4"
543 This automatically binds 2:0:4 to nic_uio kernel driver when it is loaded in
548 Currently, CXGBE PMD only supports the binding of PF4 for Chelsio NICs.
550 #. Load nic_uio kernel driver:
552 .. code-block:: console
554 kldload ./x86_64-native-bsdapp-clang/kmod/nic_uio.ko
556 #. Start testpmd with basic parameters:
558 .. code-block:: console
560 ./x86_64-native-bsdapp-clang/app/testpmd -l 0-3 -n 4 -w 0000:02:00.4 -- -i
564 .. code-block:: console
567 EAL: PCI device 0000:02:00.4 on NUMA socket 0
568 EAL: probe driver: 1425:5401 rte_cxgbe_pmd
569 EAL: PCI memory mapped at 0x8007ec000
570 EAL: PCI memory mapped at 0x842800000
571 EAL: PCI memory mapped at 0x80086c000
572 PMD: rte_cxgbe_pmd: fw: 1.17.14.0, TP: 0.1.4.9
573 PMD: rte_cxgbe_pmd: Coming up as MASTER: Initializing adapter
574 Interactive-mode selected
575 Configuring Port 0 (socket 0)
576 Port 0: 00:07:43:2D:EA:C0
577 Configuring Port 1 (socket 0)
578 Port 1: 00:07:43:2D:EA:C8
579 Checking link statuses...
580 PMD: rte_cxgbe_pmd: Port0: passive DA port module inserted
581 PMD: rte_cxgbe_pmd: Port1: passive DA port module inserted
582 Port 0 Link Up - speed 10000 Mbps - full-duplex
583 Port 1 Link Up - speed 10000 Mbps - full-duplex
589 Flow control pause TX/RX is disabled by default and can be enabled via
590 testpmd. Refer section :ref:`flow-control` for more details.
592 Sample Application Notes
593 ------------------------
597 Enable/Disable Flow Control
598 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
600 Flow control pause TX/RX is disabled by default and can be enabled via
603 .. code-block:: console
605 testpmd> set flow_ctrl rx on tx on 0 0 0 0 mac_ctrl_frame_fwd off autoneg on 0
606 testpmd> set flow_ctrl rx on tx on 0 0 0 0 mac_ctrl_frame_fwd off autoneg on 1
608 To disable again, run:
610 .. code-block:: console
612 testpmd> set flow_ctrl rx off tx off 0 0 0 0 mac_ctrl_frame_fwd off autoneg off 0
613 testpmd> set flow_ctrl rx off tx off 0 0 0 0 mac_ctrl_frame_fwd off autoneg off 1
618 There are two ways to enable sending and receiving of jumbo frames via testpmd.
619 One method involves using the **mtu** command, which changes the mtu of an
620 individual port without having to stop the selected port. Another method
621 involves stopping all the ports first and then running **max-pkt-len** command
622 to configure the mtu of all the ports with a single command.
624 - To configure each port individually, run the mtu command as follows:
626 .. code-block:: console
628 testpmd> port config mtu 0 9000
629 testpmd> port config mtu 1 9000
631 - To configure all the ports at once, stop all the ports first and run the
632 max-pkt-len command as follows:
634 .. code-block:: console
636 testpmd> port stop all
637 testpmd> port config all max-pkt-len 9000