294 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3====================4mlx5 devlink support5====================6 7This document describes the devlink features implemented by the ``mlx5``8device driver.9 10Parameters11==========12 13.. list-table:: Generic parameters implemented14 15 * - Name16 - Mode17 - Validation18 * - ``enable_roce``19 - driverinit20 - Type: Boolean21 22 If the device supports RoCE disablement, RoCE enablement state controls23 device support for RoCE capability. Otherwise, the control occurs in the24 driver stack. When RoCE is disabled at the driver level, only raw25 ethernet QPs are supported.26 * - ``io_eq_size``27 - driverinit28 - The range is between 64 and 4096.29 * - ``event_eq_size``30 - driverinit31 - The range is between 64 and 4096.32 * - ``max_macs``33 - driverinit34 - The range is between 1 and 2^31. Only power of 2 values are supported.35 36The ``mlx5`` driver also implements the following driver-specific37parameters.38 39.. list-table:: Driver-specific parameters implemented40 :widths: 5 5 5 8541 42 * - Name43 - Type44 - Mode45 - Description46 * - ``flow_steering_mode``47 - string48 - runtime49 - Controls the flow steering mode of the driver50 51 * ``dmfs`` Device managed flow steering. In DMFS mode, the HW52 steering entities are created and managed through firmware.53 * ``smfs`` Software managed flow steering. In SMFS mode, the HW54 steering entities are created and manage through the driver without55 firmware intervention.56 57 SMFS mode is faster and provides better rule insertion rate compared to58 default DMFS mode.59 * - ``fdb_large_groups``60 - u3261 - driverinit62 - Control the number of large groups (size > 1) in the FDB table.63 64 * The default value is 15, and the range is between 1 and 1024.65 * - ``esw_multiport``66 - Boolean67 - runtime68 - Control MultiPort E-Switch shared fdb mode.69 70 An experimental mode where a single E-Switch is used and all the vports71 and physical ports on the NIC are connected to it.72 73 An example is to send traffic from a VF that is created on PF0 to an74 uplink that is natively associated with the uplink of PF175 76 Note: Future devices, ConnectX-8 and onward, will eventually have this77 as the default to allow forwarding between all NIC ports in a single78 E-switch environment and the dual E-switch mode will likely get79 deprecated.80 81 Default: disabled82 * - ``esw_port_metadata``83 - Boolean84 - runtime85 - When applicable, disabling eswitch metadata can increase packet rate up86 to 20% depending on the use case and packet sizes.87 88 Eswitch port metadata state controls whether to internally tag packets89 with metadata. Metadata tagging must be enabled for multi-port RoCE,90 failover between representors and stacked devices. By default metadata is91 enabled on the supported devices in E-switch. Metadata is applicable only92 for E-switch in switchdev mode and users may disable it when NONE of the93 below use cases will be in use:94 1. HCA is in Dual/multi-port RoCE mode.95 2. VF/SF representor bonding (Usually used for Live migration)96 3. Stacked devices97 98 When metadata is disabled, the above use cases will fail to initialize if99 users try to enable them.100 101 Note: Setting this parameter does not take effect immediately. Setting102 must happen in legacy mode and eswitch port metadata takes effect after103 enabling switchdev mode.104 * - ``hairpin_num_queues``105 - u32106 - driverinit107 - We refer to a TC NIC rule that involves forwarding as "hairpin".108 Hairpin queues are mlx5 hardware specific implementation for hardware109 forwarding of such packets.110 111 Control the number of hairpin queues.112 * - ``hairpin_queue_size``113 - u32114 - driverinit115 - Control the size (in packets) of the hairpin queues.116 117The ``mlx5`` driver supports reloading via ``DEVLINK_CMD_RELOAD``118 119Info versions120=============121 122The ``mlx5`` driver reports the following versions123 124.. list-table:: devlink info versions implemented125 :widths: 5 5 90126 127 * - Name128 - Type129 - Description130 * - ``fw.psid``131 - fixed132 - Used to represent the board id of the device.133 * - ``fw.version``134 - stored, running135 - Three digit major.minor.subminor firmware version number.136 137Health reporters138================139 140tx reporter141-----------142The tx reporter is responsible for reporting and recovering of the following three error scenarios:143 144- tx timeout145 Report on kernel tx timeout detection.146 Recover by searching lost interrupts.147- tx error completion148 Report on error tx completion.149 Recover by flushing the tx queue and reset it.150- tx PTP port timestamping CQ unhealthy151 Report too many CQEs never delivered on port ts CQ.152 Recover by flushing and re-creating all PTP channels.153 154tx reporter also support on demand diagnose callback, on which it provides155real time information of its send queues status.156 157User commands examples:158 159- Diagnose send queues status::160 161 $ devlink health diagnose pci/0000:82:00.0 reporter tx162 163.. note::164 This command has valid output only when interface is up, otherwise the command has empty output.165 166- Show number of tx errors indicated, number of recover flows ended successfully,167 is autorecover enabled and graceful period from last recover::168 169 $ devlink health show pci/0000:82:00.0 reporter tx170 171rx reporter172-----------173The rx reporter is responsible for reporting and recovering of the following two error scenarios:174 175- rx queues' initialization (population) timeout176 Population of rx queues' descriptors on ring initialization is done177 in napi context via triggering an irq. In case of a failure to get178 the minimum amount of descriptors, a timeout would occur, and179 descriptors could be recovered by polling the EQ (Event Queue).180- rx completions with errors (reported by HW on interrupt context)181 Report on rx completion error.182 Recover (if needed) by flushing the related queue and reset it.183 184rx reporter also supports on demand diagnose callback, on which it185provides real time information of its receive queues' status.186 187- Diagnose rx queues' status and corresponding completion queue::188 189 $ devlink health diagnose pci/0000:82:00.0 reporter rx190 191.. note::192 This command has valid output only when interface is up. Otherwise, the command has empty output.193 194- Show number of rx errors indicated, number of recover flows ended successfully,195 is autorecover enabled, and graceful period from last recover::196 197 $ devlink health show pci/0000:82:00.0 reporter rx198 199fw reporter200-----------201The fw reporter implements `diagnose` and `dump` callbacks.202It follows symptoms of fw error such as fw syndrome by triggering203fw core dump and storing it into the dump buffer.204The fw reporter diagnose command can be triggered any time by the user to check205current fw status.206 207User commands examples:208 209- Check fw heath status::210 211 $ devlink health diagnose pci/0000:82:00.0 reporter fw212 213- Read FW core dump if already stored or trigger new one::214 215 $ devlink health dump show pci/0000:82:00.0 reporter fw216 217.. note::218 This command can run only on the PF which has fw tracer ownership,219 running it on other PF or any VF will return "Operation not permitted".220 221fw fatal reporter222-----------------223The fw fatal reporter implements `dump` and `recover` callbacks.224It follows fatal errors indications by CR-space dump and recover flow.225The CR-space dump uses vsc interface which is valid even if the FW command226interface is not functional, which is the case in most FW fatal errors.227The recover function runs recover flow which reloads the driver and triggers fw228reset if needed.229On firmware error, the health buffer is dumped into the dmesg. The log230level is derived from the error's severity (given in health buffer).231 232User commands examples:233 234- Run fw recover flow manually::235 236 $ devlink health recover pci/0000:82:00.0 reporter fw_fatal237 238- Read FW CR-space dump if already stored or trigger new one::239 240 $ devlink health dump show pci/0000:82:00.1 reporter fw_fatal241 242.. note::243 This command can run only on PF.244 245vnic reporter246-------------247The vnic reporter implements only the `diagnose` callback.248It is responsible for querying the vnic diagnostic counters from fw and displaying249them in realtime.250 251Description of the vnic counters:252 253- total_error_queues254 number of queues in an error state due to255 an async error or errored command.256- send_queue_priority_update_flow257 number of QP/SQ priority/SL update events.258- cq_overrun259 number of times CQ entered an error state due to an overflow.260- async_eq_overrun261 number of times an EQ mapped to async events was overrun.262- comp_eq_overrun263 number of times an EQ mapped to completion events was264 overrun.265- quota_exceeded_command266 number of commands issued and failed due to quota exceeded.267- invalid_command268 number of commands issued and failed dues to any reason other than quota269 exceeded.270- nic_receive_steering_discard271 number of packets that completed RX flow272 steering but were discarded due to a mismatch in flow table.273- generated_pkt_steering_fail274 number of packets generated by the VNIC experiencing unexpected steering275 failure (at any point in steering flow).276- handled_pkt_steering_fail277 number of packets handled by the VNIC experiencing unexpected steering278 failure (at any point in steering flow owned by the VNIC, including the FDB279 for the eswitch owner).280 281User commands examples:282 283- Diagnose PF/VF vnic counters::284 285 $ devlink health diagnose pci/0000:82:00.1 reporter vnic286 287- Diagnose representor vnic counters (performed by supplying devlink port of the288 representor, which can be obtained via devlink port command)::289 290 $ devlink health diagnose pci/0000:82:00.1/65537 reporter vnic291 292.. note::293 This command can run over all interfaces such as PF/VF and representor ports.294