summaryrefslogtreecommitdiffstats
path: root/net/devlink
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-01-05 05:05:25 +0100
committerJakub Kicinski <kuba@kernel.org>2023-01-06 07:13:39 +0100
commita0e13dfdc391dfb2a9b165e2475fb1796c9be98d (patch)
treece367b7b5eb9447f59e80b612303949418785a0e /net/devlink
parentdevlink: drop the filter argument from devlinks_xa_find_get (diff)
downloadlinux-a0e13dfdc391dfb2a9b165e2475fb1796c9be98d.tar.xz
linux-a0e13dfdc391dfb2a9b165e2475fb1796c9be98d.zip
devlink: health: combine loops in dump
Walk devlink instances only once. Dump the instance reporters and port reporters before moving to the next instance. User space should not depend on ordering of messages. This will make improving stability of the walk easier. Reviewed-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/devlink')
-rw-r--r--net/devlink/leftover.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/net/devlink/leftover.c b/net/devlink/leftover.c
index d88461b33ddf..83cd7bd55941 100644
--- a/net/devlink/leftover.c
+++ b/net/devlink/leftover.c
@@ -7940,10 +7940,7 @@ devlink_nl_cmd_health_reporter_get_dumpit(struct sk_buff *msg,
idx++;
}
mutex_unlock(&devlink->reporters_lock);
- devlink_put(devlink);
- }
- devlinks_xa_for_each_registered_get(sock_net(msg->sk), index, devlink) {
devl_lock(devlink);
xa_for_each(&devlink->ports, port_index, port) {
mutex_lock(&port->reporters_lock);