aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/networking
diff options
context:
space:
mode:
authorJiri Pirko <jiri@nvidia.com>2023-10-13 14:10:27 +0200
committerDavid S. Miller <davem@davemloft.net>2023-10-18 09:23:01 +0100
commitb6f23b319aadae50a03b06c3067bc7e4a659e43b (patch)
treedb647128fa0f811da74aaf5bb5942a34837265db /Documentation/networking
parentb5f4e371336a62a48f6ae51abb8366e968a8f88f (diff)
downloadlinux-b6f23b319aadae50a03b06c3067bc7e4a659e43b.tar.gz
Documentation: devlink: add nested instance section
Add a part talking about nested devlink instances describing the helpers and locking ordering. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/networking')
-rw-r--r--Documentation/networking/devlink/index.rst24
1 files changed, 24 insertions, 0 deletions
diff --git a/Documentation/networking/devlink/index.rst b/Documentation/networking/devlink/index.rst
index b49749e2b9a638..52e52a1b603dfd 100644
--- a/Documentation/networking/devlink/index.rst
+++ b/Documentation/networking/devlink/index.rst
@@ -18,6 +18,30 @@ netlink commands.
Drivers are encouraged to use the devlink instance lock for their own needs.
+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.
+
Interface documentation
-----------------------