162306a36Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci 362306a36Sopenharmony_ci============== 462306a36Sopenharmony_ciDevlink Params 562306a36Sopenharmony_ci============== 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci``devlink`` provides capability for a driver to expose device parameters for low 862306a36Sopenharmony_cilevel device functionality. Since devlink can operate at the device-wide 962306a36Sopenharmony_cilevel, it can be used to provide configuration that may affect multiple 1062306a36Sopenharmony_ciports on a single device. 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ciThis document describes a number of generic parameters that are supported 1362306a36Sopenharmony_ciacross multiple drivers. Each driver is also free to add their own 1462306a36Sopenharmony_ciparameters. Each driver must document the specific parameters they support, 1562306a36Sopenharmony_ciwhether generic or not. 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ciConfiguration modes 1862306a36Sopenharmony_ci=================== 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ciParameters may be set in different configuration modes. 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci.. list-table:: Possible configuration modes 2362306a36Sopenharmony_ci :widths: 5 90 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci * - Name 2662306a36Sopenharmony_ci - Description 2762306a36Sopenharmony_ci * - ``runtime`` 2862306a36Sopenharmony_ci - set while the driver is running, and takes effect immediately. No 2962306a36Sopenharmony_ci reset is required. 3062306a36Sopenharmony_ci * - ``driverinit`` 3162306a36Sopenharmony_ci - applied while the driver initializes. Requires the user to restart 3262306a36Sopenharmony_ci the driver using the ``devlink`` reload command. 3362306a36Sopenharmony_ci * - ``permanent`` 3462306a36Sopenharmony_ci - written to the device's non-volatile memory. A hard reset is required 3562306a36Sopenharmony_ci for it to take effect. 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ciReloading 3862306a36Sopenharmony_ci--------- 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ciIn order for ``driverinit`` parameters to take effect, the driver must 4162306a36Sopenharmony_cisupport reloading via the ``devlink-reload`` command. This command will 4262306a36Sopenharmony_cirequest a reload of the device driver. 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ci.. _devlink_params_generic: 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ciGeneric configuration parameters 4762306a36Sopenharmony_ci================================ 4862306a36Sopenharmony_ciThe following is a list of generic configuration parameters that drivers may 4962306a36Sopenharmony_ciadd. Use of generic parameters is preferred over each driver creating their 5062306a36Sopenharmony_ciown name. 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ci.. list-table:: List of generic parameters 5362306a36Sopenharmony_ci :widths: 5 5 90 5462306a36Sopenharmony_ci 5562306a36Sopenharmony_ci * - Name 5662306a36Sopenharmony_ci - Type 5762306a36Sopenharmony_ci - Description 5862306a36Sopenharmony_ci * - ``enable_sriov`` 5962306a36Sopenharmony_ci - Boolean 6062306a36Sopenharmony_ci - Enable Single Root I/O Virtualization (SRIOV) in the device. 6162306a36Sopenharmony_ci * - ``ignore_ari`` 6262306a36Sopenharmony_ci - Boolean 6362306a36Sopenharmony_ci - Ignore Alternative Routing-ID Interpretation (ARI) capability. If 6462306a36Sopenharmony_ci enabled, the adapter will ignore ARI capability even when the 6562306a36Sopenharmony_ci platform has support enabled. The device will create the same number 6662306a36Sopenharmony_ci of partitions as when the platform does not support ARI. 6762306a36Sopenharmony_ci * - ``msix_vec_per_pf_max`` 6862306a36Sopenharmony_ci - u32 6962306a36Sopenharmony_ci - Provides the maximum number of MSI-X interrupts that a device can 7062306a36Sopenharmony_ci create. Value is the same across all physical functions (PFs) in the 7162306a36Sopenharmony_ci device. 7262306a36Sopenharmony_ci * - ``msix_vec_per_pf_min`` 7362306a36Sopenharmony_ci - u32 7462306a36Sopenharmony_ci - Provides the minimum number of MSI-X interrupts required for the 7562306a36Sopenharmony_ci device to initialize. Value is the same across all physical functions 7662306a36Sopenharmony_ci (PFs) in the device. 7762306a36Sopenharmony_ci * - ``fw_load_policy`` 7862306a36Sopenharmony_ci - u8 7962306a36Sopenharmony_ci - Control the device's firmware loading policy. 8062306a36Sopenharmony_ci - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER`` (0) 8162306a36Sopenharmony_ci Load firmware version preferred by the driver. 8262306a36Sopenharmony_ci - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH`` (1) 8362306a36Sopenharmony_ci Load firmware currently stored in flash. 8462306a36Sopenharmony_ci - ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK`` (2) 8562306a36Sopenharmony_ci Load firmware currently available on host's disk. 8662306a36Sopenharmony_ci * - ``reset_dev_on_drv_probe`` 8762306a36Sopenharmony_ci - u8 8862306a36Sopenharmony_ci - Controls the device's reset policy on driver probe. 8962306a36Sopenharmony_ci - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_UNKNOWN`` (0) 9062306a36Sopenharmony_ci Unknown or invalid value. 9162306a36Sopenharmony_ci - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_ALWAYS`` (1) 9262306a36Sopenharmony_ci Always reset device on driver probe. 9362306a36Sopenharmony_ci - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_NEVER`` (2) 9462306a36Sopenharmony_ci Never reset device on driver probe. 9562306a36Sopenharmony_ci - ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_DISK`` (3) 9662306a36Sopenharmony_ci Reset the device only if firmware can be found in the filesystem. 9762306a36Sopenharmony_ci * - ``enable_roce`` 9862306a36Sopenharmony_ci - Boolean 9962306a36Sopenharmony_ci - Enable handling of RoCE traffic in the device. 10062306a36Sopenharmony_ci * - ``enable_eth`` 10162306a36Sopenharmony_ci - Boolean 10262306a36Sopenharmony_ci - When enabled, the device driver will instantiate Ethernet specific 10362306a36Sopenharmony_ci auxiliary device of the devlink device. 10462306a36Sopenharmony_ci * - ``enable_rdma`` 10562306a36Sopenharmony_ci - Boolean 10662306a36Sopenharmony_ci - When enabled, the device driver will instantiate RDMA specific 10762306a36Sopenharmony_ci auxiliary device of the devlink device. 10862306a36Sopenharmony_ci * - ``enable_vnet`` 10962306a36Sopenharmony_ci - Boolean 11062306a36Sopenharmony_ci - When enabled, the device driver will instantiate VDPA networking 11162306a36Sopenharmony_ci specific auxiliary device of the devlink device. 11262306a36Sopenharmony_ci * - ``enable_iwarp`` 11362306a36Sopenharmony_ci - Boolean 11462306a36Sopenharmony_ci - Enable handling of iWARP traffic in the device. 11562306a36Sopenharmony_ci * - ``internal_err_reset`` 11662306a36Sopenharmony_ci - Boolean 11762306a36Sopenharmony_ci - When enabled, the device driver will reset the device on internal 11862306a36Sopenharmony_ci errors. 11962306a36Sopenharmony_ci * - ``max_macs`` 12062306a36Sopenharmony_ci - u32 12162306a36Sopenharmony_ci - Typically macvlan, vlan net devices mac are also programmed in their 12262306a36Sopenharmony_ci parent netdevice's Function rx filter. This parameter limit the 12362306a36Sopenharmony_ci maximum number of unicast mac address filters to receive traffic from 12462306a36Sopenharmony_ci per ethernet port of this device. 12562306a36Sopenharmony_ci * - ``region_snapshot_enable`` 12662306a36Sopenharmony_ci - Boolean 12762306a36Sopenharmony_ci - Enable capture of ``devlink-region`` snapshots. 12862306a36Sopenharmony_ci * - ``enable_remote_dev_reset`` 12962306a36Sopenharmony_ci - Boolean 13062306a36Sopenharmony_ci - Enable device reset by remote host. When cleared, the device driver 13162306a36Sopenharmony_ci will NACK any attempt of other host to reset the device. This parameter 13262306a36Sopenharmony_ci is useful for setups where a device is shared by different hosts, such 13362306a36Sopenharmony_ci as multi-host setup. 13462306a36Sopenharmony_ci * - ``io_eq_size`` 13562306a36Sopenharmony_ci - u32 13662306a36Sopenharmony_ci - Control the size of I/O completion EQs. 13762306a36Sopenharmony_ci * - ``event_eq_size`` 13862306a36Sopenharmony_ci - u32 13962306a36Sopenharmony_ci - Control the size of asynchronous control events EQ. 140