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 .. _driver-compilation:
135 Driver compilation and testing
136 ------------------------------
138 Refer to the document :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
144 .. _linux-installation:
149 Steps to manually install the latest firmware from the downloaded Chelsio
150 Unified Wire package for Linux operating system are as follows:
152 #. Load the kernel module:
154 .. code-block:: console
158 #. Use ifconfig to get the interface name assigned to Chelsio card:
160 .. code-block:: console
162 ifconfig -a | grep "00:07:43"
166 .. code-block:: console
168 p1p1 Link encap:Ethernet HWaddr 00:07:43:2D:EA:C0
169 p1p2 Link encap:Ethernet HWaddr 00:07:43:2D:EA:C8
173 .. code-block:: console
175 cd <path_to_uwire>/tools/cxgbtool
178 #. Use cxgbtool to load the firmware config file onto the card:
180 .. code-block:: console
182 cxgbtool p1p1 loadcfg <path_to_uwire>/src/network/firmware/t5-config.txt
184 #. Use cxgbtool to load the firmware image onto the card:
186 .. code-block:: console
188 cxgbtool p1p1 loadfw <path_to_uwire>/src/network/firmware/t5fw-*.bin
190 #. Unload and reload the kernel module:
192 .. code-block:: console
197 #. Verify with ethtool:
199 .. code-block:: console
201 ethtool -i p1p1 | grep "firmware"
205 .. code-block:: console
207 firmware-version: 1.16.43.0, TP 0.1.4.9
212 This section demonstrates how to launch **testpmd** with Chelsio
213 devices managed by librte_pmd_cxgbe in Linux operating system.
215 #. Load the kernel module:
217 .. code-block:: console
221 #. Get the PCI bus addresses of the interfaces bound to cxgb4 driver:
223 .. code-block:: console
229 .. code-block:: console
231 cxgb4 0000:02:00.4 p1p1: renamed from eth0
232 cxgb4 0000:02:00.4 p1p2: renamed from eth1
236 Both the interfaces of a Chelsio 2-port adapter are bound to the
237 same PCI bus address.
239 #. Unload the kernel module:
241 .. code-block:: console
243 modprobe -ar cxgb4 csiostor
247 Follow instructions available in the document
248 :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
253 Currently, CXGBE PMD only supports the binding of PF4 for Chelsio NICs.
257 .. code-block:: console
260 EAL: PCI device 0000:02:00.4 on NUMA socket -1
261 EAL: probe driver: 1425:5401 rte_cxgbe_pmd
262 EAL: PCI memory mapped at 0x7fd7c0200000
263 EAL: PCI memory mapped at 0x7fd77cdfd000
264 EAL: PCI memory mapped at 0x7fd7c10b7000
265 PMD: rte_cxgbe_pmd: fw: 1.16.43.0, TP: 0.1.4.9
266 PMD: rte_cxgbe_pmd: Coming up as MASTER: Initializing adapter
267 Interactive-mode selected
268 Configuring Port 0 (socket 0)
269 Port 0: 00:07:43:2D:EA:C0
270 Configuring Port 1 (socket 0)
271 Port 1: 00:07:43:2D:EA:C8
272 Checking link statuses...
273 PMD: rte_cxgbe_pmd: Port0: passive DA port module inserted
274 PMD: rte_cxgbe_pmd: Port1: passive DA port module inserted
275 Port 0 Link Up - speed 10000 Mbps - full-duplex
276 Port 1 Link Up - speed 10000 Mbps - full-duplex
282 Flow control pause TX/RX is disabled by default and can be enabled via
283 testpmd. Refer section :ref:`flow-control` for more details.
288 .. _freebsd-installation:
293 Steps to manually install the latest firmware from the downloaded Chelsio
294 Unified Wire package for FreeBSD operating system are as follows:
296 #. Load the kernel module:
298 .. code-block:: console
302 #. Use dmesg to get the t5nex instance assigned to the Chelsio card:
304 .. code-block:: console
310 .. code-block:: console
312 t5nex0: <Chelsio T520-CR> irq 16 at device 0.4 on pci2
313 cxl0: <port 0> on t5nex0
314 cxl1: <port 1> on t5nex0
315 t5nex0: PCIe x8, 2 ports, 14 MSI-X interrupts, 31 eq, 13 iq
317 In the example above, a Chelsio T520-CR card is bound to a t5nex0 instance.
319 #. Install cxgbetool from FreeBSD source repository:
321 .. code-block:: console
323 cd <path_to_FreeBSD_source>/tools/tools/cxgbetool/
326 #. Use cxgbetool to load the firmware image onto the card:
328 .. code-block:: console
330 cxgbetool t5nex0 loadfw <path_to_uwire>/src/network/firmware/t5fw-*.bin
332 #. Unload and reload the kernel module:
334 .. code-block:: console
339 #. Verify with sysctl:
341 .. code-block:: console
343 sysctl -a | grep "t5nex" | grep "firmware"
347 .. code-block:: console
349 dev.t5nex.0.firmware_version: 1.16.43.0
354 This section demonstrates how to launch **testpmd** with Chelsio
355 devices managed by librte_pmd_cxgbe in FreeBSD operating system.
357 #. Change to DPDK source directory where the target has been compiled in
358 section :ref:`driver-compilation`:
360 .. code-block:: console
362 cd <DPDK-source-directory>
364 #. Copy the contigmem kernel module to /boot/kernel directory:
366 .. code-block:: console
368 cp x86_64-native-bsdapp-clang/kmod/contigmem.ko /boot/kernel/
370 #. Add the following lines to /boot/loader.conf:
372 .. code-block:: console
374 # reserve 2 x 1G blocks of contiguous memory using contigmem driver
375 hw.contigmem.num_buffers=2
376 hw.contigmem.buffer_size=1073741824
377 # load contigmem module during boot process
380 The above lines load the contigmem kernel module during boot process and
381 allocate 2 x 1G blocks of contiguous memory to be used for DPDK later on.
382 This is to avoid issues with potential memory fragmentation during later
383 system up time, which may result in failure of allocating the contiguous
384 memory required for the contigmem kernel module.
386 #. Restart the system and ensure the contigmem module is loaded successfully:
388 .. code-block:: console
391 kldstat | grep "contigmem"
395 .. code-block:: console
397 2 1 0xffffffff817f1000 3118 contigmem.ko
399 #. Repeat step 1 to ensure that you are in the DPDK source directory.
401 #. Load the cxgbe kernel module:
403 .. code-block:: console
407 #. Get the PCI bus addresses of the interfaces bound to t5nex driver:
409 .. code-block:: console
411 pciconf -l | grep "t5nex"
415 .. code-block:: console
417 t5nex0@pci0:2:0:4: class=0x020000 card=0x00001425 chip=0x54011425 rev=0x00
419 In the above example, the t5nex0 is bound to 2:0:4 bus address.
423 Both the interfaces of a Chelsio 2-port adapter are bound to the
424 same PCI bus address.
426 #. Unload the kernel module:
428 .. code-block:: console
432 #. Set the PCI bus addresses to hw.nic_uio.bdfs kernel environment parameter:
434 .. code-block:: console
436 kenv hw.nic_uio.bdfs="2:0:4"
438 This automatically binds 2:0:4 to nic_uio kernel driver when it is loaded in
443 Currently, CXGBE PMD only supports the binding of PF4 for Chelsio NICs.
445 #. Load nic_uio kernel driver:
447 .. code-block:: console
449 kldload ./x86_64-native-bsdapp-clang/kmod/nic_uio.ko
451 #. Start testpmd with basic parameters:
453 .. code-block:: console
455 ./x86_64-native-bsdapp-clang/app/testpmd -l 0-3 -n 4 -w 0000:02:00.4 -- -i
459 .. code-block:: console
462 EAL: PCI device 0000:02:00.4 on NUMA socket 0
463 EAL: probe driver: 1425:5401 rte_cxgbe_pmd
464 EAL: PCI memory mapped at 0x8007ec000
465 EAL: PCI memory mapped at 0x842800000
466 EAL: PCI memory mapped at 0x80086c000
467 PMD: rte_cxgbe_pmd: fw: 1.16.43.0, TP: 0.1.4.9
468 PMD: rte_cxgbe_pmd: Coming up as MASTER: Initializing adapter
469 Interactive-mode selected
470 Configuring Port 0 (socket 0)
471 Port 0: 00:07:43:2D:EA:C0
472 Configuring Port 1 (socket 0)
473 Port 1: 00:07:43:2D:EA:C8
474 Checking link statuses...
475 PMD: rte_cxgbe_pmd: Port0: passive DA port module inserted
476 PMD: rte_cxgbe_pmd: Port1: passive DA port module inserted
477 Port 0 Link Up - speed 10000 Mbps - full-duplex
478 Port 1 Link Up - speed 10000 Mbps - full-duplex
484 Flow control pause TX/RX is disabled by default and can be enabled via
485 testpmd. Refer section :ref:`flow-control` for more details.
487 Sample Application Notes
488 ------------------------
492 Enable/Disable Flow Control
493 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
495 Flow control pause TX/RX is disabled by default and can be enabled via
498 .. code-block:: console
500 testpmd> set flow_ctrl rx on tx on 0 0 0 0 mac_ctrl_frame_fwd off autoneg on 0
501 testpmd> set flow_ctrl rx on tx on 0 0 0 0 mac_ctrl_frame_fwd off autoneg on 1
503 To disable again, run:
505 .. code-block:: console
507 testpmd> set flow_ctrl rx off tx off 0 0 0 0 mac_ctrl_frame_fwd off autoneg off 0
508 testpmd> set flow_ctrl rx off tx off 0 0 0 0 mac_ctrl_frame_fwd off autoneg off 1
513 There are two ways to enable sending and receiving of jumbo frames via testpmd.
514 One method involves using the **mtu** command, which changes the mtu of an
515 individual port without having to stop the selected port. Another method
516 involves stopping all the ports first and then running **max-pkt-len** command
517 to configure the mtu of all the ports with a single command.
519 - To configure each port individually, run the mtu command as follows:
521 .. code-block:: console
523 testpmd> port config mtu 0 9000
524 testpmd> port config mtu 1 9000
526 - To configure all the ports at once, stop all the ports first and run the
527 max-pkt-len command as follows:
529 .. code-block:: console
531 testpmd> port stop all
532 testpmd> port config all max-pkt-len 9000