netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, idosch@nvidia.com,
	petrm@nvidia.com, pabeni@redhat.com, edumazet@google.com,
	mlxsw@nvidia.com
Subject: [patch net-next 10/11] selftests: mlxsw: Check line card info on provisioned line card
Date: Tue, 14 Jun 2022 14:33:25 +0200	[thread overview]
Message-ID: <20220614123326.69745-11-jiri@resnulli.us> (raw)
In-Reply-To: <20220614123326.69745-1-jiri@resnulli.us>

From: Jiri Pirko <jiri@nvidia.com>

Once line card is provisioned, check if HW revision and INI version
are exposed on associated nested auxiliary device.

Signed-off-by: Jiri Pirko <jiri@nvidia.com>
---
 .../drivers/net/mlxsw/devlink_linecard.sh     | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/tools/testing/selftests/drivers/net/mlxsw/devlink_linecard.sh b/tools/testing/selftests/drivers/net/mlxsw/devlink_linecard.sh
index 08a922d8b86a..ca4e9b08a105 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/devlink_linecard.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/devlink_linecard.sh
@@ -84,6 +84,13 @@ lc_wait_until_port_count_is()
 	busywait "$timeout" until_lc_port_count_is "$port_count" lc_port_count_get "$lc"
 }
 
+lc_nested_devlink_dev_get()
+{
+	local lc=$1
+
+	devlink lc show $DEVLINK_DEV lc $lc -j | jq -e -r ".[][][].nested_devlink"
+}
+
 PROV_UNPROV_TIMEOUT=8000 # ms
 POST_PROV_ACT_TIMEOUT=2000 # ms
 PROV_PORTS_INSTANTIATION_TIMEOUT=15000 # ms
@@ -191,12 +198,30 @@ ports_check()
 	check_err $? "Unexpected port count linecard $lc (got $port_count, expected $expected_port_count)"
 }
 
+lc_dev_info_provisioned_check()
+{
+	local lc=$1
+	local nested_devlink_dev=$2
+	local fixed_hw_revision
+	local running_ini_version
+
+	fixed_hw_revision=$(devlink dev info $nested_devlink_dev -j | \
+			    jq -e -r '.[][].versions.fixed."hw.revision"')
+	check_err $? "Failed to get linecard $lc fixed.hw.revision"
+	log_info "Linecard $lc fixed.hw.revision: \"$fixed_hw_revision\""
+	running_ini_version=$(devlink dev info $nested_devlink_dev -j | \
+			      jq -e -r '.[][].versions.running."ini.version"')
+	check_err $? "Failed to get linecard $lc running.ini.version"
+	log_info "Linecard $lc running.ini.version: \"$running_ini_version\""
+}
+
 provision_test()
 {
 	RET=0
 	local lc
 	local type
 	local state
+	local nested_devlink_dev
 
 	lc=$LC_SLOT
 	supported_types_check $lc
@@ -207,6 +232,11 @@ provision_test()
 	fi
 	provision_one $lc $LC_16X100G_TYPE
 	ports_check $lc $LC_16X100G_PORT_COUNT
+
+	nested_devlink_dev=$(lc_nested_devlink_dev_get $lc)
+	check_err $? "Failed to get nested devlink handle of linecard $lc"
+	lc_dev_info_provisioned_check $lc $nested_devlink_dev
+
 	log_test "Provision"
 }
 
-- 
2.35.3


  parent reply	other threads:[~2022-06-14 12:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-14 12:33 [patch net-next 00/11] mlxsw: Implement dev info and dev flash for line cards Jiri Pirko
2022-06-14 12:33 ` [patch net-next 01/11] devlink: introduce nested devlink entity for line card Jiri Pirko
2022-06-15 14:05   ` Ido Schimmel
2022-06-15 17:37     ` Jiri Pirko
2022-06-15 23:37   ` Jakub Kicinski
2022-06-14 12:33 ` [patch net-next 02/11] mlxsw: core_linecards: Introduce per line card auxiliary device Jiri Pirko
2022-06-15 14:52   ` Ido Schimmel
2022-06-15 17:37     ` Jiri Pirko
2022-06-16  7:11       ` Ido Schimmel
2022-06-16 16:39         ` Jiri Pirko
2022-06-16 17:41           ` Ido Schimmel
2022-06-27  8:34             ` Jiri Pirko
2022-06-14 12:33 ` [patch net-next 03/11] mlxsw: core_linecard_dev: Set nested devlink relationship for a line card Jiri Pirko
2022-06-14 12:33 ` [patch net-next 04/11] mlxsw: core_linecards: Expose HW revision and INI version Jiri Pirko
2022-06-14 12:33 ` [patch net-next 05/11] mlxsw: reg: Extend MDDQ by device_info Jiri Pirko
2022-06-14 12:33 ` [patch net-next 06/11] mlxsw: core_linecards: Probe provisioned line cards for devices and expose FW version Jiri Pirko
2022-06-14 12:33 ` [patch net-next 07/11] mlxsw: reg: Add Management DownStream Device Tunneling Register Jiri Pirko
2022-06-14 12:33 ` [patch net-next 08/11] mlxsw: core_linecards: Expose device PSID over device info Jiri Pirko
2022-06-14 12:33 ` [patch net-next 09/11] mlxsw: core_linecards: Implement line card device flashing Jiri Pirko
2022-06-14 12:33 ` Jiri Pirko [this message]
2022-06-14 12:33 ` [patch net-next 11/11] selftests: mlxsw: Check line card info on activated line card Jiri Pirko
2022-06-15  9:13 ` [patch net-next 00/11] mlxsw: Implement dev info and dev flash for line cards Ido Schimmel
2022-06-15 17:40   ` Jiri Pirko
2022-06-16  7:03     ` Ido Schimmel
2022-06-16 13:11       ` Jiri Pirko
2022-06-16 14:47         ` Ido Schimmel
2022-06-16 16:37           ` Jiri Pirko
2022-06-18  6:12     ` Shannon Nelson
2022-06-27  8:43       ` Jiri Pirko
2022-06-27 18:38         ` Shannon Nelson
2022-06-27 18:52           ` Jakub Kicinski
2022-06-28  7:06             ` Jiri Pirko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220614123326.69745-11-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).