Merge tag 'mlx5-updates-2019-08-15' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / Documentation / networking / device_drivers / mellanox / mlx5.rst
1 .. SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
2
3 =================================================
4 Mellanox ConnectX(R) mlx5 core VPI Network Driver
5 =================================================
6
7 Copyright (c) 2019, Mellanox Technologies LTD.
8
9 Contents
10 ========
11
12 - `Enabling the driver and kconfig options`_
13 - `Devlink info`_
14 - `Devlink health reporters`_
15
16 Enabling the driver and kconfig options
17 ================================================
18
19 | mlx5 core is modular and most of the major mlx5 core driver features can be selected (compiled in/out)
20 | at build time via kernel Kconfig flags.
21 | Basic features, ethernet net device rx/tx offloads and XDP, are available with the most basic flags
22 | CONFIG_MLX5_CORE=y/m and CONFIG_MLX5_CORE_EN=y.
23 | For the list of advanced features please see below.
24
25 **CONFIG_MLX5_CORE=(y/m/n)** (module mlx5_core.ko)
26
27 |    The driver can be enabled by choosing CONFIG_MLX5_CORE=y/m in kernel config.
28 |    This will provide mlx5 core driver for mlx5 ulps to interface with (mlx5e, mlx5_ib).
29
30
31 **CONFIG_MLX5_CORE_EN=(y/n)**
32
33 |    Choosing this option will allow basic ethernet netdevice support with all of the standard rx/tx offloads.
34 |    mlx5e is the mlx5 ulp driver which provides netdevice kernel interface, when chosen, mlx5e will be
35 |    built-in into mlx5_core.ko.
36
37
38 **CONFIG_MLX5_EN_ARFS=(y/n)**
39
40 |     Enables Hardware-accelerated receive flow steering (arfs) support, and ntuple filtering.
41 |     https://community.mellanox.com/s/article/howto-configure-arfs-on-connectx-4
42
43
44 **CONFIG_MLX5_EN_RXNFC=(y/n)**
45
46 |    Enables ethtool receive network flow classification, which allows user defined
47 |    flow rules to direct traffic into arbitrary rx queue via ethtool set/get_rxnfc API.
48
49
50 **CONFIG_MLX5_CORE_EN_DCB=(y/n)**:
51
52 |    Enables `Data Center Bridging (DCB) Support <https://community.mellanox.com/s/article/howto-auto-config-pfc-and-ets-on-connectx-4-via-lldp-dcbx>`_.
53
54
55 **CONFIG_MLX5_MPFS=(y/n)**
56
57 |    Ethernet Multi-Physical Function Switch (MPFS) support in ConnectX NIC.
58 |    MPFs is required for when `Multi-Host <http://www.mellanox.com/page/multihost>`_ configuration is enabled to allow passing
59 |    user configured unicast MAC addresses to the requesting PF.
60
61
62 **CONFIG_MLX5_ESWITCH=(y/n)**
63
64 |    Ethernet SRIOV E-Switch support in ConnectX NIC. E-Switch provides internal SRIOV packet steering
65 |    and switching for the enabled VFs and PF in two available modes:
66 |           1) `Legacy SRIOV mode (L2 mac vlan steering based) <https://community.mellanox.com/s/article/howto-configure-sr-iov-for-connectx-4-connectx-5-with-kvm--ethernet-x>`_.
67 |           2) `Switchdev mode (eswitch offloads) <https://www.mellanox.com/related-docs/prod_software/ASAP2_Hardware_Offloading_for_vSwitches_User_Manual_v4.4.pdf>`_.
68
69
70 **CONFIG_MLX5_CORE_IPOIB=(y/n)**
71
72 |    IPoIB offloads & acceleration support.
73 |    Requires CONFIG_MLX5_CORE_EN to provide an accelerated interface for the rdma
74 |    IPoIB ulp netdevice.
75
76
77 **CONFIG_MLX5_FPGA=(y/n)**
78
79 |    Build support for the Innova family of network cards by Mellanox Technologies.
80 |    Innova network cards are comprised of a ConnectX chip and an FPGA chip on one board.
81 |    If you select this option, the mlx5_core driver will include the Innova FPGA core and allow
82 |    building sandbox-specific client drivers.
83
84
85 **CONFIG_MLX5_EN_IPSEC=(y/n)**
86
87 |    Enables `IPSec XFRM cryptography-offload accelaration <http://www.mellanox.com/related-docs/prod_software/Mellanox_Innova_IPsec_Ethernet_Adapter_Card_User_Manual.pdf>`_.
88
89 **CONFIG_MLX5_EN_TLS=(y/n)**
90
91 |   TLS cryptography-offload accelaration.
92
93
94 **CONFIG_MLX5_INFINIBAND=(y/n/m)** (module mlx5_ib.ko)
95
96 |   Provides low-level InfiniBand/RDMA and `RoCE <https://community.mellanox.com/s/article/recommended-network-configuration-examples-for-roce-deployment>`_ support.
97
98
99 **External options** ( Choose if the corresponding mlx5 feature is required )
100
101 - CONFIG_PTP_1588_CLOCK: When chosen, mlx5 ptp support will be enabled
102 - CONFIG_VXLAN: When chosen, mlx5 vxaln support will be enabled.
103 - CONFIG_MLXFW: When chosen, mlx5 firmware flashing support will be enabled (via devlink and ethtool).
104
105 Devlink info
106 ============
107
108 The devlink info reports the running and stored firmware versions on device.
109 It also prints the device PSID which represents the HCA board type ID.
110
111 User command example::
112
113    $ devlink dev info pci/0000:00:06.0
114       pci/0000:00:06.0:
115       driver mlx5_core
116       versions:
117          fixed:
118             fw.psid MT_0000000009
119          running:
120             fw.version 16.26.0100
121          stored:
122             fw.version 16.26.0100
123
124 Devlink health reporters
125 ========================
126
127 tx reporter
128 -----------
129 The tx reporter is responsible for reporting and recovering of the following two error scenarios:
130
131 - TX timeout
132     Report on kernel tx timeout detection.
133     Recover by searching lost interrupts.
134 - TX error completion
135     Report on error tx completion.
136     Recover by flushing the TX queue and reset it.
137
138 TX reporter also support on demand diagnose callback, on which it provides
139 real time information of its send queues status.
140
141 User commands examples:
142
143 - Diagnose send queues status::
144
145     $ devlink health diagnose pci/0000:82:00.0 reporter tx
146
147 NOTE: This command has valid output only when interface is up, otherwise the command has empty output.
148
149 - Show number of tx errors indicated, number of recover flows ended successfully,
150   is autorecover enabled and graceful period from last recover::
151
152     $ devlink health show pci/0000:82:00.0 reporter tx
153
154 rx reporter
155 -----------
156 The rx reporter is responsible for reporting and recovering of the following two error scenarios:
157
158 - RX queues initialization (population) timeout
159     RX queues descriptors population on ring initialization is done in
160     napi context via triggering an irq, in case of a failure to get
161     the minimum amount of descriptors, a timeout would occur and it
162     could be recoverable by polling the EQ (Event Queue).
163 - RX completions with errors (reported by HW on interrupt context)
164     Report on rx completion error.
165     Recover (if needed) by flushing the related queue and reset it.
166
167 RX reporter also supports on demand diagnose callback, on which it
168 provides real time information of its receive queues status.
169
170 - Diagnose rx queues status, and corresponding completion queue::
171
172     $ devlink health diagnose pci/0000:82:00.0 reporter rx
173
174 NOTE: This command has valid output only when interface is up, otherwise the command has empty output.
175
176 - Show number of rx errors indicated, number of recover flows ended successfully,
177   is autorecover enabled and graceful period from last recover::
178
179     $ devlink health show pci/0000:82:00.0 reporter rx
180
181 fw reporter
182 -----------
183 The fw reporter implements diagnose and dump callbacks.
184 It follows symptoms of fw error such as fw syndrome by triggering
185 fw core dump and storing it into the dump buffer.
186 The fw reporter diagnose command can be triggered any time by the user to check
187 current fw status.
188
189 User commands examples:
190
191 - Check fw heath status::
192
193     $ devlink health diagnose pci/0000:82:00.0 reporter fw
194
195 - Read FW core dump if already stored or trigger new one::
196
197     $ devlink health dump show pci/0000:82:00.0 reporter fw
198
199 NOTE: This command can run only on the PF which has fw tracer ownership,
200 running it on other PF or any VF will return "Operation not permitted".
201
202 fw fatal reporter
203 -----------------
204 The fw fatal reporter implements dump and recover callbacks.
205 It follows fatal errors indications by CR-space dump and recover flow.
206 The CR-space dump uses vsc interface which is valid even if the FW command
207 interface is not functional, which is the case in most FW fatal errors.
208 The recover function runs recover flow which reloads the driver and triggers fw
209 reset if needed.
210
211 User commands examples:
212
213 - Run fw recover flow manually::
214
215     $ devlink health recover pci/0000:82:00.0 reporter fw_fatal
216
217 - Read FW CR-space dump if already strored or trigger new one::
218
219     $ devlink health dump show pci/0000:82:00.1 reporter fw_fatal
220
221 NOTE: This command can run only on PF.