mlx5.rst 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ====================
  3. mlx5 devlink support
  4. ====================
  5. This document describes the devlink features implemented by the ``mlx5``
  6. device driver.
  7. Parameters
  8. ==========
  9. .. list-table:: Generic parameters implemented
  10. * - Name
  11. - Mode
  12. - Validation
  13. * - ``enable_roce``
  14. - driverinit
  15. - Type: Boolean
  16. If the device supports RoCE disablement, RoCE enablement state controls
  17. device support for RoCE capability. Otherwise, the control occurs in the
  18. driver stack. When RoCE is disabled at the driver level, only raw
  19. ethernet QPs are supported.
  20. * - ``io_eq_size``
  21. - driverinit
  22. - The range is between 64 and 4096.
  23. * - ``event_eq_size``
  24. - driverinit
  25. - The range is between 64 and 4096.
  26. * - ``max_macs``
  27. - driverinit
  28. - The range is between 1 and 2^31. Only power of 2 values are supported.
  29. The ``mlx5`` driver also implements the following driver-specific
  30. parameters.
  31. .. list-table:: Driver-specific parameters implemented
  32. :widths: 5 5 5 85
  33. * - Name
  34. - Type
  35. - Mode
  36. - Description
  37. * - ``flow_steering_mode``
  38. - string
  39. - runtime
  40. - Controls the flow steering mode of the driver
  41. * ``dmfs`` Device managed flow steering. In DMFS mode, the HW
  42. steering entities are created and managed through firmware.
  43. * ``smfs`` Software managed flow steering. In SMFS mode, the HW
  44. steering entities are created and manage through the driver without
  45. firmware intervention.
  46. SMFS mode is faster and provides better rule insertion rate compared to
  47. default DMFS mode.
  48. * - ``fdb_large_groups``
  49. - u32
  50. - driverinit
  51. - Control the number of large groups (size > 1) in the FDB table.
  52. * The default value is 15, and the range is between 1 and 1024.
  53. * - ``esw_multiport``
  54. - Boolean
  55. - runtime
  56. - Control MultiPort E-Switch shared fdb mode.
  57. An experimental mode where a single E-Switch is used and all the vports
  58. and physical ports on the NIC are connected to it.
  59. An example is to send traffic from a VF that is created on PF0 to an
  60. uplink that is natively associated with the uplink of PF1
  61. Note: Future devices, ConnectX-8 and onward, will eventually have this
  62. as the default to allow forwarding between all NIC ports in a single
  63. E-switch environment and the dual E-switch mode will likely get
  64. deprecated.
  65. Default: disabled
  66. * - ``esw_port_metadata``
  67. - Boolean
  68. - runtime
  69. - When applicable, disabling eswitch metadata can increase packet rate up
  70. to 20% depending on the use case and packet sizes.
  71. Eswitch port metadata state controls whether to internally tag packets
  72. with metadata. Metadata tagging must be enabled for multi-port RoCE,
  73. failover between representors and stacked devices. By default metadata is
  74. enabled on the supported devices in E-switch. Metadata is applicable only
  75. for E-switch in switchdev mode and users may disable it when NONE of the
  76. below use cases will be in use:
  77. 1. HCA is in Dual/multi-port RoCE mode.
  78. 2. VF/SF representor bonding (Usually used for Live migration)
  79. 3. Stacked devices
  80. When metadata is disabled, the above use cases will fail to initialize if
  81. users try to enable them.
  82. Note: Setting this parameter does not take effect immediately. Setting
  83. must happen in legacy mode and eswitch port metadata takes effect after
  84. enabling switchdev mode.
  85. * - ``hairpin_num_queues``
  86. - u32
  87. - driverinit
  88. - We refer to a TC NIC rule that involves forwarding as "hairpin".
  89. Hairpin queues are mlx5 hardware specific implementation for hardware
  90. forwarding of such packets.
  91. Control the number of hairpin queues.
  92. * - ``hairpin_queue_size``
  93. - u32
  94. - driverinit
  95. - Control the size (in packets) of the hairpin queues.
  96. The ``mlx5`` driver supports reloading via ``DEVLINK_CMD_RELOAD``
  97. Info versions
  98. =============
  99. The ``mlx5`` driver reports the following versions
  100. .. list-table:: devlink info versions implemented
  101. :widths: 5 5 90
  102. * - Name
  103. - Type
  104. - Description
  105. * - ``fw.psid``
  106. - fixed
  107. - Used to represent the board id of the device.
  108. * - ``fw.version``
  109. - stored, running
  110. - Three digit major.minor.subminor firmware version number.
  111. Health reporters
  112. ================
  113. tx reporter
  114. -----------
  115. The tx reporter is responsible for reporting and recovering of the following three error scenarios:
  116. - tx timeout
  117. Report on kernel tx timeout detection.
  118. Recover by searching lost interrupts.
  119. - tx error completion
  120. Report on error tx completion.
  121. Recover by flushing the tx queue and reset it.
  122. - tx PTP port timestamping CQ unhealthy
  123. Report too many CQEs never delivered on port ts CQ.
  124. Recover by flushing and re-creating all PTP channels.
  125. tx reporter also support on demand diagnose callback, on which it provides
  126. real time information of its send queues status.
  127. User commands examples:
  128. - Diagnose send queues status::
  129. $ devlink health diagnose pci/0000:82:00.0 reporter tx
  130. .. note::
  131. This command has valid output only when interface is up, otherwise the command has empty output.
  132. - Show number of tx errors indicated, number of recover flows ended successfully,
  133. is autorecover enabled and graceful period from last recover::
  134. $ devlink health show pci/0000:82:00.0 reporter tx
  135. rx reporter
  136. -----------
  137. The rx reporter is responsible for reporting and recovering of the following two error scenarios:
  138. - rx queues' initialization (population) timeout
  139. Population of rx queues' descriptors on ring initialization is done
  140. in napi context via triggering an irq. In case of a failure to get
  141. the minimum amount of descriptors, a timeout would occur, and
  142. descriptors could be recovered by polling the EQ (Event Queue).
  143. - rx completions with errors (reported by HW on interrupt context)
  144. Report on rx completion error.
  145. Recover (if needed) by flushing the related queue and reset it.
  146. rx reporter also supports on demand diagnose callback, on which it
  147. provides real time information of its receive queues' status.
  148. - Diagnose rx queues' status and corresponding completion queue::
  149. $ devlink health diagnose pci/0000:82:00.0 reporter rx
  150. .. note::
  151. This command has valid output only when interface is up. Otherwise, the command has empty output.
  152. - Show number of rx errors indicated, number of recover flows ended successfully,
  153. is autorecover enabled, and graceful period from last recover::
  154. $ devlink health show pci/0000:82:00.0 reporter rx
  155. fw reporter
  156. -----------
  157. The fw reporter implements `diagnose` and `dump` callbacks.
  158. It follows symptoms of fw error such as fw syndrome by triggering
  159. fw core dump and storing it into the dump buffer.
  160. The fw reporter diagnose command can be triggered any time by the user to check
  161. current fw status.
  162. User commands examples:
  163. - Check fw heath status::
  164. $ devlink health diagnose pci/0000:82:00.0 reporter fw
  165. - Read FW core dump if already stored or trigger new one::
  166. $ devlink health dump show pci/0000:82:00.0 reporter fw
  167. .. note::
  168. This command can run only on the PF which has fw tracer ownership,
  169. running it on other PF or any VF will return "Operation not permitted".
  170. fw fatal reporter
  171. -----------------
  172. The fw fatal reporter implements `dump` and `recover` callbacks.
  173. It follows fatal errors indications by CR-space dump and recover flow.
  174. The CR-space dump uses vsc interface which is valid even if the FW command
  175. interface is not functional, which is the case in most FW fatal errors.
  176. The recover function runs recover flow which reloads the driver and triggers fw
  177. reset if needed.
  178. On firmware error, the health buffer is dumped into the dmesg. The log
  179. level is derived from the error's severity (given in health buffer).
  180. User commands examples:
  181. - Run fw recover flow manually::
  182. $ devlink health recover pci/0000:82:00.0 reporter fw_fatal
  183. - Read FW CR-space dump if already stored or trigger new one::
  184. $ devlink health dump show pci/0000:82:00.1 reporter fw_fatal
  185. .. note::
  186. This command can run only on PF.
  187. vnic reporter
  188. -------------
  189. The vnic reporter implements only the `diagnose` callback.
  190. It is responsible for querying the vnic diagnostic counters from fw and displaying
  191. them in realtime.
  192. Description of the vnic counters:
  193. - total_error_queues
  194. number of queues in an error state due to
  195. an async error or errored command.
  196. - send_queue_priority_update_flow
  197. number of QP/SQ priority/SL update events.
  198. - cq_overrun
  199. number of times CQ entered an error state due to an overflow.
  200. - async_eq_overrun
  201. number of times an EQ mapped to async events was overrun.
  202. - comp_eq_overrun
  203. number of times an EQ mapped to completion events was
  204. overrun.
  205. - quota_exceeded_command
  206. number of commands issued and failed due to quota exceeded.
  207. - invalid_command
  208. number of commands issued and failed dues to any reason other than quota
  209. exceeded.
  210. - nic_receive_steering_discard
  211. number of packets that completed RX flow
  212. steering but were discarded due to a mismatch in flow table.
  213. - generated_pkt_steering_fail
  214. number of packets generated by the VNIC experiencing unexpected steering
  215. failure (at any point in steering flow).
  216. - handled_pkt_steering_fail
  217. number of packets handled by the VNIC experiencing unexpected steering
  218. failure (at any point in steering flow owned by the VNIC, including the FDB
  219. for the eswitch owner).
  220. User commands examples:
  221. - Diagnose PF/VF vnic counters::
  222. $ devlink health diagnose pci/0000:82:00.1 reporter vnic
  223. - Diagnose representor vnic counters (performed by supplying devlink port of the
  224. representor, which can be obtained via devlink port command)::
  225. $ devlink health diagnose pci/0000:82:00.1/65537 reporter vnic
  226. .. note::
  227. This command can run over all interfaces such as PF/VF and representor ports.