요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
==============
Devlink Params
==============
``devlink`` provides capability for a driver to expose device parameters for low
level device functionality. Since devlink can operate at the device-wide
level, it can be used to provide configuration that may affect multiple
ports on a single device.
This document describes a number of generic parameters that are supported
across multiple drivers. Each driver is also free to add their own
parameters. Each driver must document the specific parameters they support,
whether generic or not.
Configuration modes
===================
Parameters may be set in different configuration modes.
.. list-table:: Possible configuration modes
:widths: 5 90
* - Name
- Description
* - ``runtime``
- set while the driver is running, and takes effect immediately. No
reset is required.
* - ``driverinit``
- applied while the driver initializes. Requires the user to restart
the driver using the ``devlink`` reload command.
* - ``permanent``
- written to the device's non-volatile memory. A hard reset is required
for it to take effect.
Reloading
---------
In order for ``driverinit`` parameters to take effect, the driver must
support reloading via the ``devlink-reload`` command. This command will
request a reload of the device driver.
.. _devlink_params_generic:
Generic configuration parameters
================================
The following is a list of generic configuration parameters that drivers may
add. Use of generic parameters is preferred over each driver creating their
own name.
.. list-table:: List of generic parameters
:widths: 5 5 90
* - Name
- Type
- Description
* - ``enable_sriov``
- Boolean
- Enable Single Root I/O Virtualization (SRIOV) in the device.
* - ``ignore_ari``
- Boolean
- Ignore Alternative Routing-ID Interpretation (ARI) capability. If
enabled, the adapter will ignore ARI capability even when the
platform has support enabled. The device will create the same number
of partitions as when the platform does not support ARI.
* - ``msix_vec_per_pf_max``
- u32
- Provides the maximum number of MSI-X interrupts that a device can
create. Value is the same across all physical functions (PFs) in the
device.
* - ``msix_vec_per_pf_min``
- u32
- Provides the minimum number of MSI-X interrupts required for the
device to initialize. Value is the same across all physical functions
(PFs) in the device.
* - ``fw_load_policy``
- u8
- Control the device's firmware loading policy.
- ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER`` (0)
Load firmware version preferred by the driver.
- ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH`` (1)
Load firmware currently stored in flash.
- ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK`` (2)
Load firmware currently available on host's disk.
* - ``reset_dev_on_drv_probe``
- u8
- Controls the device's reset policy on driver probe.
- ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_UNKNOWN`` (0)
Unknown or invalid value.
- ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_ALWAYS`` (1)
Always reset device on driver probe.
- ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_NEVER`` (2)
Never reset device on driver probe.
- ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_DISK`` (3)
Reset the device only if firmware can be found in the filesystem.
* - ``enable_roce``
- Boolean
- Enable handling of RoCE traffic in the device.
* - ``enable_eth``
- Boolean
- When enabled, the device driver will instantiate Ethernet specific
auxiliary device of the devlink device.
* - ``enable_rdma``
- Boolean
- When enabled, the device driver will instantiate RDMA specific
auxiliary device of the devlink device.
* - ``enable_vnet``
- Boolean
- When enabled, the device driver will instantiate VDPA networking
specific auxiliary device of the devlink device.
* - ``enable_iwarp``
- Boolean
- Enable handling of iWARP traffic in the device.
* - ``internal_err_reset``
- Boolean
- When enabled, the device driver will reset the device on internal
errors.
* - ``max_macs``
- u32
- Typically macvlan, vlan net devices mac are also programmed in their
parent netdevice's Function rx filter. This parameter limit the
maximum number of unicast mac address filters to receive traffic from
per ethernet port of this device.
* - ``region_snapshot_enable``
- Boolean
- Enable capture of ``devlink-region`` snapshots.
* - ``enable_remote_dev_reset``
- Boolean
- Enable device reset by remote host. When cleared, the device driver
will NACK any attempt of other host to reset the device. This parameter
is useful for setups where a device is shared by different hosts, such
as multi-host setup.
* - ``io_eq_size``
- u32
- Control the size of I/O completion EQs.
* - ``event_eq_size``
- u32
- Control the size of asynchronous control events EQ.
* - ``enable_phc``
- Boolean
- Enable PHC (PTP Hardware Clock) functionality in the device.
* - ``clock_id``
- u64
- Clock ID used by the device for registering DPLL devices and pins.
* - ``total_vfs``
- u32
- The max number of Virtual Functions (VFs) exposed by the PF.
after reboot/pci reset, 'sriov_totalvfs' entry under the device's sysfs
directory will report this value.
* - ``num_doorbells``
- u32
- Controls the number of doorbells used by the device.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Devlink Params 소개
1-16이 문서는 `GPL-2.0` 라이선스를 따릅니다.
Devlink Params
`devlink`를 사용하면 driver가 저수준 장치 기능을 위한 device parameter를 노출할 수 있습니다. devlink는 장치 전체 범위에서 동작하므로 한 장치의 여러 port에 영향을 줄 수 있는 configuration을 제공할 수 있습니다.
이 문서는 여러 driver가 공통으로 지원하는 generic parameter를 설명합니다. 각 driver는 자체 parameter를 추가할 수 있습니다.
모든 driver는 generic 여부와 관계없이 자신이 지원하는 구체적인 parameter를 문서화해야 합니다.
.. SPDX-License-Identifier: GPL-2.0
==============
Devlink Params
==============
``devlink`` provides capability for a driver to expose device parameters for low
level device functionality. Since devlink can operate at the device-wide
level, it can be used to provide configuration that may affect multiple
ports on a single device.
This document describes a number of generic parameters that are supported
across multiple drivers. Each driver is also free to add their own
parameters. Each driver must document the specific parameters they support,
whether generic or not.
Configuration mode와 reload
17-43Configuration mode
parameter는 서로 다른 configuration mode로 설정할 수 있습니다.
값이 적용되는 시점과 필요한 restart 수준을 구분합니다.
Reloading
`driverinit` parameter를 적용하려면 driver가 `devlink-reload` command를 통한 reload를 지원해야 합니다. 이 command는 device driver의 reload를 요청합니다.
mode에 따라 즉시 적용하거나 driver 또는 hardware를 다시 시작합니다.
Configuration modes
===================
Parameters may be set in different configuration modes.
.. list-table:: Possible configuration modes
:widths: 5 90
* - Name
- Description
* - ``runtime``
- set while the driver is running, and takes effect immediately. No
reset is required.
* - ``driverinit``
- applied while the driver initializes. Requires the user to restart
the driver using the ``devlink`` reload command.
* - ``permanent``
- written to the device's non-volatile memory. A hard reset is required
for it to take effect.
Reloading
---------
In order for ``driverinit`` parameters to take effect, the driver must
support reloading via the ``devlink-reload`` command. This command will
request a reload of the device driver.
Generic parameter: virtualization과 firmware
44-85Generic configuration parameter
다음은 driver가 추가할 수 있는 generic configuration parameter 목록입니다. driver마다 자체 이름을 만드는 것보다 generic parameter를 사용하는 편이 좋습니다.
SR-IOV와 ARI, PF별 MSI-X 범위, firmware loading source를 제어합니다.
firmware를 선택할 위치 또는 결정 주체입니다.
.. _devlink_params_generic:
Generic configuration parameters
================================
The following is a list of generic configuration parameters that drivers may
add. Use of generic parameters is preferred over each driver creating their
own name.
.. list-table:: List of generic parameters
:widths: 5 5 90
* - Name
- Type
- Description
* - ``enable_sriov``
- Boolean
- Enable Single Root I/O Virtualization (SRIOV) in the device.
* - ``ignore_ari``
- Boolean
- Ignore Alternative Routing-ID Interpretation (ARI) capability. If
enabled, the adapter will ignore ARI capability even when the
platform has support enabled. The device will create the same number
of partitions as when the platform does not support ARI.
* - ``msix_vec_per_pf_max``
- u32
- Provides the maximum number of MSI-X interrupts that a device can
create. Value is the same across all physical functions (PFs) in the
device.
* - ``msix_vec_per_pf_min``
- u32
- Provides the minimum number of MSI-X interrupts required for the
device to initialize. Value is the same across all physical functions
(PFs) in the device.
* - ``fw_load_policy``
- u8
- Control the device's firmware loading policy.
- ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER`` (0)
Load firmware version preferred by the driver.
- ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH`` (1)
Load firmware currently stored in flash.
- ``DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DISK`` (2)
Load firmware currently available on host's disk.
Generic parameter: probe reset과 protocol 기능
86-124driver probe 중 reset 정책과 network protocol별 기능 생성을 제어합니다.
probe 시점의 장치 reset 조건입니다.
* - ``reset_dev_on_drv_probe``
- u8
- Controls the device's reset policy on driver probe.
- ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_UNKNOWN`` (0)
Unknown or invalid value.
- ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_ALWAYS`` (1)
Always reset device on driver probe.
- ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_NEVER`` (2)
Never reset device on driver probe.
- ``DEVLINK_PARAM_RESET_DEV_ON_DRV_PROBE_VALUE_DISK`` (3)
Reset the device only if firmware can be found in the filesystem.
* - ``enable_roce``
- Boolean
- Enable handling of RoCE traffic in the device.
* - ``enable_eth``
- Boolean
- When enabled, the device driver will instantiate Ethernet specific
auxiliary device of the devlink device.
* - ``enable_rdma``
- Boolean
- When enabled, the device driver will instantiate RDMA specific
auxiliary device of the devlink device.
* - ``enable_vnet``
- Boolean
- When enabled, the device driver will instantiate VDPA networking
specific auxiliary device of the devlink device.
* - ``enable_iwarp``
- Boolean
- Enable handling of iWARP traffic in the device.
* - ``internal_err_reset``
- Boolean
- When enabled, the device driver will reset the device on internal
errors.
* - ``max_macs``
- u32
- Typically macvlan, vlan net devices mac are also programmed in their
parent netdevice's Function rx filter. This parameter limit the
maximum number of unicast mac address filters to receive traffic from
per ethernet port of this device.
Generic parameter: snapshot, queue, clock과 VF
125-153snapshot, remote reset, event queue, PHC·DPLL, VF와 doorbell resource를 제어합니다.
* - ``region_snapshot_enable``
- Boolean
- Enable capture of ``devlink-region`` snapshots.
* - ``enable_remote_dev_reset``
- Boolean
- Enable device reset by remote host. When cleared, the device driver
will NACK any attempt of other host to reset the device. This parameter
is useful for setups where a device is shared by different hosts, such
as multi-host setup.
* - ``io_eq_size``
- u32
- Control the size of I/O completion EQs.
* - ``event_eq_size``
- u32
- Control the size of asynchronous control events EQ.
* - ``enable_phc``
- Boolean
- Enable PHC (PTP Hardware Clock) functionality in the device.
* - ``clock_id``
- u64
- Clock ID used by the device for registering DPLL devices and pins.
* - ``total_vfs``
- u32
- The max number of Virtual Functions (VFs) exposed by the PF.
after reboot/pci reset, 'sriov_totalvfs' entry under the device's sysfs
directory will report this value.
* - ``num_doorbells``
- u32
- Controls the number of doorbells used by the device.
요약·해설
devlink-params.rst:1-153Devlink parameter는 한 장치의 여러 port에 영향을 주는 저수준 설정 surface입니다. 적용 mode가 즉시 변경, driver reload, hard reset 중 무엇을 요구하는지 먼저 확인해야 하며, 가능하면 driver 전용 이름보다 표준 generic parameter를 사용해야 합니다.
설정 mode를 확인한 뒤 필요한 범위만 다시 시작합니다.
공통 parameter가 다루는 주요 기능 영역입니다.