@@ -262,6 +262,25 @@ _devlink_dev_flash()
esac
}
+# Completion for devlink dev selftests
+_devlink_dev_selftests()
+{
+ case "$cword" in
+ 3)
+ COMPREPLY=( $( compgen -W "show run" -- "$cur" ) )
+ return
+ ;;
+ 4)
+ _devlink_direct_complete "dev"
+ return
+ ;;
+ 5)
+ COMPREPLY=( $( compgen -W "test" -- "$cur" ) )
+ return
+ ;;
+ esac
+}
+
# Completion for devlink dev
_devlink_dev()
{
@@ -274,7 +293,7 @@ _devlink_dev()
fi
return
;;
- eswitch|param)
+ eswitch|param|selftests)
_devlink_dev_$command
return
;;
@@ -85,6 +85,20 @@ devlink-dev \- devlink device configuration
.I ID
]
+.ti -8
+.B devlink dev selftests show
+[
+.I DEV
+]
+
+.ti -8
+.B devlink dev selftests run
+.I DEV
+[
+.B test
+.RI "{ " TESTNAME " }"
+]
+
.SH "DESCRIPTION"
.SS devlink dev show - display devlink device attributes
@@ -249,6 +263,29 @@ should match the component names from
.B "devlink dev info"
and may be driver-dependent.
+.SS devlink dev selftests show - shows supported selftests on devlink device.
+
+.PP
+.I "DEV"
+- specifies the devlink device.
+If this argument is omitted selftests for all devlink devices are listed.
+
+.SS devlink dev selftests run - runs selftests on devlink device.
+
+.PP
+.I "DEV"
+- specifies the devlink device to execute selftests.
+
+.B test
+{
+.RI { " TESTNAME " }
+}
+- The value of
+.I TESTNAME
+should match the test names from
+.B "devlink dev selftests show".
+to execute all the selftests on the devlink device.
+
.SH "EXAMPLES"
.PP
devlink dev show
@@ -296,6 +333,16 @@ Flashing 100%
.br
Flashing done
.RE
+.PP
+devlink dev selftests show pci/0000:01:00.0
+.RS 4
+Shows the supported selftests by the devlink device.
+.RE
+.PP
+devlink dev selftests run pci/0000:01:00.0 test flash
+.RS 4
+Perform a flash test on the devlink device.
+.RE
.SH SEE ALSO
.BR devlink (8),