]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
devlink: Add health reporter test command support
authorJiri Pirko <jiri@nvidia.com>
Thu, 1 Oct 2020 07:21:13 +0000 (09:21 +0200)
committerDavid Ahern <dsahern@gmail.com>
Wed, 7 Oct 2020 06:08:53 +0000 (00:08 -0600)
Add health reporter test command and allow user to trigger a test event.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
bash-completion/devlink
devlink/devlink.c
man/man8/devlink-health.8

index f710c888652e81983f625468f40ea73ed47c47aa..7395b50402324725f3517fd63153d32881139fdc 100644 (file)
@@ -635,7 +635,7 @@ _devlink_health_reporter()
 _devlink_health()
 {
     case $command in
-        show|recover|diagnose|set)
+        show|recover|diagnose|set|test)
             _devlink_health_reporter 0
             if [[ $command == "set" ]]; then
                 case $cword in
index 5cf2cd194788c955934b2d372e6ac4341775bd80..ab9522d260fdc5fffcea7284f3f268fa0154146c 100644 (file)
@@ -7099,6 +7099,13 @@ static int cmd_health_diagnose(struct dl *dl)
                                        0);
 }
 
+static int cmd_health_test(struct dl *dl)
+{
+       return cmd_health_object_common(dl,
+                                       DEVLINK_CMD_HEALTH_REPORTER_TEST,
+                                       0);
+}
+
 static int cmd_health_recover(struct dl *dl)
 {
        struct nlmsghdr *nlh;
@@ -7303,6 +7310,7 @@ static void cmd_health_help(void)
        pr_err("Usage: devlink health show [ { DEV | DEV/PORT_INDEX } reporter REPORTER_NAME ]\n");
        pr_err("       devlink health recover { DEV | DEV/PORT_INDEX } reporter REPORTER_NAME\n");
        pr_err("       devlink health diagnose { DEV | DEV/PORT_INDEX } reporter REPORTER_NAME\n");
+       pr_err("       devlink health test { DEV | DEV/PORT_INDEX } reporter REPORTER_NAME\n");
        pr_err("       devlink health dump show { DEV | DEV/PORT_INDEX } reporter REPORTER_NAME\n");
        pr_err("       devlink health dump clear { DEV | DEV/PORT_INDEX } reporter REPORTER_NAME\n");
        pr_err("       devlink health set { DEV | DEV/PORT_INDEX } reporter REPORTER_NAME\n");
@@ -7326,6 +7334,9 @@ static int cmd_health(struct dl *dl)
        } else if (dl_argv_match(dl, "diagnose")) {
                dl_arg_inc(dl);
                return cmd_health_diagnose(dl);
+       } else if (dl_argv_match(dl, "test")) {
+               dl_arg_inc(dl);
+               return cmd_health_test(dl);
        } else if (dl_argv_match(dl, "dump")) {
                dl_arg_inc(dl);
                if (dl_argv_match(dl, "show")) {
index 47b96135ef01c583128dd401649bba714e32bd36..975b8c75d79818dbcb977218ab304547fd044b13 100644 (file)
@@ -41,6 +41,12 @@ devlink-health \- devlink health reporting and recovery
 .B  reporter
 .RI "" REPORTER ""
 
+.ti -8
+.BR "devlink health test"
+.RI "{ " DEV " | " DEV/PORT_INDEX " }"
+.B reporter
+.RI "" REPORTER ""
+
 .ti -8
 .B devlink health dump clear
 .RI "{ " DEV " | " DEV/PORT_INDEX " }"
@@ -105,6 +111,16 @@ This action performs a recovery and increases the recoveries counter on success.
 .I "REPORTER"
 - specifies the reporter's name registered on specified devlink device or port.
 
+.SS devlink health test - Trigger a test event on a reporter.
+
+.PP
+.I "DEV"
+- specifies the devlink device.
+
+.PP
+.I "REPORTER"
+- specifies the reporter's name registered on the devlink device.
+
 .SS devlink health dump show - Display the last saved dump.
 
 .PD 0