xref: /linux/Documentation/networking/devlink/devlink-params.rst (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
18559dc33SJacob Keller.. SPDX-License-Identifier: GPL-2.0
28559dc33SJacob Keller
38559dc33SJacob Keller==============
48559dc33SJacob KellerDevlink Params
58559dc33SJacob Keller==============
68559dc33SJacob Keller
78559dc33SJacob Keller``devlink`` provides capability for a driver to expose device parameters for low
88559dc33SJacob Kellerlevel device functionality. Since devlink can operate at the device-wide
98559dc33SJacob Kellerlevel, it can be used to provide configuration that may affect multiple
108559dc33SJacob Kellerports on a single device.
118559dc33SJacob Keller
128559dc33SJacob KellerThis document describes a number of generic parameters that are supported
138559dc33SJacob Kelleracross multiple drivers. Each driver is also free to add their own
148559dc33SJacob Kellerparameters. Each driver must document the specific parameters they support,
158559dc33SJacob Kellerwhether generic or not.
168559dc33SJacob Keller
178559dc33SJacob KellerConfiguration modes
188559dc33SJacob Keller===================
198559dc33SJacob Keller
208559dc33SJacob KellerParameters may be set in different configuration modes.
218559dc33SJacob Keller
228559dc33SJacob Keller.. list-table:: Possible configuration modes
238559dc33SJacob Keller   :widths: 5 90
248559dc33SJacob Keller
258559dc33SJacob Keller   * - Name
268559dc33SJacob Keller     - Description
278559dc33SJacob Keller   * - ``runtime``
288559dc33SJacob Keller     - set while the driver is running, and takes effect immediately. No
298559dc33SJacob Keller       reset is required.
308559dc33SJacob Keller   * - ``driverinit``
318559dc33SJacob Keller     - applied while the driver initializes. Requires the user to restart
328559dc33SJacob Keller       the driver using the ``devlink`` reload command.
338559dc33SJacob Keller   * - ``permanent``
348559dc33SJacob Keller     - written to the device's non-volatile memory. A hard reset is required
358559dc33SJacob Keller       for it to take effect.
368559dc33SJacob Keller
375948f85bSJacob KellerReloading
385948f85bSJacob Keller---------
395948f85bSJacob Keller
405948f85bSJacob KellerIn order for ``driverinit`` parameters to take effect, the driver must
415948f85bSJacob Kellersupport reloading via the ``devlink-reload`` command. This command will
425948f85bSJacob Kellerrequest a reload of the device driver.
435948f85bSJacob Keller
44cd556e40SJakub Kicinski.. _devlink_params_generic:
45cd556e40SJakub Kicinski
468559dc33SJacob KellerGeneric configuration parameters
478559dc33SJacob Keller================================
488559dc33SJacob KellerThe following is a list of generic configuration parameters that drivers may
498559dc33SJacob Kelleradd. Use of generic parameters is preferred over each driver creating their
508559dc33SJacob Kellerown name.
518559dc33SJacob Keller
528559dc33SJacob Keller.. list-table:: List of generic parameters
538559dc33SJacob Keller   :widths: 5 5 90
548559dc33SJacob Keller
558559dc33SJacob Keller   * - Name
568559dc33SJacob Keller     - Type
578559dc33SJacob Keller     - Description
588559dc33SJacob Keller   * - ``enable_sriov``
598559dc33SJacob Keller     - Boolean
608559dc33SJacob Keller     - Enable Single Root I/O Virtualization (SRIOV) in the device.
618559dc33SJacob Keller   * - ``ignore_ari``
628559dc33SJacob Keller     - Boolean
638559dc33SJacob Keller     - Ignore Alternative Routing-ID Interpretation (ARI) capability. If
648559dc33SJacob Keller       enabled, the adapter will ignore ARI capability even when the
658559dc33SJacob Keller       platform has support enabled. The device will create the same number
668559dc33SJacob Keller       of partitions as when the platform does not support ARI.
678559dc33SJacob Keller   * - ``msix_vec_per_pf_max``
688559dc33SJacob Keller     - u32
698559dc33SJacob Keller     - Provides the maximum number of MSI-X interrupts that a device can
708559dc33SJacob Keller       create. Value is the same across all physical functions (PFs) in the
718559dc33SJacob Keller       device.
728559dc33SJacob Keller   * - ``msix_vec_per_pf_min``
738559dc33SJacob Keller     - u32
748559dc33SJacob Keller     - Provides the minimum number of MSI-X interrupts required for the
758559dc33SJacob Keller       device to initialize. Value is the same across all physical functions
768559dc33SJacob Keller       (PFs) in the device.
778559dc33SJacob Keller   * - ``fw_load_policy``
788559dc33SJacob Keller     - u8
798559dc33SJacob Keller     - Control the device's firmware loading policy.
808559dc33SJacob Keller        - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER`` (0)
818559dc33SJacob Keller          Load firmware version preferred by the driver.
828559dc33SJacob Keller        - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH`` (1)
838559dc33SJacob Keller          Load firmware currently stored in flash.
848559dc33SJacob Keller        - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK`` (2)
858559dc33SJacob Keller          Load firmware currently available on host's disk.
868559dc33SJacob Keller   * - ``reset_dev_on_drv_probe``
878559dc33SJacob Keller     - u8
888559dc33SJacob Keller     - Controls the device's reset policy on driver probe.
898559dc33SJacob Keller        - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_UNKNOWN`` (0)
908559dc33SJacob Keller          Unknown or invalid value.
918559dc33SJacob Keller        - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_ALWAYS`` (1)
928559dc33SJacob Keller          Always reset device on driver probe.
938559dc33SJacob Keller        - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_NEVER`` (2)
948559dc33SJacob Keller          Never reset device on driver probe.
958559dc33SJacob Keller        - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_DISK`` (3)
968559dc33SJacob Keller          Reset the device only if firmware can be found in the filesystem.
978559dc33SJacob Keller   * - ``enable_roce``
988559dc33SJacob Keller     - Boolean
998559dc33SJacob Keller     - Enable handling of RoCE traffic in the device.
100f13a5ad8SParav Pandit   * - ``enable_eth``
101f13a5ad8SParav Pandit     - Boolean
102f13a5ad8SParav Pandit     - When enabled, the device driver will instantiate Ethernet specific
103f13a5ad8SParav Pandit       auxiliary device of the devlink device.
1048ddaabeeSParav Pandit   * - ``enable_rdma``
1058ddaabeeSParav Pandit     - Boolean
1068ddaabeeSParav Pandit     - When enabled, the device driver will instantiate RDMA specific
1078ddaabeeSParav Pandit       auxiliary device of the devlink device.
108076b2a9dSParav Pandit   * - ``enable_vnet``
109076b2a9dSParav Pandit     - Boolean
110076b2a9dSParav Pandit     - When enabled, the device driver will instantiate VDPA networking
111076b2a9dSParav Pandit       specific auxiliary device of the devlink device.
112325e0d0aSShiraz Saleem   * - ``enable_iwarp``
113325e0d0aSShiraz Saleem     - Boolean
114325e0d0aSShiraz Saleem     - Enable handling of iWARP traffic in the device.
115d56a0c47SJacob Keller   * - ``internal_err_reset``
116d56a0c47SJacob Keller     - Boolean
117d56a0c47SJacob Keller     - When enabled, the device driver will reset the device on internal
118d56a0c47SJacob Keller       errors.
119d56a0c47SJacob Keller   * - ``max_macs``
120d56a0c47SJacob Keller     - u32
121*0ad598d0SShay Drory     - Typically macvlan, vlan net devices mac are also programmed in their
122*0ad598d0SShay Drory       parent netdevice's Function rx filter. This parameter limit the
123*0ad598d0SShay Drory       maximum number of unicast mac address filters to receive traffic from
124*0ad598d0SShay Drory       per ethernet port of this device.
125d56a0c47SJacob Keller   * - ``region_snapshot_enable``
126d56a0c47SJacob Keller     - Boolean
127d56a0c47SJacob Keller     - Enable capture of ``devlink-region`` snapshots.
128195d9decSMoshe Shemesh   * - ``enable_remote_dev_reset``
129195d9decSMoshe Shemesh     - Boolean
130195d9decSMoshe Shemesh     - Enable device reset by remote host. When cleared, the device driver
131195d9decSMoshe Shemesh       will NACK any attempt of other host to reset the device. This parameter
132195d9decSMoshe Shemesh       is useful for setups where a device is shared by different hosts, such
133195d9decSMoshe Shemesh       as multi-host setup.
13447402385SShay Drory   * - ``io_eq_size``
13547402385SShay Drory     - u32
13647402385SShay Drory     - Control the size of I/O completion EQs.
1370b5705ebSShay Drory   * - ``event_eq_size``
1380b5705ebSShay Drory     - u32
1390b5705ebSShay Drory     - Control the size of asynchronous control events EQ.
140