You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Mellanox] Fix retry logic on discovery of MST device (sonic-net#20389)
- Why I did it
Fixing retry logic when MST device is discovered. The current implementation only fetches the name of the device but doesn't verify if the device is accessible which can be confirmed by querying the device and ensuring the command passes.
- How I did it
Added a query command with device as parameter and ensured it passes.
- How to verify it
Running upgrade tests.
Copy file name to clipboardexpand all lines: platform/mellanox/mlnx-fw-upgrade.j2
+25-6
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,7 @@ function PrintHelp() {
77
77
echo " -s, --syslog Use syslog logger (enabled when -u|--upgrade)"
78
78
echo " -v, --verbose Verbose mode (enabled when -u|--upgrade)"
79
79
echo " -d, --dry-run Compare the FW versions without installation. Return code "0" means the FW is up-to-date, return code "10" means an upgrade is required, otherwise an error is detected."
80
+
echo " -c, --clear-semaphore Clear hw resources before updating firmware"
80
81
echo " -h, --help Print help"
81
82
echo
82
83
echo "Examples:"
@@ -103,6 +104,9 @@ function ParseArguments() {
103
104
-d|--dry-run)
104
105
DRY_RUN="${YES_PARAM}"
105
106
;;
107
+
-c|--clear-semaphore)
108
+
CLEAR_SEMAPHORE="${YES_PARAM}"
109
+
;;
106
110
-h|--help)
107
111
PrintHelp
108
112
exit "${EXIT_SUCCESS}"
@@ -210,16 +214,20 @@ function WaitForDevice() {
210
214
local -i QUERY_RETRY_COUNT_MAX="10"
211
215
local -i QUERY_RETRY_COUNT="0"
212
216
local -r DEVICE_TYPE=$(GetMstDeviceType)
217
+
local SPC_MST_DEV
218
+
local QUERY_RC=""
213
219
214
-
local SPC_MST_DEV=$(GetSPCMstDevice)
215
-
216
-
while [[ ("${QUERY_RETRY_COUNT}" -lt "${QUERY_RETRY_COUNT_MAX}") && ("${SPC_MST_DEV}" == "${UNKN_MST}") ]]; do
0 commit comments