summaryrefslogtreecommitdiff
path: root/net/devlink/health.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/devlink/health.c')
-rw-r--r--net/devlink/health.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/net/devlink/health.c b/net/devlink/health.c
index 6991b9405f4f..38ad890bb947 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);
+}