2020-01-09 22:46:10 +00:00
|
|
|
Linux Devlink Documentation
|
|
|
|
===========================
|
|
|
|
|
|
|
|
devlink is an API to expose device information and resources not directly
|
|
|
|
related to any device class, such as chip-wide/switch-ASIC-wide configuration.
|
|
|
|
|
2022-03-15 06:00:04 +00:00
|
|
|
Locking
|
|
|
|
-------
|
|
|
|
|
|
|
|
Driver facing APIs are currently transitioning to allow more explicit
|
|
|
|
locking. Drivers can use the existing ``devlink_*`` set of APIs, or
|
|
|
|
new APIs prefixed by ``devl_*``. The older APIs handle all the locking
|
|
|
|
in devlink core, but don't allow registration of most sub-objects once
|
|
|
|
the main devlink object is itself registered. The newer ``devl_*`` APIs assume
|
|
|
|
the devlink instance lock is already held. Drivers can take the instance
|
2022-08-23 07:02:13 +00:00
|
|
|
lock by calling ``devl_lock()``. It is also held all callbacks of devlink
|
|
|
|
netlink commands.
|
2022-03-15 06:00:04 +00:00
|
|
|
|
|
|
|
Drivers are encouraged to use the devlink instance lock for their own needs.
|
|
|
|
|
2023-10-13 12:10:28 +00:00
|
|
|
Drivers need to be cautious when taking devlink instance lock and
|
|
|
|
taking RTNL lock at the same time. Devlink instance lock needs to be taken
|
|
|
|
first, only after that RTNL lock could be taken.
|
|
|
|
|
2023-10-13 12:10:27 +00:00
|
|
|
Nested instances
|
|
|
|
----------------
|
|
|
|
|
|
|
|
Some objects, like linecards or port functions, could have another
|
|
|
|
devlink instances created underneath. In that case, drivers should make
|
|
|
|
sure to respect following rules:
|
|
|
|
|
|
|
|
- Lock ordering should be maintained. If driver needs to take instance
|
|
|
|
lock of both nested and parent instances at the same time, devlink
|
|
|
|
instance lock of the parent instance should be taken first, only then
|
|
|
|
instance lock of the nested instance could be taken.
|
|
|
|
- Driver should use object-specific helpers to setup the
|
|
|
|
nested relationship:
|
|
|
|
|
|
|
|
- ``devl_nested_devlink_set()`` - called to setup devlink -> nested
|
|
|
|
devlink relationship (could be user for multiple nested instances.
|
|
|
|
- ``devl_port_fn_devlink_set()`` - called to setup port function ->
|
|
|
|
nested devlink relationship.
|
|
|
|
- ``devlink_linecard_nested_dl_set()`` - called to setup linecard ->
|
|
|
|
nested devlink relationship.
|
|
|
|
|
|
|
|
The nested devlink info is exposed to the userspace over object-specific
|
|
|
|
attributes of devlink netlink.
|
|
|
|
|
2020-01-09 22:46:16 +00:00
|
|
|
Interface documentation
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
The following pages describe various interfaces available through devlink in
|
|
|
|
general.
|
2020-01-09 22:46:10 +00:00
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
2020-01-09 22:46:24 +00:00
|
|
|
devlink-dpipe
|
2020-01-09 22:46:11 +00:00
|
|
|
devlink-health
|
2020-01-09 22:46:12 +00:00
|
|
|
devlink-info
|
2020-03-24 17:30:16 +00:00
|
|
|
devlink-flash
|
2020-01-09 22:46:13 +00:00
|
|
|
devlink-params
|
2020-12-12 06:12:23 +00:00
|
|
|
devlink-port
|
2020-01-09 22:46:20 +00:00
|
|
|
devlink-region
|
2020-01-09 22:46:23 +00:00
|
|
|
devlink-resource
|
2020-10-07 06:00:57 +00:00
|
|
|
devlink-reload
|
2022-07-30 02:20:57 +00:00
|
|
|
devlink-selftests
|
2020-01-09 22:46:10 +00:00
|
|
|
devlink-trap
|
2022-04-18 06:42:26 +00:00
|
|
|
devlink-linecard
|
2024-03-25 18:12:28 +00:00
|
|
|
devlink-eswitch-attr
|
2020-01-09 22:46:16 +00:00
|
|
|
|
|
|
|
Driver-specific documentation
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
Each driver that implements ``devlink`` is expected to document what
|
|
|
|
parameters, info versions, and other features it supports.
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
|
|
|
bnxt
|
2022-12-13 05:11:36 +00:00
|
|
|
etas_es58x
|
2021-07-26 02:47:01 +00:00
|
|
|
hns3
|
2023-10-18 12:35:55 +00:00
|
|
|
i40e
|
2020-01-09 22:46:21 +00:00
|
|
|
ionic
|
2020-03-12 01:58:17 +00:00
|
|
|
ice
|
2020-01-09 22:46:18 +00:00
|
|
|
mlx4
|
2020-01-09 22:46:16 +00:00
|
|
|
mlx5
|
|
|
|
mlxsw
|
|
|
|
mv88e6xxx
|
2020-01-09 22:46:22 +00:00
|
|
|
netdevsim
|
2020-01-09 22:46:16 +00:00
|
|
|
nfp
|
2020-01-09 22:46:19 +00:00
|
|
|
qed
|
2020-01-09 22:46:16 +00:00
|
|
|
ti-cpsw-switch
|
2021-02-11 10:56:41 +00:00
|
|
|
am65-nuss-cpsw-switch
|
2021-06-16 17:46:07 +00:00
|
|
|
prestera
|
2021-09-19 17:28:18 +00:00
|
|
|
iosm
|
2021-10-28 13:08:15 +00:00
|
|
|
octeontx2
|
2023-02-15 09:08:22 +00:00
|
|
|
sfc
|