100 lines · plain
1Linux Devlink Documentation2===========================3 4devlink is an API to expose device information and resources not directly5related to any device class, such as chip-wide/switch-ASIC-wide configuration.6 7Locking8-------9 10Driver facing APIs are currently transitioning to allow more explicit11locking. Drivers can use the existing ``devlink_*`` set of APIs, or12new APIs prefixed by ``devl_*``. The older APIs handle all the locking13in devlink core, but don't allow registration of most sub-objects once14the main devlink object is itself registered. The newer ``devl_*`` APIs assume15the devlink instance lock is already held. Drivers can take the instance16lock by calling ``devl_lock()``. It is also held all callbacks of devlink17netlink commands.18 19Drivers are encouraged to use the devlink instance lock for their own needs.20 21Drivers need to be cautious when taking devlink instance lock and22taking RTNL lock at the same time. Devlink instance lock needs to be taken23first, only after that RTNL lock could be taken.24 25Nested instances26----------------27 28Some objects, like linecards or port functions, could have another29devlink instances created underneath. In that case, drivers should make30sure to respect following rules:31 32 - Lock ordering should be maintained. If driver needs to take instance33 lock of both nested and parent instances at the same time, devlink34 instance lock of the parent instance should be taken first, only then35 instance lock of the nested instance could be taken.36 - Driver should use object-specific helpers to setup the37 nested relationship:38 39 - ``devl_nested_devlink_set()`` - called to setup devlink -> nested40 devlink relationship (could be user for multiple nested instances.41 - ``devl_port_fn_devlink_set()`` - called to setup port function ->42 nested devlink relationship.43 - ``devlink_linecard_nested_dl_set()`` - called to setup linecard ->44 nested devlink relationship.45 46The nested devlink info is exposed to the userspace over object-specific47attributes of devlink netlink.48 49Interface documentation50-----------------------51 52The following pages describe various interfaces available through devlink in53general.54 55.. toctree::56 :maxdepth: 157 58 devlink-dpipe59 devlink-health60 devlink-info61 devlink-flash62 devlink-params63 devlink-port64 devlink-region65 devlink-resource66 devlink-reload67 devlink-selftests68 devlink-trap69 devlink-linecard70 devlink-eswitch-attr71 72Driver-specific documentation73-----------------------------74 75Each driver that implements ``devlink`` is expected to document what76parameters, info versions, and other features it supports.77 78.. toctree::79 :maxdepth: 180 81 bnxt82 etas_es58x83 hns384 i40e85 ionic86 ice87 mlx488 mlx589 mlxsw90 mv88e6xxx91 netdevsim92 nfp93 qed94 ti-cpsw-switch95 am65-nuss-cpsw-switch96 prestera97 iosm98 octeontx299 sfc100