devlink: Move devlink health test to health file
authorMoshe Shemesh <moshe@nvidia.com>
Tue, 14 Feb 2023 16:38:03 +0000 (18:38 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Feb 2023 03:15:44 +0000 (19:15 -0800)
Move devlink health report test callback from leftover.c to health.c. No
functional change in this patch.

Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/devlink/devl_internal.h
net/devlink/health.c
net/devlink/leftover.c

index ae7229742d6693995019e20a4cb288b54bff0ea2..211f7ea38d6a230a7c93319eafae67aef94d91dc 100644 (file)
@@ -282,3 +282,5 @@ int devlink_nl_cmd_health_reporter_dump_get_dumpit(struct sk_buff *skb,
                                                   struct netlink_callback *cb);
 int devlink_nl_cmd_health_reporter_dump_clear_doit(struct sk_buff *skb,
                                                   struct genl_info *info);
+int devlink_nl_cmd_health_reporter_test_doit(struct sk_buff *skb,
+                                            struct genl_info *info);
index 6991b9405f4ff2efc6e01b55cd32a2b6bfbba4f8..38ad890bb947bf802bf0ae9cb82446f15b220427 100644 (file)
@@ -1296,3 +1296,19 @@ int devlink_nl_cmd_health_reporter_dump_clear_doit(struct sk_buff *skb,
        mutex_unlock(&reporter->dump_lock);
        return 0;
 }
+
+int devlink_nl_cmd_health_reporter_test_doit(struct sk_buff *skb,
+                                            struct genl_info *info)
+{
+       struct devlink *devlink = info->user_ptr[0];
+       struct devlink_health_reporter *reporter;
+
+       reporter = devlink_health_reporter_get_from_info(devlink, info);
+       if (!reporter)
+               return -EINVAL;
+
+       if (!reporter->ops->test)
+               return -EOPNOTSUPP;
+
+       return reporter->ops->test(reporter, info->extack);
+}
index 55be664d14ad30969d778c075da624eddd79536b..dffca2f9bfa7ff0a6982ba33b577e1e3f3d6c727 100644 (file)
@@ -5372,22 +5372,6 @@ out_unlock:
        return err;
 }
 
-static int devlink_nl_cmd_health_reporter_test_doit(struct sk_buff *skb,
-                                                   struct genl_info *info)
-{
-       struct devlink *devlink = info->user_ptr[0];
-       struct devlink_health_reporter *reporter;
-
-       reporter = devlink_health_reporter_get_from_info(devlink, info);
-       if (!reporter)
-               return -EINVAL;
-
-       if (!reporter->ops->test)
-               return -EOPNOTSUPP;
-
-       return reporter->ops->test(reporter, info->extack);
-}
-
 struct devlink_stats {
        u64_stats_t rx_bytes;
        u64_stats_t rx_packets;