xref: /dpdk/doc/guides/nics/cxgbe.rst (revision b583b9a1bb49e86aa0937d55415713282000c536)
12aa5c722SRahul Lakkireddy.. SPDX-License-Identifier: BSD-3-Clause
22aa5c722SRahul Lakkireddy   Copyright(c) 2014-2018 Chelsio Communications.
34d84a97dSRahul Lakkireddy   All rights reserved.
44d84a97dSRahul Lakkireddy
54d84a97dSRahul LakkireddyCXGBE Poll Mode Driver
64d84a97dSRahul Lakkireddy======================
74d84a97dSRahul Lakkireddy
88809f78cSBruce RichardsonThe CXGBE PMD (**librte_net_cxgbe**) provides poll mode driver support
904868e5bSRahul Lakkireddyfor **Chelsio Terminator** 10/25/40/100 Gbps family of adapters. CXGBE PMD
1004868e5bSRahul Lakkireddyhas support for the latest Linux and FreeBSD operating systems.
114d84a97dSRahul Lakkireddy
12a9e3e999SKumar SanghviCXGBEVF PMD provides poll mode driver support for SR-IOV Virtual functions
13a9e3e999SKumar Sanghviand has support for the latest Linux operating systems.
14a9e3e999SKumar Sanghvi
15652bfba0SRahul LakkireddyMore information can be found at `Chelsio Communications Official Website
164d84a97dSRahul Lakkireddy<http://www.chelsio.com>`_.
174d84a97dSRahul Lakkireddy
18a9e3e999SKumar Sanghvi.. _t5-nics:
19a9e3e999SKumar Sanghvi
20652bfba0SRahul LakkireddySupported Chelsio T5 NICs
21652bfba0SRahul Lakkireddy-------------------------
224d84a97dSRahul Lakkireddy
23652bfba0SRahul Lakkireddy- 1G NICs: T502-BT
24652bfba0SRahul Lakkireddy- 10G NICs: T520-BT, T520-CR, T520-LL-CR, T520-SO-CR, T540-CR
25652bfba0SRahul Lakkireddy- 40G NICs: T580-CR, T580-LP-CR, T580-SO-CR
26652bfba0SRahul Lakkireddy- Other T5 NICs: T522-CR
274d84a97dSRahul Lakkireddy
28a9e3e999SKumar Sanghvi.. _t6-nics:
29a9e3e999SKumar Sanghvi
3004868e5bSRahul LakkireddySupported Chelsio T6 NICs
3104868e5bSRahul Lakkireddy-------------------------
3204868e5bSRahul Lakkireddy
3304868e5bSRahul Lakkireddy- 25G NICs: T6425-CR, T6225-CR, T6225-LL-CR, T6225-SO-CR
3404868e5bSRahul Lakkireddy- 100G NICs: T62100-CR, T62100-LP-CR, T62100-SO-CR
3504868e5bSRahul Lakkireddy
36a9e3e999SKumar SanghviSupported SR-IOV Chelsio NICs
37a9e3e999SKumar Sanghvi-----------------------------
38a9e3e999SKumar Sanghvi
39a9e3e999SKumar SanghviSR-IOV virtual functions are supported on all the Chelsio NICs listed
40a9e3e999SKumar Sanghviin :ref:`t5-nics` and :ref:`t6-nics`.
41a9e3e999SKumar Sanghvi
42*b583b9a1SFerruh YigitFeatures
43*b583b9a1SFerruh Yigit--------
44*b583b9a1SFerruh Yigit
45*b583b9a1SFerruh YigitCXGBE and CXGBEVF PMD has support for:
46*b583b9a1SFerruh Yigit
47*b583b9a1SFerruh Yigit- Multiple queues for TX and RX
48*b583b9a1SFerruh Yigit- Receiver Side Steering (RSS)
49*b583b9a1SFerruh Yigit  Receiver Side Steering (RSS) on IPv4, IPv6, IPv4-TCP/UDP, IPv6-TCP/UDP.
50*b583b9a1SFerruh Yigit  For 4-tuple, enabling 'RSS on TCP' and 'RSS on TCP + UDP' is supported.
51*b583b9a1SFerruh Yigit- VLAN filtering
52*b583b9a1SFerruh Yigit- Checksum offload
53*b583b9a1SFerruh Yigit- Promiscuous mode
54*b583b9a1SFerruh Yigit- All multicast mode
55*b583b9a1SFerruh Yigit- Port hardware statistics
56*b583b9a1SFerruh Yigit- Jumbo frames
57*b583b9a1SFerruh Yigit- Flow API - Support for both Wildcard (LE-TCAM) and Exact (HASH) match filters.
58*b583b9a1SFerruh Yigit
594d84a97dSRahul LakkireddyPrerequisites
604d84a97dSRahul Lakkireddy-------------
614d84a97dSRahul Lakkireddy
62422d7823SRahul Lakkireddy- Requires firmware version **1.25.6.0** and higher. Visit
638ec019a9SRahul Lakkireddy  `Chelsio Download Center <http://service.chelsio.com>`_ to get latest firmware
6431c79ec5SRahul Lakkireddy  bundled with the latest Chelsio Unified Wire package.
6531c79ec5SRahul Lakkireddy
6631c79ec5SRahul Lakkireddy  For Linux, installing and loading the latest cxgb4 kernel driver from the
6731c79ec5SRahul Lakkireddy  Chelsio Unified Wire package should get you the latest firmware. More
6831c79ec5SRahul Lakkireddy  information can be obtained from the User Guide that is bundled with the
6931c79ec5SRahul Lakkireddy  Chelsio Unified Wire package.
7031c79ec5SRahul Lakkireddy
7131c79ec5SRahul Lakkireddy  For FreeBSD, the latest firmware obtained from the Chelsio Unified Wire
7231c79ec5SRahul Lakkireddy  package must be manually flashed via cxgbetool available in FreeBSD source
7331c79ec5SRahul Lakkireddy  repository.
7431c79ec5SRahul Lakkireddy
7531c79ec5SRahul Lakkireddy  Instructions on how to manually flash the firmware are given in section
7631c79ec5SRahul Lakkireddy  :ref:`linux-installation` for Linux and section :ref:`freebsd-installation`
7731c79ec5SRahul Lakkireddy  for FreeBSD.
788ec019a9SRahul Lakkireddy
79a9e3e999SKumar Sanghvi
80*b583b9a1SFerruh YigitRuntime Configuration
81*b583b9a1SFerruh Yigit---------------------
82cda260a4SShagun Agrawal
83cda260a4SShagun AgrawalThe following ``devargs`` options can be enabled at runtime. They must
84cda260a4SShagun Agrawalbe passed as part of EAL arguments. For example,
85cda260a4SShagun Agrawal
86cda260a4SShagun Agrawal.. code-block:: console
87cda260a4SShagun Agrawal
88db27370bSStephen Hemminger   dpdk-testpmd -a 02:00.4,keep_ovlan=1 -- -i
89cda260a4SShagun Agrawal
90dd7c9f12SRahul LakkireddyCommon Runtime Options
9168d99d00SCiara Power~~~~~~~~~~~~~~~~~~~~~~
92dd7c9f12SRahul Lakkireddy
93cda260a4SShagun Agrawal- ``keep_ovlan`` (default **0**)
94cda260a4SShagun Agrawal
95d629b7b5SJohn McNamara  Toggle behavior to keep/strip outer VLAN in Q-in-Q packets. If
96cda260a4SShagun Agrawal  enabled, the outer VLAN tag is preserved in Q-in-Q packets. Otherwise,
97cda260a4SShagun Agrawal  the outer VLAN tag is stripped in Q-in-Q packets.
98cda260a4SShagun Agrawal
99fa033437SRahul Lakkireddy- ``tx_mode_latency`` (default **0**)
100fa033437SRahul Lakkireddy
101fa033437SRahul Lakkireddy  When set to 1, Tx doesn't wait for max number of packets to get
102fa033437SRahul Lakkireddy  coalesced and sends the packets immediately at the end of the
103fa033437SRahul Lakkireddy  current Tx burst. When set to 0, Tx waits across multiple Tx bursts
104fa033437SRahul Lakkireddy  until the max number of packets have been coalesced. In this case,
105fa033437SRahul Lakkireddy  Tx only sends the coalesced packets to hardware once the max
106fa033437SRahul Lakkireddy  coalesce limit has been reached.
107fa033437SRahul Lakkireddy
108dd7c9f12SRahul LakkireddyCXGBE VF Only Runtime Options
10968d99d00SCiara Power~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110dd7c9f12SRahul Lakkireddy
111f5b3c7b2SShagun Agrawal- ``force_link_up`` (default **0**)
112f5b3c7b2SShagun Agrawal
113f5b3c7b2SShagun Agrawal  When set to 1, CXGBEVF PMD always forces link as up for all VFs on
114f5b3c7b2SShagun Agrawal  underlying Chelsio NICs. This enables multiple VFs on the same NIC
115f5b3c7b2SShagun Agrawal  to send traffic to each other even when the physical link is down.
116f5b3c7b2SShagun Agrawal
117536db938SKarra SatwikCXGBE PF Only Runtime Options
11868d99d00SCiara Power~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119536db938SKarra Satwik
120536db938SKarra Satwik- ``filtermode`` (default **0**)
121536db938SKarra Satwik
122536db938SKarra Satwik  Apart from the 4-tuple (IP src/dst addresses and TCP/UDP src/dst port
123536db938SKarra Satwik  addresses), there are only 40-bits available to match other fields in
124536db938SKarra Satwik  packet headers. So, ``filtermode`` devarg allows user to dynamically
125536db938SKarra Satwik  select a 40-bit supported match field combination for LETCAM (wildcard)
126536db938SKarra Satwik  filters.
127536db938SKarra Satwik
128536db938SKarra Satwik  Default value of **0** makes driver pick the combination configured in
129536db938SKarra Satwik  the firmware configuration file on the adapter.
130536db938SKarra Satwik
131536db938SKarra Satwik  The supported flags and their corresponding values are shown in table below.
132536db938SKarra Satwik  These flags can be OR'd to create 1 of the multiple supported combinations
133536db938SKarra Satwik  for LETCAM filters.
134536db938SKarra Satwik
135536db938SKarra Satwik        ==================      ======
136536db938SKarra Satwik        FLAG                    VALUE
137536db938SKarra Satwik        ==================      ======
138536db938SKarra Satwik        Physical Port           0x1
139536db938SKarra Satwik        PFVF                    0x2
140536db938SKarra Satwik        Destination MAC         0x4
141536db938SKarra Satwik        Ethertype               0x8
142536db938SKarra Satwik        Inner VLAN              0x10
143536db938SKarra Satwik        Outer VLAN              0x20
144536db938SKarra Satwik        IP TOS                  0x40
145536db938SKarra Satwik        IP Protocol             0x80
146536db938SKarra Satwik        ==================      ======
147536db938SKarra Satwik
148536db938SKarra Satwik  The supported ``filtermode`` combinations and their corresponding OR'd
149536db938SKarra Satwik  values are shown in table below.
150536db938SKarra Satwik
151536db938SKarra Satwik        +-----------------------------------+-----------+
152536db938SKarra Satwik        | FILTERMODE COMBINATIONS           |   VALUE   |
153536db938SKarra Satwik        +===================================+===========+
154536db938SKarra Satwik        | Protocol, TOS, Outer VLAN, Port   |     0xE1  |
155536db938SKarra Satwik        +-----------------------------------+-----------+
156536db938SKarra Satwik        | Protocol, TOS, Outer VLAN         |     0xE0  |
157536db938SKarra Satwik        +-----------------------------------+-----------+
158536db938SKarra Satwik        | Protocol, TOS, Inner VLAN, Port   |     0xD1  |
159536db938SKarra Satwik        +-----------------------------------+-----------+
160536db938SKarra Satwik        | Protocol, TOS, Inner VLAN         |     0xD0  |
161536db938SKarra Satwik        +-----------------------------------+-----------+
162536db938SKarra Satwik        | Protocol, TOS, PFVF, Port         |     0xC3  |
163536db938SKarra Satwik        +-----------------------------------+-----------+
164536db938SKarra Satwik        | Protocol, TOS, PFVF               |     0xC2  |
165536db938SKarra Satwik        +-----------------------------------+-----------+
166536db938SKarra Satwik        | Protocol, TOS, Port               |     0xC1  |
167536db938SKarra Satwik        +-----------------------------------+-----------+
168536db938SKarra Satwik        | Protocol, TOS                     |     0xC0  |
169536db938SKarra Satwik        +-----------------------------------+-----------+
170536db938SKarra Satwik        | Protocol, Outer VLAN, Port        |     0xA1  |
171536db938SKarra Satwik        +-----------------------------------+-----------+
172536db938SKarra Satwik        | Protocol, Outer VLAN              |     0xA0  |
173536db938SKarra Satwik        +-----------------------------------+-----------+
174536db938SKarra Satwik        | Protocol, Inner VLAN, Port        |     0x91  |
175536db938SKarra Satwik        +-----------------------------------+-----------+
176536db938SKarra Satwik        | Protocol, Inner VLAN              |     0x90  |
177536db938SKarra Satwik        +-----------------------------------+-----------+
178536db938SKarra Satwik        | Protocol, Ethertype, DstMAC, Port |     0x8D  |
179536db938SKarra Satwik        +-----------------------------------+-----------+
180536db938SKarra Satwik        | Protocol, Ethertype, DstMAC       |     0x8C  |
181536db938SKarra Satwik        +-----------------------------------+-----------+
182536db938SKarra Satwik        | Protocol, Ethertype, Port         |     0x89  |
183536db938SKarra Satwik        +-----------------------------------+-----------+
184536db938SKarra Satwik        | Protocol, Ethertype               |     0x88  |
185536db938SKarra Satwik        +-----------------------------------+-----------+
186536db938SKarra Satwik        | Protocol, DstMAC, PFVF, Port      |     0x87  |
187536db938SKarra Satwik        +-----------------------------------+-----------+
188536db938SKarra Satwik        | Protocol, DstMAC, PFVF            |     0x86  |
189536db938SKarra Satwik        +-----------------------------------+-----------+
190536db938SKarra Satwik        | Protocol, DstMAC, Port            |     0x85  |
191536db938SKarra Satwik        +-----------------------------------+-----------+
192536db938SKarra Satwik        | Protocol, DstMAC                  |     0x84  |
193536db938SKarra Satwik        +-----------------------------------+-----------+
194536db938SKarra Satwik        | Protocol, PFVF, Port              |     0x83  |
195536db938SKarra Satwik        +-----------------------------------+-----------+
196536db938SKarra Satwik        | Protocol, PFVF                    |     0x82  |
197536db938SKarra Satwik        +-----------------------------------+-----------+
198536db938SKarra Satwik        | Protocol, Port                    |     0x81  |
199536db938SKarra Satwik        +-----------------------------------+-----------+
200536db938SKarra Satwik        | Protocol                          |     0x80  |
201536db938SKarra Satwik        +-----------------------------------+-----------+
202536db938SKarra Satwik        | TOS, Outer VLAN, Port             |     0x61  |
203536db938SKarra Satwik        +-----------------------------------+-----------+
204536db938SKarra Satwik        | TOS, Outer VLAN                   |     0x60  |
205536db938SKarra Satwik        +-----------------------------------+-----------+
206536db938SKarra Satwik        | TOS, Inner VLAN, Port             |     0x51  |
207536db938SKarra Satwik        +-----------------------------------+-----------+
208536db938SKarra Satwik        | TOS, Inner VLAN                   |     0x50  |
209536db938SKarra Satwik        +-----------------------------------+-----------+
210536db938SKarra Satwik        | TOS, Ethertype, DstMAC, Port      |     0x4D  |
211536db938SKarra Satwik        +-----------------------------------+-----------+
212536db938SKarra Satwik        | TOS, Ethertype, DstMAC            |     0x4C  |
213536db938SKarra Satwik        +-----------------------------------+-----------+
214536db938SKarra Satwik        | TOS, Ethertype, Port              |     0x49  |
215536db938SKarra Satwik        +-----------------------------------+-----------+
216536db938SKarra Satwik        | TOS, Ethertype                    |     0x48  |
217536db938SKarra Satwik        +-----------------------------------+-----------+
218536db938SKarra Satwik        | TOS, DstMAC, PFVF, Port           |     0x47  |
219536db938SKarra Satwik        +-----------------------------------+-----------+
220536db938SKarra Satwik        | TOS, DstMAC, PFVF                 |     0x46  |
221536db938SKarra Satwik        +-----------------------------------+-----------+
222536db938SKarra Satwik        | TOS, DstMAC, Port                 |     0x45  |
223536db938SKarra Satwik        +-----------------------------------+-----------+
224536db938SKarra Satwik        | TOS, DstMAC                       |     0x44  |
225536db938SKarra Satwik        +-----------------------------------+-----------+
226536db938SKarra Satwik        | TOS, PFVF, Port                   |     0x43  |
227536db938SKarra Satwik        +-----------------------------------+-----------+
228536db938SKarra Satwik        | TOS, PFVF                         |     0x42  |
229536db938SKarra Satwik        +-----------------------------------+-----------+
230536db938SKarra Satwik        | TOS, Port                         |     0x41  |
231536db938SKarra Satwik        +-----------------------------------+-----------+
232536db938SKarra Satwik        | TOS                               |     0x40  |
233536db938SKarra Satwik        +-----------------------------------+-----------+
234536db938SKarra Satwik        | Outer VLAN, Inner VLAN, Port      |     0x31  |
235536db938SKarra Satwik        +-----------------------------------+-----------+
236536db938SKarra Satwik        | Outer VLAN, Ethertype, Port       |     0x29  |
237536db938SKarra Satwik        +-----------------------------------+-----------+
238536db938SKarra Satwik        | Outer VLAN, Ethertype             |     0x28  |
239536db938SKarra Satwik        +-----------------------------------+-----------+
240536db938SKarra Satwik        | Outer VLAN, DstMAC, Port          |     0x25  |
241536db938SKarra Satwik        +-----------------------------------+-----------+
242536db938SKarra Satwik        | Outer VLAN, DstMAC                |     0x24  |
243536db938SKarra Satwik        +-----------------------------------+-----------+
244536db938SKarra Satwik        | Outer VLAN, Port                  |     0x21  |
245536db938SKarra Satwik        +-----------------------------------+-----------+
246536db938SKarra Satwik        | Outer VLAN                        |     0x20  |
247536db938SKarra Satwik        +-----------------------------------+-----------+
248536db938SKarra Satwik        | Inner VLAN, Ethertype, Port       |     0x19  |
249536db938SKarra Satwik        +-----------------------------------+-----------+
250536db938SKarra Satwik        | Inner VLAN, Ethertype             |     0x18  |
251536db938SKarra Satwik        +-----------------------------------+-----------+
252536db938SKarra Satwik        | Inner VLAN, DstMAC, Port          |     0x15  |
253536db938SKarra Satwik        +-----------------------------------+-----------+
254536db938SKarra Satwik        | Inner VLAN, DstMAC                |     0x14  |
255536db938SKarra Satwik        +-----------------------------------+-----------+
256536db938SKarra Satwik        | Inner VLAN, Port                  |     0x11  |
257536db938SKarra Satwik        +-----------------------------------+-----------+
258536db938SKarra Satwik        | Inner VLAN                        |     0x10  |
259536db938SKarra Satwik        +-----------------------------------+-----------+
260536db938SKarra Satwik        | Ethertype, DstMAC, Port           |     0xD   |
261536db938SKarra Satwik        +-----------------------------------+-----------+
262536db938SKarra Satwik        | Ethertype, DstMAC                 |     0xC   |
263536db938SKarra Satwik        +-----------------------------------+-----------+
264536db938SKarra Satwik        | Ethertype, PFVF, Port             |     0xB   |
265536db938SKarra Satwik        +-----------------------------------+-----------+
266536db938SKarra Satwik        | Ethertype, PFVF                   |     0xA   |
267536db938SKarra Satwik        +-----------------------------------+-----------+
268536db938SKarra Satwik        | Ethertype, Port                   |     0x9   |
269536db938SKarra Satwik        +-----------------------------------+-----------+
270536db938SKarra Satwik        | Ethertype                         |     0x8   |
271536db938SKarra Satwik        +-----------------------------------+-----------+
272536db938SKarra Satwik        | DstMAC, PFVF, Port                |     0x7   |
273536db938SKarra Satwik        +-----------------------------------+-----------+
274536db938SKarra Satwik        | DstMAC, PFVF                      |     0x6   |
275536db938SKarra Satwik        +-----------------------------------+-----------+
276536db938SKarra Satwik        | DstMAC, Port                      |     0x5   |
277536db938SKarra Satwik        +-----------------------------------+-----------+
278536db938SKarra Satwik        | Destination MAC                   |     0x4   |
279536db938SKarra Satwik        +-----------------------------------+-----------+
280536db938SKarra Satwik        | PFVF, Port                        |     0x3   |
281536db938SKarra Satwik        +-----------------------------------+-----------+
282536db938SKarra Satwik        | PFVF                              |     0x2   |
283536db938SKarra Satwik        +-----------------------------------+-----------+
284536db938SKarra Satwik        | Physical Port                     |     0x1   +
285536db938SKarra Satwik        +-----------------------------------+-----------+
286536db938SKarra Satwik
287536db938SKarra Satwik  For example, to enable matching ``ethertype`` field in Ethernet
288536db938SKarra Satwik  header, and ``protocol`` field in IPv4 header, the ``filtermode``
289536db938SKarra Satwik  combination must be given as:
290536db938SKarra Satwik
291536db938SKarra Satwik  .. code-block:: console
292536db938SKarra Satwik
293db27370bSStephen Hemminger     dpdk-testpmd -a 02:00.4,filtermode=0x88 -- -i
294536db938SKarra Satwik
295536db938SKarra Satwik- ``filtermask`` (default **0**)
296536db938SKarra Satwik
297536db938SKarra Satwik  ``filtermask`` devarg works similar to ``filtermode``, but is used
298536db938SKarra Satwik  to configure a filter mode combination for HASH (exact-match) filters.
299536db938SKarra Satwik
300536db938SKarra Satwik  .. note::
301536db938SKarra Satwik
302536db938SKarra Satwik     The combination chosen for ``filtermask`` devarg **must be a subset** of
303536db938SKarra Satwik     the combination chosen for ``filtermode`` devarg.
304536db938SKarra Satwik
305536db938SKarra Satwik  Default value of **0** makes driver pick the combination configured in
306536db938SKarra Satwik  the firmware configuration file on the adapter.
307536db938SKarra Satwik
308536db938SKarra Satwik  Note that the filter rule will only be inserted in HASH region, if the
309536db938SKarra Satwik  rule contains **all** the fields specified in the ``filtermask`` combination.
310536db938SKarra Satwik  Otherwise, the filter rule will get inserted in LETCAM region.
311536db938SKarra Satwik
312536db938SKarra Satwik  The same combination list explained in the tables in ``filtermode`` devarg
313536db938SKarra Satwik  section earlier applies for ``filtermask`` devarg, as well.
314536db938SKarra Satwik
315536db938SKarra Satwik  For example, to enable matching only protocol field in IPv4 header, the
316536db938SKarra Satwik  ``filtermask`` combination must be given as:
317536db938SKarra Satwik
318536db938SKarra Satwik  .. code-block:: console
319536db938SKarra Satwik
320db27370bSStephen Hemminger     dpdk-testpmd -a 02:00.4,filtermode=0x88,filtermask=0x80 -- -i
321536db938SKarra Satwik
32231c79ec5SRahul Lakkireddy.. _driver-compilation:
32331c79ec5SRahul Lakkireddy
324f011ba1eSShijith ThottonDriver compilation and testing
325f011ba1eSShijith Thotton------------------------------
326652bfba0SRahul Lakkireddy
327f011ba1eSShijith ThottonRefer to the document :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
328f011ba1eSShijith Thottonfor details.
32931c79ec5SRahul Lakkireddy
33031c79ec5SRahul LakkireddyLinux
33131c79ec5SRahul Lakkireddy-----
33231c79ec5SRahul Lakkireddy
33331c79ec5SRahul Lakkireddy.. _linux-installation:
33431c79ec5SRahul Lakkireddy
33531c79ec5SRahul LakkireddyLinux Installation
33631c79ec5SRahul Lakkireddy~~~~~~~~~~~~~~~~~~
33731c79ec5SRahul Lakkireddy
33831c79ec5SRahul LakkireddySteps to manually install the latest firmware from the downloaded Chelsio
33931c79ec5SRahul LakkireddyUnified Wire package for Linux operating system are as follows:
3408ec019a9SRahul Lakkireddy
3418ec019a9SRahul Lakkireddy#. Load the kernel module:
3428ec019a9SRahul Lakkireddy
3438ec019a9SRahul Lakkireddy   .. code-block:: console
3448ec019a9SRahul Lakkireddy
3458ec019a9SRahul Lakkireddy      modprobe cxgb4
3468ec019a9SRahul Lakkireddy
3478ec019a9SRahul Lakkireddy#. Use ifconfig to get the interface name assigned to Chelsio card:
3488ec019a9SRahul Lakkireddy
3498ec019a9SRahul Lakkireddy   .. code-block:: console
3508ec019a9SRahul Lakkireddy
3518ec019a9SRahul Lakkireddy      ifconfig -a | grep "00:07:43"
3528ec019a9SRahul Lakkireddy
3538ec019a9SRahul Lakkireddy   Example output:
3548ec019a9SRahul Lakkireddy
3558ec019a9SRahul Lakkireddy   .. code-block:: console
3568ec019a9SRahul Lakkireddy
3578ec019a9SRahul Lakkireddy      p1p1      Link encap:Ethernet  HWaddr 00:07:43:2D:EA:C0
3588ec019a9SRahul Lakkireddy      p1p2      Link encap:Ethernet  HWaddr 00:07:43:2D:EA:C8
3598ec019a9SRahul Lakkireddy
3608ec019a9SRahul Lakkireddy#. Install cxgbtool:
3618ec019a9SRahul Lakkireddy
3628ec019a9SRahul Lakkireddy   .. code-block:: console
3638ec019a9SRahul Lakkireddy
3648ec019a9SRahul Lakkireddy      cd <path_to_uwire>/tools/cxgbtool
3658ec019a9SRahul Lakkireddy      make install
3668ec019a9SRahul Lakkireddy
3678ec019a9SRahul Lakkireddy#. Use cxgbtool to load the firmware config file onto the card:
3688ec019a9SRahul Lakkireddy
3698ec019a9SRahul Lakkireddy   .. code-block:: console
3708ec019a9SRahul Lakkireddy
3718ec019a9SRahul Lakkireddy      cxgbtool p1p1 loadcfg <path_to_uwire>/src/network/firmware/t5-config.txt
3728ec019a9SRahul Lakkireddy
3738ec019a9SRahul Lakkireddy#. Use cxgbtool to load the firmware image onto the card:
3748ec019a9SRahul Lakkireddy
3758ec019a9SRahul Lakkireddy   .. code-block:: console
3768ec019a9SRahul Lakkireddy
3778ec019a9SRahul Lakkireddy      cxgbtool p1p1 loadfw <path_to_uwire>/src/network/firmware/t5fw-*.bin
3788ec019a9SRahul Lakkireddy
37931c79ec5SRahul Lakkireddy#. Unload and reload the kernel module:
38031c79ec5SRahul Lakkireddy
38131c79ec5SRahul Lakkireddy   .. code-block:: console
38231c79ec5SRahul Lakkireddy
38331c79ec5SRahul Lakkireddy      modprobe -r cxgb4
38431c79ec5SRahul Lakkireddy      modprobe cxgb4
38531c79ec5SRahul Lakkireddy
3868ec019a9SRahul Lakkireddy#. Verify with ethtool:
3878ec019a9SRahul Lakkireddy
3888ec019a9SRahul Lakkireddy   .. code-block:: console
3898ec019a9SRahul Lakkireddy
3908ec019a9SRahul Lakkireddy      ethtool -i p1p1 | grep "firmware"
3918ec019a9SRahul Lakkireddy
3928ec019a9SRahul Lakkireddy   Example output:
3938ec019a9SRahul Lakkireddy
3948ec019a9SRahul Lakkireddy   .. code-block:: console
3958ec019a9SRahul Lakkireddy
396422d7823SRahul Lakkireddy      firmware-version: 1.25.6.0, TP 0.1.23.2
3978ec019a9SRahul Lakkireddy
39814b094a4SRahul LakkireddyRunning testpmd
39914b094a4SRahul Lakkireddy~~~~~~~~~~~~~~~
4004d84a97dSRahul Lakkireddy
40104868e5bSRahul LakkireddyThis section demonstrates how to launch **testpmd** with Chelsio
4028809f78cSBruce Richardsondevices managed by librte_net_cxgbe in Linux operating system.
40331c79ec5SRahul Lakkireddy
4044d84a97dSRahul Lakkireddy#. Load the kernel module:
4054d84a97dSRahul Lakkireddy
4064d84a97dSRahul Lakkireddy   .. code-block:: console
4074d84a97dSRahul Lakkireddy
4084d84a97dSRahul Lakkireddy      modprobe cxgb4
4094d84a97dSRahul Lakkireddy
4104d84a97dSRahul Lakkireddy#. Get the PCI bus addresses of the interfaces bound to cxgb4 driver:
4114d84a97dSRahul Lakkireddy
4124d84a97dSRahul Lakkireddy   .. code-block:: console
4134d84a97dSRahul Lakkireddy
4144d84a97dSRahul Lakkireddy      dmesg | tail -2
4154d84a97dSRahul Lakkireddy
4164d84a97dSRahul Lakkireddy   Example output:
4174d84a97dSRahul Lakkireddy
4184d84a97dSRahul Lakkireddy   .. code-block:: console
4194d84a97dSRahul Lakkireddy
4204d84a97dSRahul Lakkireddy      cxgb4 0000:02:00.4 p1p1: renamed from eth0
4214d84a97dSRahul Lakkireddy      cxgb4 0000:02:00.4 p1p2: renamed from eth1
4224d84a97dSRahul Lakkireddy
4234d84a97dSRahul Lakkireddy   .. note::
4244d84a97dSRahul Lakkireddy
42504868e5bSRahul Lakkireddy      Both the interfaces of a Chelsio 2-port adapter are bound to the
4264d84a97dSRahul Lakkireddy      same PCI bus address.
4274d84a97dSRahul Lakkireddy
4284d84a97dSRahul Lakkireddy#. Unload the kernel module:
4294d84a97dSRahul Lakkireddy
4304d84a97dSRahul Lakkireddy   .. code-block:: console
4314d84a97dSRahul Lakkireddy
4324d84a97dSRahul Lakkireddy      modprobe -ar cxgb4 csiostor
4334d84a97dSRahul Lakkireddy
434f011ba1eSShijith Thotton#. Running testpmd
4354d84a97dSRahul Lakkireddy
436f011ba1eSShijith Thotton   Follow instructions available in the document
437f011ba1eSShijith Thotton   :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
438f011ba1eSShijith Thotton   to run testpmd.
4394d84a97dSRahul Lakkireddy
440652bfba0SRahul Lakkireddy   .. note::
441652bfba0SRahul Lakkireddy
44204868e5bSRahul Lakkireddy      Currently, CXGBE PMD only supports the binding of PF4 for Chelsio NICs.
443652bfba0SRahul Lakkireddy
4444d84a97dSRahul Lakkireddy   Example output:
4454d84a97dSRahul Lakkireddy
4464d84a97dSRahul Lakkireddy   .. code-block:: console
4474d84a97dSRahul Lakkireddy
4484d84a97dSRahul Lakkireddy      [...]
4494d84a97dSRahul Lakkireddy      EAL: PCI device 0000:02:00.4 on NUMA socket -1
4504d84a97dSRahul Lakkireddy      EAL:   probe driver: 1425:5401 rte_cxgbe_pmd
4514d84a97dSRahul Lakkireddy      EAL:   PCI memory mapped at 0x7fd7c0200000
4524d84a97dSRahul Lakkireddy      EAL:   PCI memory mapped at 0x7fd77cdfd000
4534d84a97dSRahul Lakkireddy      EAL:   PCI memory mapped at 0x7fd7c10b7000
454422d7823SRahul Lakkireddy      PMD: rte_cxgbe_pmd: fw: 1.25.6.0, TP: 0.1.23.2
45531c79ec5SRahul Lakkireddy      PMD: rte_cxgbe_pmd: Coming up as MASTER: Initializing adapter
45631c79ec5SRahul Lakkireddy      Interactive-mode selected
45731c79ec5SRahul Lakkireddy      Configuring Port 0 (socket 0)
45831c79ec5SRahul Lakkireddy      Port 0: 00:07:43:2D:EA:C0
45931c79ec5SRahul Lakkireddy      Configuring Port 1 (socket 0)
46031c79ec5SRahul Lakkireddy      Port 1: 00:07:43:2D:EA:C8
46131c79ec5SRahul Lakkireddy      Checking link statuses...
46231c79ec5SRahul Lakkireddy      PMD: rte_cxgbe_pmd: Port0: passive DA port module inserted
46331c79ec5SRahul Lakkireddy      PMD: rte_cxgbe_pmd: Port1: passive DA port module inserted
46431c79ec5SRahul Lakkireddy      Port 0 Link Up - speed 10000 Mbps - full-duplex
46531c79ec5SRahul Lakkireddy      Port 1 Link Up - speed 10000 Mbps - full-duplex
46631c79ec5SRahul Lakkireddy      Done
46731c79ec5SRahul Lakkireddy      testpmd>
46831c79ec5SRahul Lakkireddy
46931c79ec5SRahul Lakkireddy   .. note::
47031c79ec5SRahul Lakkireddy
47131c79ec5SRahul Lakkireddy      Flow control pause TX/RX is disabled by default and can be enabled via
47214b094a4SRahul Lakkireddy      testpmd. Refer section :ref:`flow-control` for more details.
47331c79ec5SRahul Lakkireddy
474a9e3e999SKumar SanghviConfiguring SR-IOV Virtual Functions
475a9e3e999SKumar Sanghvi~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
476a9e3e999SKumar Sanghvi
477a9e3e999SKumar SanghviThis section demonstrates how to enable SR-IOV virtual functions
478a9e3e999SKumar Sanghvion Chelsio NICs and demonstrates how to run testpmd with SR-IOV
479a9e3e999SKumar Sanghvivirtual functions.
480a9e3e999SKumar Sanghvi
481a9e3e999SKumar Sanghvi#. Load the kernel module:
482a9e3e999SKumar Sanghvi
483a9e3e999SKumar Sanghvi   .. code-block:: console
484a9e3e999SKumar Sanghvi
485a9e3e999SKumar Sanghvi      modprobe cxgb4
486a9e3e999SKumar Sanghvi
487a9e3e999SKumar Sanghvi#. Get the PCI bus addresses of the interfaces bound to cxgb4 driver:
488a9e3e999SKumar Sanghvi
489a9e3e999SKumar Sanghvi   .. code-block:: console
490a9e3e999SKumar Sanghvi
491a9e3e999SKumar Sanghvi      dmesg | tail -2
492a9e3e999SKumar Sanghvi
493a9e3e999SKumar Sanghvi   Example output:
494a9e3e999SKumar Sanghvi
495a9e3e999SKumar Sanghvi   .. code-block:: console
496a9e3e999SKumar Sanghvi
497a9e3e999SKumar Sanghvi      cxgb4 0000:02:00.4 p1p1: renamed from eth0
498a9e3e999SKumar Sanghvi      cxgb4 0000:02:00.4 p1p2: renamed from eth1
499a9e3e999SKumar Sanghvi
500a9e3e999SKumar Sanghvi   .. note::
501a9e3e999SKumar Sanghvi
502a9e3e999SKumar Sanghvi      Both the interfaces of a Chelsio 2-port adapter are bound to the
503a9e3e999SKumar Sanghvi      same PCI bus address.
504a9e3e999SKumar Sanghvi
505a9e3e999SKumar Sanghvi#. Use ifconfig to get the interface name assigned to Chelsio card:
506a9e3e999SKumar Sanghvi
507a9e3e999SKumar Sanghvi   .. code-block:: console
508a9e3e999SKumar Sanghvi
509a9e3e999SKumar Sanghvi      ifconfig -a | grep "00:07:43"
510a9e3e999SKumar Sanghvi
511a9e3e999SKumar Sanghvi   Example output:
512a9e3e999SKumar Sanghvi
513a9e3e999SKumar Sanghvi   .. code-block:: console
514a9e3e999SKumar Sanghvi
515a9e3e999SKumar Sanghvi      p1p1      Link encap:Ethernet  HWaddr 00:07:43:2D:EA:C0
516a9e3e999SKumar Sanghvi      p1p2      Link encap:Ethernet  HWaddr 00:07:43:2D:EA:C8
517a9e3e999SKumar Sanghvi
518a9e3e999SKumar Sanghvi#. Bring up the interfaces:
519a9e3e999SKumar Sanghvi
520a9e3e999SKumar Sanghvi   .. code-block:: console
521a9e3e999SKumar Sanghvi
522a9e3e999SKumar Sanghvi      ifconfig p1p1 up
523a9e3e999SKumar Sanghvi      ifconfig p1p2 up
524a9e3e999SKumar Sanghvi
525a9e3e999SKumar Sanghvi#. Instantiate SR-IOV Virtual Functions. PF0..3 can be used for
526a9e3e999SKumar Sanghvi   SR-IOV VFs. Multiple VFs can be instantiated on each of PF0..3.
527a9e3e999SKumar Sanghvi   To instantiate one SR-IOV VF on each PF0 and PF1:
528a9e3e999SKumar Sanghvi
529a9e3e999SKumar Sanghvi   .. code-block:: console
530a9e3e999SKumar Sanghvi
531a9e3e999SKumar Sanghvi      echo 1 > /sys/bus/pci/devices/0000\:02\:00.0/sriov_numvfs
532a9e3e999SKumar Sanghvi      echo 1 > /sys/bus/pci/devices/0000\:02\:00.1/sriov_numvfs
533a9e3e999SKumar Sanghvi
534a9e3e999SKumar Sanghvi#. Get the PCI bus addresses of the virtual functions:
535a9e3e999SKumar Sanghvi
536a9e3e999SKumar Sanghvi   .. code-block:: console
537a9e3e999SKumar Sanghvi
538a9e3e999SKumar Sanghvi      lspci | grep -i "Chelsio" | grep -i "VF"
539a9e3e999SKumar Sanghvi
540a9e3e999SKumar Sanghvi   Example output:
541a9e3e999SKumar Sanghvi
542a9e3e999SKumar Sanghvi   .. code-block:: console
543a9e3e999SKumar Sanghvi
544a9e3e999SKumar Sanghvi      02:01.0 Ethernet controller: Chelsio Communications Inc T540-CR Unified Wire Ethernet Controller [VF]
545a9e3e999SKumar Sanghvi      02:01.1 Ethernet controller: Chelsio Communications Inc T540-CR Unified Wire Ethernet Controller [VF]
546a9e3e999SKumar Sanghvi
547a9e3e999SKumar Sanghvi#. Running testpmd
548a9e3e999SKumar Sanghvi
549a9e3e999SKumar Sanghvi   Follow instructions available in the document
550a9e3e999SKumar Sanghvi   :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>`
551a9e3e999SKumar Sanghvi   to bind virtual functions and run testpmd.
552a9e3e999SKumar Sanghvi
553a9e3e999SKumar Sanghvi   Example output:
554a9e3e999SKumar Sanghvi
555a9e3e999SKumar Sanghvi   .. code-block:: console
556a9e3e999SKumar Sanghvi
557a9e3e999SKumar Sanghvi      [...]
558a9e3e999SKumar Sanghvi      EAL: PCI device 0000:02:01.0 on NUMA socket 0
559a9e3e999SKumar Sanghvi      EAL:   probe driver: 1425:5803 net_cxgbevf
560422d7823SRahul Lakkireddy      PMD: rte_cxgbe_pmd: Firmware version: 1.25.6.0
56151abd7b2SRahul Lakkireddy      PMD: rte_cxgbe_pmd: TP Microcode version: 0.1.23.2
562a9e3e999SKumar Sanghvi      PMD: rte_cxgbe_pmd: Chelsio rev 0
563a9e3e999SKumar Sanghvi      PMD: rte_cxgbe_pmd: No bootstrap loaded
564a9e3e999SKumar Sanghvi      PMD: rte_cxgbe_pmd: No Expansion ROM loaded
565a9e3e999SKumar Sanghvi      PMD: rte_cxgbe_pmd:  0000:02:01.0 Chelsio rev 0 1G/10GBASE-SFP
566a9e3e999SKumar Sanghvi      EAL: PCI device 0000:02:01.1 on NUMA socket 0
567a9e3e999SKumar Sanghvi      EAL:   probe driver: 1425:5803 net_cxgbevf
568422d7823SRahul Lakkireddy      PMD: rte_cxgbe_pmd: Firmware version: 1.25.6.0
56951abd7b2SRahul Lakkireddy      PMD: rte_cxgbe_pmd: TP Microcode version: 0.1.23.2
570a9e3e999SKumar Sanghvi      PMD: rte_cxgbe_pmd: Chelsio rev 0
571a9e3e999SKumar Sanghvi      PMD: rte_cxgbe_pmd: No bootstrap loaded
572a9e3e999SKumar Sanghvi      PMD: rte_cxgbe_pmd: No Expansion ROM loaded
573a9e3e999SKumar Sanghvi      PMD: rte_cxgbe_pmd:  0000:02:01.1 Chelsio rev 0 1G/10GBASE-SFP
574a9e3e999SKumar Sanghvi      Configuring Port 0 (socket 0)
575a9e3e999SKumar Sanghvi      Port 0: 06:44:29:44:40:00
576a9e3e999SKumar Sanghvi      Configuring Port 1 (socket 0)
577a9e3e999SKumar Sanghvi      Port 1: 06:44:29:44:40:10
578a9e3e999SKumar Sanghvi      Checking link statuses...
579a9e3e999SKumar Sanghvi      Done
580a9e3e999SKumar Sanghvi      testpmd>
581a9e3e999SKumar Sanghvi
58231c79ec5SRahul LakkireddyFreeBSD
58331c79ec5SRahul Lakkireddy-------
58431c79ec5SRahul Lakkireddy
58531c79ec5SRahul Lakkireddy.. _freebsd-installation:
58631c79ec5SRahul Lakkireddy
58731c79ec5SRahul LakkireddyFreeBSD Installation
58831c79ec5SRahul Lakkireddy~~~~~~~~~~~~~~~~~~~~
58931c79ec5SRahul Lakkireddy
59031c79ec5SRahul LakkireddySteps to manually install the latest firmware from the downloaded Chelsio
59131c79ec5SRahul LakkireddyUnified Wire package for FreeBSD operating system are as follows:
59231c79ec5SRahul Lakkireddy
59331c79ec5SRahul Lakkireddy#. Load the kernel module:
59431c79ec5SRahul Lakkireddy
59531c79ec5SRahul Lakkireddy   .. code-block:: console
59631c79ec5SRahul Lakkireddy
59731c79ec5SRahul Lakkireddy      kldload if_cxgbe
59831c79ec5SRahul Lakkireddy
59931c79ec5SRahul Lakkireddy#. Use dmesg to get the t5nex instance assigned to the Chelsio card:
60031c79ec5SRahul Lakkireddy
60131c79ec5SRahul Lakkireddy   .. code-block:: console
60231c79ec5SRahul Lakkireddy
60331c79ec5SRahul Lakkireddy      dmesg | grep "t5nex"
60431c79ec5SRahul Lakkireddy
60531c79ec5SRahul Lakkireddy   Example output:
60631c79ec5SRahul Lakkireddy
60731c79ec5SRahul Lakkireddy   .. code-block:: console
60831c79ec5SRahul Lakkireddy
60931c79ec5SRahul Lakkireddy      t5nex0: <Chelsio T520-CR> irq 16 at device 0.4 on pci2
61031c79ec5SRahul Lakkireddy      cxl0: <port 0> on t5nex0
61131c79ec5SRahul Lakkireddy      cxl1: <port 1> on t5nex0
61231c79ec5SRahul Lakkireddy      t5nex0: PCIe x8, 2 ports, 14 MSI-X interrupts, 31 eq, 13 iq
61331c79ec5SRahul Lakkireddy
61431c79ec5SRahul Lakkireddy   In the example above, a Chelsio T520-CR card is bound to a t5nex0 instance.
61531c79ec5SRahul Lakkireddy
61631c79ec5SRahul Lakkireddy#. Install cxgbetool from FreeBSD source repository:
61731c79ec5SRahul Lakkireddy
61831c79ec5SRahul Lakkireddy   .. code-block:: console
61931c79ec5SRahul Lakkireddy
62031c79ec5SRahul Lakkireddy      cd <path_to_FreeBSD_source>/tools/tools/cxgbetool/
62131c79ec5SRahul Lakkireddy      make && make install
62231c79ec5SRahul Lakkireddy
62331c79ec5SRahul Lakkireddy#. Use cxgbetool to load the firmware image onto the card:
62431c79ec5SRahul Lakkireddy
62531c79ec5SRahul Lakkireddy   .. code-block:: console
62631c79ec5SRahul Lakkireddy
62731c79ec5SRahul Lakkireddy      cxgbetool t5nex0 loadfw <path_to_uwire>/src/network/firmware/t5fw-*.bin
62831c79ec5SRahul Lakkireddy
62931c79ec5SRahul Lakkireddy#. Unload and reload the kernel module:
63031c79ec5SRahul Lakkireddy
63131c79ec5SRahul Lakkireddy   .. code-block:: console
63231c79ec5SRahul Lakkireddy
63331c79ec5SRahul Lakkireddy      kldunload if_cxgbe
63431c79ec5SRahul Lakkireddy      kldload if_cxgbe
63531c79ec5SRahul Lakkireddy
63631c79ec5SRahul Lakkireddy#. Verify with sysctl:
63731c79ec5SRahul Lakkireddy
63831c79ec5SRahul Lakkireddy   .. code-block:: console
63931c79ec5SRahul Lakkireddy
64031c79ec5SRahul Lakkireddy      sysctl -a | grep "t5nex" | grep "firmware"
64131c79ec5SRahul Lakkireddy
64231c79ec5SRahul Lakkireddy   Example output:
64331c79ec5SRahul Lakkireddy
64431c79ec5SRahul Lakkireddy   .. code-block:: console
64531c79ec5SRahul Lakkireddy
646422d7823SRahul Lakkireddy      dev.t5nex.0.firmware_version: 1.25.6.0
64731c79ec5SRahul Lakkireddy
64814b094a4SRahul LakkireddyRunning testpmd
64914b094a4SRahul Lakkireddy~~~~~~~~~~~~~~~
65031c79ec5SRahul Lakkireddy
65104868e5bSRahul LakkireddyThis section demonstrates how to launch **testpmd** with Chelsio
6528809f78cSBruce Richardsondevices managed by librte_net_cxgbe in FreeBSD operating system.
65331c79ec5SRahul Lakkireddy
65431c79ec5SRahul Lakkireddy#. Change to DPDK source directory where the target has been compiled in
65531c79ec5SRahul Lakkireddy   section :ref:`driver-compilation`:
65631c79ec5SRahul Lakkireddy
65731c79ec5SRahul Lakkireddy   .. code-block:: console
65831c79ec5SRahul Lakkireddy
65931c79ec5SRahul Lakkireddy      cd <DPDK-source-directory>
66031c79ec5SRahul Lakkireddy
66131c79ec5SRahul Lakkireddy#. Copy the contigmem kernel module to /boot/kernel directory:
66231c79ec5SRahul Lakkireddy
66331c79ec5SRahul Lakkireddy   .. code-block:: console
66431c79ec5SRahul Lakkireddy
66568d99d00SCiara Power      cp <build_dir>/kernel/freebsd/contigmem.ko /boot/kernel/
66631c79ec5SRahul Lakkireddy
66731c79ec5SRahul Lakkireddy#. Add the following lines to /boot/loader.conf:
66831c79ec5SRahul Lakkireddy
66931c79ec5SRahul Lakkireddy   .. code-block:: console
67031c79ec5SRahul Lakkireddy
67131c79ec5SRahul Lakkireddy      # reserve 2 x 1G blocks of contiguous memory using contigmem driver
67231c79ec5SRahul Lakkireddy      hw.contigmem.num_buffers=2
67331c79ec5SRahul Lakkireddy      hw.contigmem.buffer_size=1073741824
67431c79ec5SRahul Lakkireddy      # load contigmem module during boot process
67531c79ec5SRahul Lakkireddy      contigmem_load="YES"
67631c79ec5SRahul Lakkireddy
67731c79ec5SRahul Lakkireddy   The above lines load the contigmem kernel module during boot process and
67831c79ec5SRahul Lakkireddy   allocate 2 x 1G blocks of contiguous memory to be used for DPDK later on.
67931c79ec5SRahul Lakkireddy   This is to avoid issues with potential memory fragmentation during later
68031c79ec5SRahul Lakkireddy   system up time, which may result in failure of allocating the contiguous
68131c79ec5SRahul Lakkireddy   memory required for the contigmem kernel module.
68231c79ec5SRahul Lakkireddy
68331c79ec5SRahul Lakkireddy#. Restart the system and ensure the contigmem module is loaded successfully:
68431c79ec5SRahul Lakkireddy
68531c79ec5SRahul Lakkireddy   .. code-block:: console
68631c79ec5SRahul Lakkireddy
68731c79ec5SRahul Lakkireddy      reboot
68831c79ec5SRahul Lakkireddy      kldstat | grep "contigmem"
68931c79ec5SRahul Lakkireddy
69031c79ec5SRahul Lakkireddy   Example output:
69131c79ec5SRahul Lakkireddy
69231c79ec5SRahul Lakkireddy   .. code-block:: console
69331c79ec5SRahul Lakkireddy
69431c79ec5SRahul Lakkireddy      2    1 0xffffffff817f1000 3118     contigmem.ko
69531c79ec5SRahul Lakkireddy
69631c79ec5SRahul Lakkireddy#. Repeat step 1 to ensure that you are in the DPDK source directory.
69731c79ec5SRahul Lakkireddy
69831c79ec5SRahul Lakkireddy#. Load the cxgbe kernel module:
69931c79ec5SRahul Lakkireddy
70031c79ec5SRahul Lakkireddy   .. code-block:: console
70131c79ec5SRahul Lakkireddy
70231c79ec5SRahul Lakkireddy      kldload if_cxgbe
70331c79ec5SRahul Lakkireddy
70431c79ec5SRahul Lakkireddy#. Get the PCI bus addresses of the interfaces bound to t5nex driver:
70531c79ec5SRahul Lakkireddy
70631c79ec5SRahul Lakkireddy   .. code-block:: console
70731c79ec5SRahul Lakkireddy
70831c79ec5SRahul Lakkireddy      pciconf -l | grep "t5nex"
70931c79ec5SRahul Lakkireddy
71031c79ec5SRahul Lakkireddy   Example output:
71131c79ec5SRahul Lakkireddy
71231c79ec5SRahul Lakkireddy   .. code-block:: console
71331c79ec5SRahul Lakkireddy
71431c79ec5SRahul Lakkireddy      t5nex0@pci0:2:0:4: class=0x020000 card=0x00001425 chip=0x54011425 rev=0x00
71531c79ec5SRahul Lakkireddy
71631c79ec5SRahul Lakkireddy   In the above example, the t5nex0 is bound to 2:0:4 bus address.
71731c79ec5SRahul Lakkireddy
71831c79ec5SRahul Lakkireddy   .. note::
71931c79ec5SRahul Lakkireddy
72004868e5bSRahul Lakkireddy      Both the interfaces of a Chelsio 2-port adapter are bound to the
72131c79ec5SRahul Lakkireddy      same PCI bus address.
72231c79ec5SRahul Lakkireddy
72331c79ec5SRahul Lakkireddy#. Unload the kernel module:
72431c79ec5SRahul Lakkireddy
72531c79ec5SRahul Lakkireddy   .. code-block:: console
72631c79ec5SRahul Lakkireddy
72731c79ec5SRahul Lakkireddy      kldunload if_cxgbe
72831c79ec5SRahul Lakkireddy
72931c79ec5SRahul Lakkireddy#. Set the PCI bus addresses to hw.nic_uio.bdfs kernel environment parameter:
73031c79ec5SRahul Lakkireddy
73131c79ec5SRahul Lakkireddy   .. code-block:: console
73231c79ec5SRahul Lakkireddy
73331c79ec5SRahul Lakkireddy      kenv hw.nic_uio.bdfs="2:0:4"
73431c79ec5SRahul Lakkireddy
73531c79ec5SRahul Lakkireddy   This automatically binds 2:0:4 to nic_uio kernel driver when it is loaded in
73631c79ec5SRahul Lakkireddy   the next step.
73731c79ec5SRahul Lakkireddy
73831c79ec5SRahul Lakkireddy   .. note::
73931c79ec5SRahul Lakkireddy
74004868e5bSRahul Lakkireddy      Currently, CXGBE PMD only supports the binding of PF4 for Chelsio NICs.
74131c79ec5SRahul Lakkireddy
74231c79ec5SRahul Lakkireddy#. Load nic_uio kernel driver:
74331c79ec5SRahul Lakkireddy
74431c79ec5SRahul Lakkireddy   .. code-block:: console
74531c79ec5SRahul Lakkireddy
74668d99d00SCiara Power      kldload <build_dir>/kernel/freebsd/nic_uio.ko
74731c79ec5SRahul Lakkireddy
74831c79ec5SRahul Lakkireddy#. Start testpmd with basic parameters:
74931c79ec5SRahul Lakkireddy
75031c79ec5SRahul Lakkireddy   .. code-block:: console
75131c79ec5SRahul Lakkireddy
752db27370bSStephen Hemminger      ./<build_dir>/app/dpdk-testpmd -l 0-3 -n 4 -a 0000:02:00.4 -- -i
75331c79ec5SRahul Lakkireddy
75431c79ec5SRahul Lakkireddy   Example output:
75531c79ec5SRahul Lakkireddy
75631c79ec5SRahul Lakkireddy   .. code-block:: console
75731c79ec5SRahul Lakkireddy
75831c79ec5SRahul Lakkireddy      [...]
75931c79ec5SRahul Lakkireddy      EAL: PCI device 0000:02:00.4 on NUMA socket 0
76031c79ec5SRahul Lakkireddy      EAL:   probe driver: 1425:5401 rte_cxgbe_pmd
76131c79ec5SRahul Lakkireddy      EAL:   PCI memory mapped at 0x8007ec000
76231c79ec5SRahul Lakkireddy      EAL:   PCI memory mapped at 0x842800000
76331c79ec5SRahul Lakkireddy      EAL:   PCI memory mapped at 0x80086c000
764422d7823SRahul Lakkireddy      PMD: rte_cxgbe_pmd: fw: 1.25.6.0, TP: 0.1.23.2
7654d84a97dSRahul Lakkireddy      PMD: rte_cxgbe_pmd: Coming up as MASTER: Initializing adapter
7664d84a97dSRahul Lakkireddy      Interactive-mode selected
7674d84a97dSRahul Lakkireddy      Configuring Port 0 (socket 0)
7684d84a97dSRahul Lakkireddy      Port 0: 00:07:43:2D:EA:C0
7694d84a97dSRahul Lakkireddy      Configuring Port 1 (socket 0)
7704d84a97dSRahul Lakkireddy      Port 1: 00:07:43:2D:EA:C8
7714d84a97dSRahul Lakkireddy      Checking link statuses...
7724d84a97dSRahul Lakkireddy      PMD: rte_cxgbe_pmd: Port0: passive DA port module inserted
7734d84a97dSRahul Lakkireddy      PMD: rte_cxgbe_pmd: Port1: passive DA port module inserted
7744d84a97dSRahul Lakkireddy      Port 0 Link Up - speed 10000 Mbps - full-duplex
7754d84a97dSRahul Lakkireddy      Port 1 Link Up - speed 10000 Mbps - full-duplex
7764d84a97dSRahul Lakkireddy      Done
7774d84a97dSRahul Lakkireddy      testpmd>
7788ec019a9SRahul Lakkireddy
7798ec019a9SRahul Lakkireddy.. note::
7808ec019a9SRahul Lakkireddy
7818ec019a9SRahul Lakkireddy   Flow control pause TX/RX is disabled by default and can be enabled via
78214b094a4SRahul Lakkireddy   testpmd. Refer section :ref:`flow-control` for more details.
78314b094a4SRahul Lakkireddy
78414b094a4SRahul LakkireddySample Application Notes
78514b094a4SRahul Lakkireddy------------------------
78614b094a4SRahul Lakkireddy
78714b094a4SRahul Lakkireddy.. _flow-control:
78814b094a4SRahul Lakkireddy
78914b094a4SRahul LakkireddyEnable/Disable Flow Control
79014b094a4SRahul Lakkireddy~~~~~~~~~~~~~~~~~~~~~~~~~~~
79114b094a4SRahul Lakkireddy
79214b094a4SRahul LakkireddyFlow control pause TX/RX is disabled by default and can be enabled via
7938ec019a9SRahul Lakkireddytestpmd as follows:
7948ec019a9SRahul Lakkireddy
7958ec019a9SRahul Lakkireddy.. code-block:: console
7968ec019a9SRahul Lakkireddy
7978ec019a9SRahul Lakkireddy   testpmd> set flow_ctrl rx on tx on 0 0 0 0 mac_ctrl_frame_fwd off autoneg on 0
7988ec019a9SRahul Lakkireddy   testpmd> set flow_ctrl rx on tx on 0 0 0 0 mac_ctrl_frame_fwd off autoneg on 1
7998ec019a9SRahul Lakkireddy
80014b094a4SRahul LakkireddyTo disable again, run:
8018ec019a9SRahul Lakkireddy
8028ec019a9SRahul Lakkireddy.. code-block:: console
8038ec019a9SRahul Lakkireddy
8048ec019a9SRahul Lakkireddy   testpmd> set flow_ctrl rx off tx off 0 0 0 0 mac_ctrl_frame_fwd off autoneg off 0
8058ec019a9SRahul Lakkireddy   testpmd> set flow_ctrl rx off tx off 0 0 0 0 mac_ctrl_frame_fwd off autoneg off 1
8064b2eff45SRahul Lakkireddy
8074b2eff45SRahul LakkireddyJumbo Mode
8084b2eff45SRahul Lakkireddy~~~~~~~~~~
8094b2eff45SRahul Lakkireddy
8104b2eff45SRahul LakkireddyThere are two ways to enable sending and receiving of jumbo frames via testpmd.
8114b2eff45SRahul LakkireddyOne method involves using the **mtu** command, which changes the mtu of an
8124b2eff45SRahul Lakkireddyindividual port without having to stop the selected port. Another method
8134b2eff45SRahul Lakkireddyinvolves stopping all the ports first and then running **max-pkt-len** command
8144b2eff45SRahul Lakkireddyto configure the mtu of all the ports with a single command.
8154b2eff45SRahul Lakkireddy
8164b2eff45SRahul Lakkireddy- To configure each port individually, run the mtu command as follows:
8174b2eff45SRahul Lakkireddy
8184b2eff45SRahul Lakkireddy  .. code-block:: console
8194b2eff45SRahul Lakkireddy
8204b2eff45SRahul Lakkireddy     testpmd> port config mtu 0 9000
8214b2eff45SRahul Lakkireddy     testpmd> port config mtu 1 9000
8224b2eff45SRahul Lakkireddy
8234b2eff45SRahul Lakkireddy- To configure all the ports at once, stop all the ports first and run the
8244b2eff45SRahul Lakkireddy  max-pkt-len command as follows:
8254b2eff45SRahul Lakkireddy
8264b2eff45SRahul Lakkireddy  .. code-block:: console
8274b2eff45SRahul Lakkireddy
8284b2eff45SRahul Lakkireddy     testpmd> port stop all
8294b2eff45SRahul Lakkireddy     testpmd> port config all max-pkt-len 9000
8306d7d651bSRahul Lakkireddy
8316d7d651bSRahul LakkireddyHardware Configuration and Debugging
8326d7d651bSRahul Lakkireddy------------------------------------
8336d7d651bSRahul Lakkireddy
8346d7d651bSRahul LakkireddyFirmware Configuration File
8356d7d651bSRahul Lakkireddy~~~~~~~~~~~~~~~~~~~~~~~~~~~
8366d7d651bSRahul Lakkireddy
8376d7d651bSRahul LakkireddyTo enable or disable Chelsio NIC features before firmware initialization,
8386d7d651bSRahul Lakkireddythe Chelsio firmware configuration file can be placed in following
8396d7d651bSRahul Lakkireddydirectory.
8406d7d651bSRahul Lakkireddy
8416d7d651bSRahul Lakkireddy.. code-block:: console
8426d7d651bSRahul Lakkireddy
8436d7d651bSRahul Lakkireddy   # For Chelsio T5 NIC series
8446d7d651bSRahul Lakkireddy   cp <path_to_config_file>/t5-config.txt /lib/firmware/cxgb4/t5-config.txt
8456d7d651bSRahul Lakkireddy
8466d7d651bSRahul Lakkireddy   # For Chelsio T6 NIC series
8476d7d651bSRahul Lakkireddy   cp <path_to_config_file>/t6-config.txt /lib/firmware/cxgb4/t6-config.txt
8486d7d651bSRahul Lakkireddy
8496d7d651bSRahul LakkireddyThe firmware configuration file is mainly intended to be used to debug
8506d7d651bSRahul Lakkireddyfirmware initialization failures. It can also be used to redistribute
8516d7d651bSRahul LakkireddyNIC resources from disabled physical functions (PFs) to main PF before
8526d7d651bSRahul Lakkireddyinitializing firmware.
8536d7d651bSRahul Lakkireddy
8546d7d651bSRahul LakkireddyThe CXGBE PMD will search and pick up the firmware configuration file
8556d7d651bSRahul Lakkireddyduring the Chelsio NIC probe, in following order.
8566d7d651bSRahul Lakkireddy
8576d7d651bSRahul Lakkireddy#. If the firmware configuration file is present in /lib/firmware/cxgb4/
8586d7d651bSRahul Lakkireddy   directory, then this file is downloaded to temporary location in
8596d7d651bSRahul Lakkireddy   NIC's on-chip RAM. When firmware is initializing, it picks up the
8606d7d651bSRahul Lakkireddy   file from the temporary on-chip RAM location.
8616d7d651bSRahul Lakkireddy
8626d7d651bSRahul Lakkireddy#. Otherwise, if the firmware configuration file has been written
8636d7d651bSRahul Lakkireddy   onto the NIC persistent flash area using cxgbtool, then this
8646d7d651bSRahul Lakkireddy   file is picked up from the persistent flash area during
8656d7d651bSRahul Lakkireddy   firmware initialization.
8666d7d651bSRahul Lakkireddy
8676d7d651bSRahul Lakkireddy#. If no firmware configuration file is found at /lib/firmware/cxgb4/
8686d7d651bSRahul Lakkireddy   directory or on the NIC persistent flash area, then the firmware
8696d7d651bSRahul Lakkireddy   will initialize with the default configuration file embedded inside
8706d7d651bSRahul Lakkireddy   the firmware binary.
8716d7d651bSRahul Lakkireddy
8726d7d651bSRahul Lakkireddy.. warning::
8736d7d651bSRahul Lakkireddy
8746d7d651bSRahul Lakkireddy   Note that the Chelsio firmware configuration file contains very low
8756d7d651bSRahul Lakkireddy   level details that is specific to the Chelsio NIC. Hence, the
8766d7d651bSRahul Lakkireddy   firmware configuration file must not be modified without expert
8776d7d651bSRahul Lakkireddy   guidance from Chelsio support team.
878*b583b9a1SFerruh Yigit
879*b583b9a1SFerruh YigitLimitations
880*b583b9a1SFerruh Yigit-----------
881*b583b9a1SFerruh Yigit
882*b583b9a1SFerruh YigitThe Chelsio Terminator series of devices provide two/four ports but
883*b583b9a1SFerruh Yigitexpose a single PCI bus address, thus, librte_net_cxgbe registers
884*b583b9a1SFerruh Yigititself as a PCI driver that allocates one Ethernet device per detected
885*b583b9a1SFerruh Yigitport.
886*b583b9a1SFerruh Yigit
887*b583b9a1SFerruh YigitFor this reason, one cannot allow/block a single port without
888*b583b9a1SFerruh Yigitallowing/blocking the other ports on the same device.
889*b583b9a1SFerruh Yigit
890