From: Moshe Shemesh Date: Tue, 14 Feb 2023 16:38:03 +0000 (+0200) Subject: devlink: Move devlink health test to health file X-Git-Tag: v6.6.7~3490^2~56^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9311ee13f0ebd6d684793f88b91092672c21171;p=platform%2Fkernel%2Flinux-starfive.git devlink: Move devlink health test to health file Move devlink health report test callback from leftover.c to health.c. No functional change in this patch. Signed-off-by: Moshe Shemesh Reviewed-by: Jiri Pirko Reviewed-by: Jakub Kicinski Signed-off-by: Jakub Kicinski --- diff --git a/net/devlink/devl_internal.h b/net/devlink/devl_internal.h index ae72297..211f7ea3 100644 --- a/net/devlink/devl_internal.h +++ b/net/devlink/devl_internal.h @@ -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); diff --git a/net/devlink/health.c b/net/devlink/health.c index 6991b94..38ad890 100644 --- a/net/devlink/health.c +++ b/net/devlink/health.c @@ -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); +} diff --git a/net/devlink/leftover.c b/net/devlink/leftover.c index 55be664..dffca2f 100644 --- a/net/devlink/leftover.c +++ b/net/devlink/leftover.c @@ -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;