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