2 Copyright 2015-2017 Chelsio Communications.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in
13 the documentation and/or other materials provided with the
15 * Neither the name of Chelsio Communications nor the names of its
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 CXGBE Poll Mode Driver
32 ======================
34 The CXGBE PMD (**librte_pmd_cxgbe**) provides poll mode driver support
35 for **Chelsio Terminator** 10/25/40/100 Gbps family of adapters. CXGBE PMD
36 has support for the latest Linux and FreeBSD operating systems.
38 More information can be found at `Chelsio Communications Official Website
39 <http://www.chelsio.com>`_.
44 CXGBE PMD has support for:
46 - Multiple queues for TX and RX
47 - Receiver Side Steering (RSS)
52 - Port hardware statistics
58 The Chelsio Terminator series of devices provide two/four ports but
59 expose a single PCI bus address, thus, librte_pmd_cxgbe registers
60 itself as a PCI driver that allocates one Ethernet device per detected
63 For this reason, one cannot whitelist/blacklist a single port without
64 whitelisting/blacklisting the other ports on the same device.
66 Supported Chelsio T5 NICs
67 -------------------------
70 - 10G NICs: T520-BT, T520-CR, T520-LL-CR, T520-SO-CR, T540-CR
71 - 40G NICs: T580-CR, T580-LP-CR, T580-SO-CR
72 - Other T5 NICs: T522-CR
74 Supported Chelsio T6 NICs
75 -------------------------
77 - 25G NICs: T6425-CR, T6225-CR, T6225-LL-CR, T6225-SO-CR
78 - 100G NICs: T62100-CR, T62100-LP-CR, T62100-SO-CR
83 - Requires firmware version **1.16.43.0** and higher. Visit
84 `Chelsio Download Center <http://service.chelsio.com>`_ to get latest firmware
85 bundled with the latest Chelsio Unified Wire package.
87 For Linux, installing and loading the latest cxgb4 kernel driver from the
88 Chelsio Unified Wire package should get you the latest firmware. More
89 information can be obtained from the User Guide that is bundled with the
90 Chelsio Unified Wire package.
92 For FreeBSD, the latest firmware obtained from the Chelsio Unified Wire
93 package must be manually flashed via cxgbetool available in FreeBSD source
96 Instructions on how to manually flash the firmware are given in section
97 :ref:`linux-installation` for Linux and section :ref:`freebsd-installation`
100 Pre-Installation Configuration
101 ------------------------------
106 The following options can be modified in the ``.config`` file. Please note that
107 enabling debugging options may affect system performance.
109 - ``CONFIG_RTE_LIBRTE_CXGBE_PMD`` (default **y**)
111 Toggle compilation of librte_pmd_cxgbe driver.
113 - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG`` (default **n**)
115 Toggle display of generic debugging messages.
117 - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG_REG`` (default **n**)
119 Toggle display of registers related run-time check messages.
121 - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG_MBOX`` (default **n**)
123 Toggle display of firmware mailbox related run-time check messages.
125 - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG_TX`` (default **n**)
127 Toggle display of transmission data path run-time check messages.
129 - ``CONFIG_RTE_LIBRTE_CXGBE_DEBUG_RX`` (default **n**)
131 Toggle display of receiving data path run-time check messages.
133 - ``CONFIG_RTE_LIBRTE_CXGBE_TPUT`` (default **y**)
135 Toggle behaviour to prefer Throughput or Latency.
137 .. _driver-compilation:
139 Driver compilation and testing
140 ------------------------------
142 Refer to the document :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
148 .. _linux-installation:
153 Steps to manually install the latest firmware from the downloaded Chelsio
154 Unified Wire package for Linux operating system are as follows:
156 #. Load the kernel module:
158 .. code-block:: console
162 #. Use ifconfig to get the interface name assigned to Chelsio card:
164 .. code-block:: console
166 ifconfig -a | grep "00:07:43"
170 .. code-block:: console
172 p1p1 Link encap:Ethernet HWaddr 00:07:43:2D:EA:C0
173 p1p2 Link encap:Ethernet HWaddr 00:07:43:2D:EA:C8
177 .. code-block:: console
179 cd <path_to_uwire>/tools/cxgbtool
182 #. Use cxgbtool to load the firmware config file onto the card:
184 .. code-block:: console
186 cxgbtool p1p1 loadcfg <path_to_uwire>/src/network/firmware/t5-config.txt
188 #. Use cxgbtool to load the firmware image onto the card:
190 .. code-block:: console
192 cxgbtool p1p1 loadfw <path_to_uwire>/src/network/firmware/t5fw-*.bin
194 #. Unload and reload the kernel module:
196 .. code-block:: console
201 #. Verify with ethtool:
203 .. code-block:: console
205 ethtool -i p1p1 | grep "firmware"
209 .. code-block:: console
211 firmware-version: 1.16.43.0, TP 0.1.4.9
216 This section demonstrates how to launch **testpmd** with Chelsio
217 devices managed by librte_pmd_cxgbe in Linux operating system.
219 #. Load the kernel module:
221 .. code-block:: console
225 #. Get the PCI bus addresses of the interfaces bound to cxgb4 driver:
227 .. code-block:: console
233 .. code-block:: console
235 cxgb4 0000:02:00.4 p1p1: renamed from eth0
236 cxgb4 0000:02:00.4 p1p2: renamed from eth1
240 Both the interfaces of a Chelsio 2-port adapter are bound to the
241 same PCI bus address.
243 #. Unload the kernel module:
245 .. code-block:: console
247 modprobe -ar cxgb4 csiostor
251 Follow instructions available in the document
252 :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
257 Currently, CXGBE PMD only supports the binding of PF4 for Chelsio NICs.
261 .. code-block:: console
264 EAL: PCI device 0000:02:00.4 on NUMA socket -1
265 EAL: probe driver: 1425:5401 rte_cxgbe_pmd
266 EAL: PCI memory mapped at 0x7fd7c0200000
267 EAL: PCI memory mapped at 0x7fd77cdfd000
268 EAL: PCI memory mapped at 0x7fd7c10b7000
269 PMD: rte_cxgbe_pmd: fw: 1.16.43.0, TP: 0.1.4.9
270 PMD: rte_cxgbe_pmd: Coming up as MASTER: Initializing adapter
271 Interactive-mode selected
272 Configuring Port 0 (socket 0)
273 Port 0: 00:07:43:2D:EA:C0
274 Configuring Port 1 (socket 0)
275 Port 1: 00:07:43:2D:EA:C8
276 Checking link statuses...
277 PMD: rte_cxgbe_pmd: Port0: passive DA port module inserted
278 PMD: rte_cxgbe_pmd: Port1: passive DA port module inserted
279 Port 0 Link Up - speed 10000 Mbps - full-duplex
280 Port 1 Link Up - speed 10000 Mbps - full-duplex
286 Flow control pause TX/RX is disabled by default and can be enabled via
287 testpmd. Refer section :ref:`flow-control` for more details.
292 .. _freebsd-installation:
297 Steps to manually install the latest firmware from the downloaded Chelsio
298 Unified Wire package for FreeBSD operating system are as follows:
300 #. Load the kernel module:
302 .. code-block:: console
306 #. Use dmesg to get the t5nex instance assigned to the Chelsio card:
308 .. code-block:: console
314 .. code-block:: console
316 t5nex0: <Chelsio T520-CR> irq 16 at device 0.4 on pci2
317 cxl0: <port 0> on t5nex0
318 cxl1: <port 1> on t5nex0
319 t5nex0: PCIe x8, 2 ports, 14 MSI-X interrupts, 31 eq, 13 iq
321 In the example above, a Chelsio T520-CR card is bound to a t5nex0 instance.
323 #. Install cxgbetool from FreeBSD source repository:
325 .. code-block:: console
327 cd <path_to_FreeBSD_source>/tools/tools/cxgbetool/
330 #. Use cxgbetool to load the firmware image onto the card:
332 .. code-block:: console
334 cxgbetool t5nex0 loadfw <path_to_uwire>/src/network/firmware/t5fw-*.bin
336 #. Unload and reload the kernel module:
338 .. code-block:: console
343 #. Verify with sysctl:
345 .. code-block:: console
347 sysctl -a | grep "t5nex" | grep "firmware"
351 .. code-block:: console
353 dev.t5nex.0.firmware_version: 1.16.43.0
358 This section demonstrates how to launch **testpmd** with Chelsio
359 devices managed by librte_pmd_cxgbe in FreeBSD operating system.
361 #. Change to DPDK source directory where the target has been compiled in
362 section :ref:`driver-compilation`:
364 .. code-block:: console
366 cd <DPDK-source-directory>
368 #. Copy the contigmem kernel module to /boot/kernel directory:
370 .. code-block:: console
372 cp x86_64-native-bsdapp-clang/kmod/contigmem.ko /boot/kernel/
374 #. Add the following lines to /boot/loader.conf:
376 .. code-block:: console
378 # reserve 2 x 1G blocks of contiguous memory using contigmem driver
379 hw.contigmem.num_buffers=2
380 hw.contigmem.buffer_size=1073741824
381 # load contigmem module during boot process
384 The above lines load the contigmem kernel module during boot process and
385 allocate 2 x 1G blocks of contiguous memory to be used for DPDK later on.
386 This is to avoid issues with potential memory fragmentation during later
387 system up time, which may result in failure of allocating the contiguous
388 memory required for the contigmem kernel module.
390 #. Restart the system and ensure the contigmem module is loaded successfully:
392 .. code-block:: console
395 kldstat | grep "contigmem"
399 .. code-block:: console
401 2 1 0xffffffff817f1000 3118 contigmem.ko
403 #. Repeat step 1 to ensure that you are in the DPDK source directory.
405 #. Load the cxgbe kernel module:
407 .. code-block:: console
411 #. Get the PCI bus addresses of the interfaces bound to t5nex driver:
413 .. code-block:: console
415 pciconf -l | grep "t5nex"
419 .. code-block:: console
421 t5nex0@pci0:2:0:4: class=0x020000 card=0x00001425 chip=0x54011425 rev=0x00
423 In the above example, the t5nex0 is bound to 2:0:4 bus address.
427 Both the interfaces of a Chelsio 2-port adapter are bound to the
428 same PCI bus address.
430 #. Unload the kernel module:
432 .. code-block:: console
436 #. Set the PCI bus addresses to hw.nic_uio.bdfs kernel environment parameter:
438 .. code-block:: console
440 kenv hw.nic_uio.bdfs="2:0:4"
442 This automatically binds 2:0:4 to nic_uio kernel driver when it is loaded in
447 Currently, CXGBE PMD only supports the binding of PF4 for Chelsio NICs.
449 #. Load nic_uio kernel driver:
451 .. code-block:: console
453 kldload ./x86_64-native-bsdapp-clang/kmod/nic_uio.ko
455 #. Start testpmd with basic parameters:
457 .. code-block:: console
459 ./x86_64-native-bsdapp-clang/app/testpmd -l 0-3 -n 4 -w 0000:02:00.4 -- -i
463 .. code-block:: console
466 EAL: PCI device 0000:02:00.4 on NUMA socket 0
467 EAL: probe driver: 1425:5401 rte_cxgbe_pmd
468 EAL: PCI memory mapped at 0x8007ec000
469 EAL: PCI memory mapped at 0x842800000
470 EAL: PCI memory mapped at 0x80086c000
471 PMD: rte_cxgbe_pmd: fw: 1.16.43.0, TP: 0.1.4.9
472 PMD: rte_cxgbe_pmd: Coming up as MASTER: Initializing adapter
473 Interactive-mode selected
474 Configuring Port 0 (socket 0)
475 Port 0: 00:07:43:2D:EA:C0
476 Configuring Port 1 (socket 0)
477 Port 1: 00:07:43:2D:EA:C8
478 Checking link statuses...
479 PMD: rte_cxgbe_pmd: Port0: passive DA port module inserted
480 PMD: rte_cxgbe_pmd: Port1: passive DA port module inserted
481 Port 0 Link Up - speed 10000 Mbps - full-duplex
482 Port 1 Link Up - speed 10000 Mbps - full-duplex
488 Flow control pause TX/RX is disabled by default and can be enabled via
489 testpmd. Refer section :ref:`flow-control` for more details.
491 Sample Application Notes
492 ------------------------
496 Enable/Disable Flow Control
497 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
499 Flow control pause TX/RX is disabled by default and can be enabled via
502 .. code-block:: console
504 testpmd> set flow_ctrl rx on tx on 0 0 0 0 mac_ctrl_frame_fwd off autoneg on 0
505 testpmd> set flow_ctrl rx on tx on 0 0 0 0 mac_ctrl_frame_fwd off autoneg on 1
507 To disable again, run:
509 .. code-block:: console
511 testpmd> set flow_ctrl rx off tx off 0 0 0 0 mac_ctrl_frame_fwd off autoneg off 0
512 testpmd> set flow_ctrl rx off tx off 0 0 0 0 mac_ctrl_frame_fwd off autoneg off 1
517 There are two ways to enable sending and receiving of jumbo frames via testpmd.
518 One method involves using the **mtu** command, which changes the mtu of an
519 individual port without having to stop the selected port. Another method
520 involves stopping all the ports first and then running **max-pkt-len** command
521 to configure the mtu of all the ports with a single command.
523 - To configure each port individually, run the mtu command as follows:
525 .. code-block:: console
527 testpmd> port config mtu 0 9000
528 testpmd> port config mtu 1 9000
530 - To configure all the ports at once, stop all the ports first and run the
531 max-pkt-len command as follows:
533 .. code-block:: console
535 testpmd> port stop all
536 testpmd> port config all max-pkt-len 9000