]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
selftests: mlxsw: Check line card info on activated line card
authorJiri Pirko <jiri@nvidia.com>
Mon, 25 Jul 2022 08:29:25 +0000 (10:29 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 26 Jul 2022 20:56:44 +0000 (13:56 -0700)
Once line card is activated, check the FW version and PSID are exposed.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/mlxsw/devlink_linecard.sh

index ca4e9b08a105b206968d33b853e294a8fde8a45f..224ca3695c89d6c3905985ae636ef73402ed25fd 100755 (executable)
@@ -250,12 +250,32 @@ interface_check()
        setup_wait
 }
 
+lc_dev_info_active_check()
+{
+       local lc=$1
+       local nested_devlink_dev=$2
+       local fixed_device_fw_psid
+       local running_device_fw
+
+       fixed_device_fw_psid=$(devlink dev info $nested_devlink_dev -j | \
+                              jq -e -r ".[][].versions.fixed" | \
+                              jq -e -r '."fw.psid"')
+       check_err $? "Failed to get linecard $lc fixed fw PSID"
+       log_info "Linecard $lc fixed.fw.psid: \"$fixed_device_fw_psid\""
+
+       running_device_fw=$(devlink dev info $nested_devlink_dev -j | \
+                           jq -e -r ".[][].versions.running.fw")
+       check_err $? "Failed to get linecard $lc running.fw.version"
+       log_info "Linecard $lc running.fw: \"$running_device_fw\""
+}
+
 activation_16x100G_test()
 {
        RET=0
        local lc
        local type
        local state
+       local nested_devlink_dev
 
        lc=$LC_SLOT
        type=$LC_16X100G_TYPE
@@ -268,6 +288,10 @@ activation_16x100G_test()
 
        interface_check
 
+       nested_devlink_dev=$(lc_nested_devlink_dev_get $lc)
+       check_err $? "Failed to get nested devlink handle of linecard $lc"
+       lc_dev_info_active_check $lc $nested_devlink_dev
+
        log_test "Activation 16x100G"
 }