^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ==============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Devlink Params
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) ==============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) ``devlink`` provides capability for a driver to expose device parameters for low
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) level device functionality. Since devlink can operate at the device-wide
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) level, it can be used to provide configuration that may affect multiple
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) ports on a single device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) This document describes a number of generic parameters that are supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) across multiple drivers. Each driver is also free to add their own
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) parameters. Each driver must document the specific parameters they support,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) whether generic or not.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) Configuration modes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) ===================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) Parameters may be set in different configuration modes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) .. list-table:: Possible configuration modes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) :widths: 5 90
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * - Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) - Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * - ``runtime``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) - set while the driver is running, and takes effect immediately. No
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) reset is required.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * - ``driverinit``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) - applied while the driver initializes. Requires the user to restart
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) the driver using the ``devlink`` reload command.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * - ``permanent``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) - written to the device's non-volatile memory. A hard reset is required
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) for it to take effect.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) Reloading
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) ---------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) In order for ``driverinit`` parameters to take effect, the driver must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) support reloading via the ``devlink-reload`` command. This command will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) request a reload of the device driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) .. _devlink_params_generic:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) Generic configuration parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) ================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) The following is a list of generic configuration parameters that drivers may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) add. Use of generic parameters is preferred over each driver creating their
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) own name.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) .. list-table:: List of generic parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) :widths: 5 5 90
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * - Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) - Type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) - Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) * - ``enable_sriov``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) - Boolean
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) - Enable Single Root I/O Virtualization (SRIOV) in the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) * - ``ignore_ari``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) - Boolean
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) - Ignore Alternative Routing-ID Interpretation (ARI) capability. If
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) enabled, the adapter will ignore ARI capability even when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) platform has support enabled. The device will create the same number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) of partitions as when the platform does not support ARI.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) * - ``msix_vec_per_pf_max``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) - u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) - Provides the maximum number of MSI-X interrupts that a device can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) create. Value is the same across all physical functions (PFs) in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) * - ``msix_vec_per_pf_min``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) - u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) - Provides the minimum number of MSI-X interrupts required for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) device to initialize. Value is the same across all physical functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) (PFs) in the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) * - ``fw_load_policy``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) - u8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) - Control the device's firmware loading policy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER`` (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) Load firmware version preferred by the driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH`` (1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) Load firmware currently stored in flash.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK`` (2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) Load firmware currently available on host's disk.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) * - ``reset_dev_on_drv_probe``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) - u8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) - Controls the device's reset policy on driver probe.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_UNKNOWN`` (0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) Unknown or invalid value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_ALWAYS`` (1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) Always reset device on driver probe.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_NEVER`` (2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) Never reset device on driver probe.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_DISK`` (3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) Reset the device only if firmware can be found in the filesystem.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) * - ``enable_roce``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) - Boolean
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) - Enable handling of RoCE traffic in the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) * - ``internal_err_reset``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) - Boolean
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) - When enabled, the device driver will reset the device on internal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) errors.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) * - ``max_macs``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) - u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) - Specifies the maximum number of MAC addresses per ethernet port of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) this device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) * - ``region_snapshot_enable``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) - Boolean
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) - Enable capture of ``devlink-region`` snapshots.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) * - ``enable_remote_dev_reset``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) - Boolean
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) - Enable device reset by remote host. When cleared, the device driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) will NACK any attempt of other host to reset the device. This parameter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) is useful for setups where a device is shared by different hosts, such
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) as multi-host setup.