devlink-params.rst 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ==============
  3. Devlink Params
  4. ==============
  5. ``devlink`` provides capability for a driver to expose device parameters for low
  6. level device functionality. Since devlink can operate at the device-wide
  7. level, it can be used to provide configuration that may affect multiple
  8. ports on a single device.
  9. This document describes a number of generic parameters that are supported
  10. across multiple drivers. Each driver is also free to add their own
  11. parameters. Each driver must document the specific parameters they support,
  12. whether generic or not.
  13. Configuration modes
  14. ===================
  15. Parameters may be set in different configuration modes.
  16. .. list-table:: Possible configuration modes
  17. :widths: 5 90
  18. * - Name
  19. - Description
  20. * - ``runtime``
  21. - set while the driver is running, and takes effect immediately. No
  22. reset is required.
  23. * - ``driverinit``
  24. - applied while the driver initializes. Requires the user to restart
  25. the driver using the ``devlink`` reload command.
  26. * - ``permanent``
  27. - written to the device's non-volatile memory. A hard reset is required
  28. for it to take effect.
  29. Reloading
  30. ---------
  31. In order for ``driverinit`` parameters to take effect, the driver must
  32. support reloading via the ``devlink-reload`` command. This command will
  33. request a reload of the device driver.
  34. Default parameter values
  35. =========================
  36. Drivers may optionally export default values for parameters of cmode
  37. ``runtime`` and ``permanent``. For ``driverinit`` parameters, the last
  38. value set by the driver will be used as the default value. Drivers can
  39. also support resetting params with cmode ``runtime`` and ``permanent``
  40. to their default values. Resetting ``driverinit`` params is supported
  41. by devlink core without additional driver support needed.
  42. .. _devlink_params_generic:
  43. Generic configuration parameters
  44. ================================
  45. The following is a list of generic configuration parameters that drivers may
  46. add. Use of generic parameters is preferred over each driver creating their
  47. own name.
  48. .. list-table:: List of generic parameters
  49. :widths: 5 5 90
  50. * - Name
  51. - Type
  52. - Description
  53. * - ``enable_sriov``
  54. - Boolean
  55. - Enable Single Root I/O Virtualization (SRIOV) in the device.
  56. * - ``ignore_ari``
  57. - Boolean
  58. - Ignore Alternative Routing-ID Interpretation (ARI) capability. If
  59. enabled, the adapter will ignore ARI capability even when the
  60. platform has support enabled. The device will create the same number
  61. of partitions as when the platform does not support ARI.
  62. * - ``msix_vec_per_pf_max``
  63. - u32
  64. - Provides the maximum number of MSI-X interrupts that a device can
  65. create. Value is the same across all physical functions (PFs) in the
  66. device.
  67. * - ``msix_vec_per_pf_min``
  68. - u32
  69. - Provides the minimum number of MSI-X interrupts required for the
  70. device to initialize. Value is the same across all physical functions
  71. (PFs) in the device.
  72. * - ``fw_load_policy``
  73. - u8
  74. - Control the device's firmware loading policy.
  75. - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER`` (0)
  76. Load firmware version preferred by the driver.
  77. - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH`` (1)
  78. Load firmware currently stored in flash.
  79. - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK`` (2)
  80. Load firmware currently available on host's disk.
  81. * - ``reset_dev_on_drv_probe``
  82. - u8
  83. - Controls the device's reset policy on driver probe.
  84. - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_UNKNOWN`` (0)
  85. Unknown or invalid value.
  86. - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_ALWAYS`` (1)
  87. Always reset device on driver probe.
  88. - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_NEVER`` (2)
  89. Never reset device on driver probe.
  90. - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_DISK`` (3)
  91. Reset the device only if firmware can be found in the filesystem.
  92. * - ``enable_roce``
  93. - Boolean
  94. - Enable handling of RoCE traffic in the device.
  95. * - ``enable_eth``
  96. - Boolean
  97. - When enabled, the device driver will instantiate Ethernet specific
  98. auxiliary device of the devlink device.
  99. * - ``enable_rdma``
  100. - Boolean
  101. - When enabled, the device driver will instantiate RDMA specific
  102. auxiliary device of the devlink device.
  103. * - ``enable_vnet``
  104. - Boolean
  105. - When enabled, the device driver will instantiate VDPA networking
  106. specific auxiliary device of the devlink device.
  107. * - ``enable_iwarp``
  108. - Boolean
  109. - Enable handling of iWARP traffic in the device.
  110. * - ``internal_err_reset``
  111. - Boolean
  112. - When enabled, the device driver will reset the device on internal
  113. errors.
  114. * - ``max_macs``
  115. - u32
  116. - Typically macvlan, vlan net devices mac are also programmed in their
  117. parent netdevice's Function rx filter. This parameter limit the
  118. maximum number of unicast mac address filters to receive traffic from
  119. per ethernet port of this device.
  120. * - ``region_snapshot_enable``
  121. - Boolean
  122. - Enable capture of ``devlink-region`` snapshots.
  123. * - ``enable_remote_dev_reset``
  124. - Boolean
  125. - Enable device reset by remote host. When cleared, the device driver
  126. will NACK any attempt of other host to reset the device. This parameter
  127. is useful for setups where a device is shared by different hosts, such
  128. as multi-host setup.
  129. * - ``io_eq_size``
  130. - u32
  131. - Control the size of I/O completion EQs.
  132. * - ``event_eq_size``
  133. - u32
  134. - Control the size of asynchronous control events EQ.
  135. * - ``enable_phc``
  136. - Boolean
  137. - Enable PHC (PTP Hardware Clock) functionality in the device.
  138. * - ``clock_id``
  139. - u64
  140. - Clock ID used by the device for registering DPLL devices and pins.
  141. * - ``total_vfs``
  142. - u32
  143. - The max number of Virtual Functions (VFs) exposed by the PF.
  144. after reboot/pci reset, 'sriov_totalvfs' entry under the device's sysfs
  145. directory will report this value.
  146. * - ``num_doorbells``
  147. - u32
  148. - Controls the number of doorbells used by the device.
  149. * - ``max_mac_per_vf``
  150. - u32
  151. - Controls the maximum number of MAC address filters that can be assigned
  152. to a Virtual Function (VF).