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