xref: /linux/Documentation/networking/devlink/devlink-params.rst (revision 6dfafbd0299a60bfb5d5e277fdf100037c7ded07)
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
37Reloading
38---------
39
40In order for ``driverinit`` parameters to take effect, the driver must
41support reloading via the ``devlink-reload`` command. This command will
42request a reload of the device driver.
43
44Default parameter values
45=========================
46
47Drivers may optionally export default values for parameters of cmode
48``runtime`` and ``permanent``. For ``driverinit`` parameters, the last
49value set by the driver will be used as the default value. Drivers can
50also support resetting params with cmode ``runtime`` and ``permanent``
51to their default values. Resetting ``driverinit`` params is supported
52by devlink core without additional driver support needed.
53
54.. _devlink_params_generic:
55
56Generic configuration parameters
57================================
58The following is a list of generic configuration parameters that drivers may
59add. Use of generic parameters is preferred over each driver creating their
60own name.
61
62.. list-table:: List of generic parameters
63   :widths: 5 5 90
64
65   * - Name
66     - Type
67     - Description
68   * - ``enable_sriov``
69     - Boolean
70     - Enable Single Root I/O Virtualization (SRIOV) in the device.
71   * - ``ignore_ari``
72     - Boolean
73     - Ignore Alternative Routing-ID Interpretation (ARI) capability. If
74       enabled, the adapter will ignore ARI capability even when the
75       platform has support enabled. The device will create the same number
76       of partitions as when the platform does not support ARI.
77   * - ``msix_vec_per_pf_max``
78     - u32
79     - Provides the maximum number of MSI-X interrupts that a device can
80       create. Value is the same across all physical functions (PFs) in the
81       device.
82   * - ``msix_vec_per_pf_min``
83     - u32
84     - Provides the minimum number of MSI-X interrupts required for the
85       device to initialize. Value is the same across all physical functions
86       (PFs) in the device.
87   * - ``fw_load_policy``
88     - u8
89     - Control the device's firmware loading policy.
90        - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER`` (0)
91          Load firmware version preferred by the driver.
92        - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH`` (1)
93          Load firmware currently stored in flash.
94        - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK`` (2)
95          Load firmware currently available on host's disk.
96   * - ``reset_dev_on_drv_probe``
97     - u8
98     - Controls the device's reset policy on driver probe.
99        - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_UNKNOWN`` (0)
100          Unknown or invalid value.
101        - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_ALWAYS`` (1)
102          Always reset device on driver probe.
103        - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_NEVER`` (2)
104          Never reset device on driver probe.
105        - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_DISK`` (3)
106          Reset the device only if firmware can be found in the filesystem.
107   * - ``enable_roce``
108     - Boolean
109     - Enable handling of RoCE traffic in the device.
110   * - ``enable_eth``
111     - Boolean
112     - When enabled, the device driver will instantiate Ethernet specific
113       auxiliary device of the devlink device.
114   * - ``enable_rdma``
115     - Boolean
116     - When enabled, the device driver will instantiate RDMA specific
117       auxiliary device of the devlink device.
118   * - ``enable_vnet``
119     - Boolean
120     - When enabled, the device driver will instantiate VDPA networking
121       specific auxiliary device of the devlink device.
122   * - ``enable_iwarp``
123     - Boolean
124     - Enable handling of iWARP traffic in the device.
125   * - ``internal_err_reset``
126     - Boolean
127     - When enabled, the device driver will reset the device on internal
128       errors.
129   * - ``max_macs``
130     - u32
131     - Typically macvlan, vlan net devices mac are also programmed in their
132       parent netdevice's Function rx filter. This parameter limit the
133       maximum number of unicast mac address filters to receive traffic from
134       per ethernet port of this device.
135   * - ``region_snapshot_enable``
136     - Boolean
137     - Enable capture of ``devlink-region`` snapshots.
138   * - ``enable_remote_dev_reset``
139     - Boolean
140     - Enable device reset by remote host. When cleared, the device driver
141       will NACK any attempt of other host to reset the device. This parameter
142       is useful for setups where a device is shared by different hosts, such
143       as multi-host setup.
144   * - ``io_eq_size``
145     - u32
146     - Control the size of I/O completion EQs.
147   * - ``event_eq_size``
148     - u32
149     - Control the size of asynchronous control events EQ.
150   * - ``enable_phc``
151     - Boolean
152     - Enable PHC (PTP Hardware Clock) functionality in the device.
153   * - ``clock_id``
154     - u64
155     - Clock ID used by the device for registering DPLL devices and pins.
156   * - ``total_vfs``
157     - u32
158     - The max number of Virtual Functions (VFs) exposed by the PF.
159       after reboot/pci reset, 'sriov_totalvfs' entry under the device's sysfs
160       directory will report this value.
161   * - ``num_doorbells``
162     - u32
163     - Controls the number of doorbells used by the device.
164   * - ``max_mac_per_vf``
165     - u32
166     - Controls the maximum number of MAC address filters that can be assigned
167       to a Virtual Function (VF).
168