OSDN Git Service

devlink: add by-instance dump infra
authorJakub Kicinski <kuba@kernel.org>
Thu, 5 Jan 2023 04:05:30 +0000 (20:05 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 6 Jan 2023 06:13:39 +0000 (22:13 -0800)
commit07f3af66089e20fe439b219d3c9d3e68d964193f
tree4da8ef518b5f8f54ae106536e7c58996f0ba7502
parente4d5015bc11bcc5123ec8805d8c7f1e28a77a8a9
devlink: add by-instance dump infra

Most dumpit implementations walk the devlink instances.
This requires careful lock taking and reference dropping.
Factor the loop out and provide just a callback to handle
a single instance dump.

Convert one user as an example, other users converted
in the next change.

Slightly inspired by ethtool netlink code.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/devlink/devl_internal.h
net/devlink/leftover.c
net/devlink/netlink.c