Skip to content

Commit b119749

Browse files
authored
Merge pull request #330 from mssonicbld/sonicbld/202512-merge
```<br>* f82c764 - (HEAD -> 202512) Merge branch '202511' of https://github.com/sonic-net/sonic-utilities into 202512 (2026-05-20) [Sonic Automation] * b3feb8a - (origin/202511) Added SPC5 and SN4280 SKUs (#4557) (2026-05-19) [sschlafman] * 7c26035 - [Mellanox] [generate_dump] Collect SSD dump (#4553) (2026-05-19) [mssonicbld]<br>```
2 parents 4674008 + f82c764 commit b119749

5 files changed

Lines changed: 117 additions & 2 deletions

File tree

generic_config_updater/gcu_field_operation_validators.conf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"ACS-MSN2700-A1", "Mellanox-SN2700-A1", "Mellanox-SN2700-A1-C28D8", "Mellanox-SN2700-A1-D40C8S8", "Mellanox-SN2700-A1-D44C10", "Mellanox-SN2700-A1-D48C8" ],
2222
"spc2": [ "ACS-MSN3800", "Mellanox-SN3800-D112C8", "ACS-MSN3420", "ACS-MSN3700C", "ACS-MSN3700", "Mellanox-SN3800-C64", "Mellanox-SN3800-D100C12S2", "Mellanox-SN3800-D24C52", "Mellanox-SN3800-D28C49S1", "Mellanox-SN3800-D28C50" ],
2323
"spc3": [ "ACS-MSN4700", "ACS-MSN4600", "ACS-MSN4600C", "ACS-MSN4410", "ACS-SN4280", "Mellanox-SN4600C-D112C8", "Mellanox-SN4600C-C64", "Mellanox-SN4700-O8C48", "Mellanox-SN4600C-D100C12S2", "Mellanox-SN4600C-D48C40","Mellanox-SN4700-O32","Mellanox-SN4700-V64",
24-
"Mellanox-SN4700-A96C8V8", "Mellanox-SN4700-C128", "Mellanox-SN4700-O28", "Mellanox-SN4700-O8V48", "Mellanox-SN4700-V48C32", "Mellanox-SN4280-O28", "Mellanox-SN4280-O8C80", "Mellanox-SN4280-C48", "Mellanox-SN4280-O8C40", "Mellanox-SN4280-O8V40"],
24+
"Mellanox-SN4700-A96C8V8", "Mellanox-SN4700-C128", "Mellanox-SN4700-O28", "Mellanox-SN4700-O8V48", "Mellanox-SN4700-V48C32", "Mellanox-SN4280-O28", "Mellanox-SN4280-O8C80", "Mellanox-SN4280-C48", "Mellanox-SN4280-O8C40", "Mellanox-SN4280-O8V40", "Mellanox-SN4280-O4X96"],
2525
"spc4": [ "ACS-SN5600", "Mellanox-SN5600-O128", "Mellanox-SN5600-V256", "Mellanox-SN5600-C256S1", "ACS-SN5400", "Mellanox-SN5600-C224O8", "Mellanox-SN5610N-C256S2", "Mellanox-SN5610N-C224O8" ],
26-
"spc5": ["ACS-SN5640", "Mellanox-SN5640-C512S2", "Mellanox-SN5640-C448O16" ]
26+
"spc5": ["ACS-SN5640", "Mellanox-SN5640-C512S2", "Mellanox-SN5640-C448O16", "Mellanox-SN5640-C512X2", "Mellanox-SN5640-C508O1X2", "Mellanox-SN5640-O128X2" ]
2727
},
2828
"broadcom_asics": {
2929
"th": [ "Force10-S6100", "Arista-7060CX-32S-C32", "Arista-7060CX-32S-C32-T1", "Arista-7060CX-32S-D48C8", "Celestica-DX010-C32", "Seastone-DX010" ],

scripts/generate_dump

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,16 @@ collect_mellanox() {
15161516

15171517
save_cmd "show interfaces autoneg status" "autoneg.status"
15181518

1519+
save_cmd "/usr/local/bin/generate_ssd_dump" "ssd.dump"
1520+
# generate_ssd_dump saved the output of vtFA_RTK_5766_v2 if exists in $ssd_dump_generated_files
1521+
ssd_dump_generated_files=/tmp/ssd_dump_generated_files
1522+
if [ -d $ssd_dump_generated_files ]; then
1523+
for file in $(find_files "$ssd_dump_generated_files"); do
1524+
save_file ${file} dump false
1525+
done
1526+
rm -rf ${ssd_dump_generated_files}
1527+
fi
1528+
15191529
wait
15201530
}
15211531

scripts/generate_ssd_dump

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
4+
#
5+
# This software product is a proprietary product of Nvidia Corporation and its affiliates
6+
# (the "Company") and all right, title, and interest in and to the software
7+
# product, including all associated intellectual property rights, are and
8+
# shall remain exclusively with the Company.
9+
#
10+
# This software product is governed by the End User License Agreement
11+
# provided with the software product.
12+
#
13+
14+
# Usage: ./nvme_checks.sh [<ns_dev> [<ctrl_dev>]]
15+
# Defaults: /dev/nvme0n1 (namespace), /dev/nvme0 (controller)
16+
# Override timeout/grace via env: TIMEOUT=10s KILL_DELAY=2s ./nvme_checks.sh
17+
18+
NS_DEV=${1:-/dev/nvme0n1}
19+
CTRL_DEV=${2:-/dev/nvme0}
20+
TIMEOUT=${TIMEOUT:-5s}
21+
KILL_DELAY=${KILL_DELAY:-1s}
22+
23+
run_nvme_cmd() {
24+
subcmd=$1
25+
dev=$2
26+
echo -e "\n\nRunning nvme $subcmd $dev (timeout $TIMEOUT)\n\n"
27+
if timeout -k "$KILL_DELAY" "$TIMEOUT" nvme "$subcmd" "$dev"; then
28+
echo "nvme $subcmd succeeded for $dev."
29+
else
30+
rc=$?
31+
if [[ $rc -eq 124 ]]; then
32+
echo "nvme $subcmd timed out after $TIMEOUT and was terminated."
33+
else
34+
echo "nvme $subcmd failed for $dev (exit code $rc)."
35+
fi
36+
fi
37+
}
38+
39+
echo -e "Running nvme list --output=json \n\n"
40+
nvme_list_output=$(timeout ${TIMEOUT} nvme list --output=json)
41+
echo ${nvme_list_output}
42+
43+
# Namespace-level commands (require block device like /dev/nvme0n1)
44+
if [[ -b "$NS_DEV" ]]; then
45+
for subcmd in smart-log error-log fw-log; do
46+
run_nvme_cmd "$subcmd" "$NS_DEV"
47+
done
48+
else
49+
echo "Namespace device $NS_DEV not found (skipping smart-log/error-log/fw-log)."
50+
fi
51+
52+
# Controller-level command (requires controller device like /dev/nvme0, usually a char device)
53+
if [[ -c "$CTRL_DEV" || -b "$CTRL_DEV" ]]; then
54+
run_nvme_cmd "id-ctrl" "$CTRL_DEV"
55+
else
56+
echo "Controller device $CTRL_DEV not found (skipping id-ctrl)."
57+
fi
58+
59+
if ! printf '%s' "$nvme_list_output" | jq -e . >/dev/null 2>&1; then
60+
echo "nvme list output is empty or invalid JSON"
61+
elif printf '%s' "$nvme_list_output" | jq -e '.Devices[] | select(.ModelNumber=="Virtium VTPM24CEXI080-BM110006")' >/dev/null; then
62+
echo "Found NVMe with ModelNumber VTPM24CEXI080-BM110006"
63+
echo -e "\n\nRunning /usr/local/bin/vtFA_RTK_5766_v2 ${CTRL_DEV}\n\n"
64+
#Create tmp directory to run vtFA_RTK_5766_v2, then get the output from that directory
65+
ssd_dump_generated_files=/tmp/ssd_dump_generated_files
66+
rm -rf ${ssd_dump_generated_files}
67+
mkdir -p ${ssd_dump_generated_files}
68+
cd ${ssd_dump_generated_files}
69+
# Try to run vtFA_RTK_5766_v2 with retry
70+
RETRIES="2"
71+
DELAY="2"
72+
attempt=1
73+
rc=1
74+
while [ "$attempt" -le "$RETRIES" ]; do
75+
echo "Attempt $attempt/$RETRIES: vtFA_RTK_5766_v2 $CTRL_DEV (timeout $TIMEOUT)"
76+
if timeout -k "$KILL_DELAY" "$TIMEOUT" /usr/local/bin/vtFA_RTK_5766_v2 "$CTRL_DEV"; then
77+
echo "vtFA_RTK_5766_v2 succeeded for $CTRL_DEV."
78+
rc=0
79+
break
80+
else
81+
rc=$?
82+
if [ "$rc" -eq 124 ]; then
83+
echo "vtFA_RTK_5766_v2 timed out after $TIMEOUT and was terminated."
84+
else
85+
echo "vtFA_RTK_5766_v2 failed (exit code $rc)."
86+
fi
87+
if [ "$attempt" -lt "$RETRIES" ]; then
88+
echo "Retrying in $DELAY seconds..."
89+
sleep "$DELAY"
90+
fi
91+
fi
92+
attempt=$((attempt + 1))
93+
done
94+
if [ "$rc" -ne 0 ]; then
95+
echo "Failed to run vtFA_RTK_5766_v2 after $RETRIES attempts."
96+
fi
97+
cd - >/dev/null
98+
# generate_dump script will collect files from ${ssd_dump_generated_files} and then remove the folder
99+
else
100+
echo "Skiping vtFA_RTK_5766_v2"
101+
fi

setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@
8989
'watchdogutil',
9090
'sonic_cli_gen',
9191
],
92+
data_files=[
93+
("bin", ["ssd-dump/vtFA_RTK_5766_v2"]),
94+
],
9295
package_data={
9396
'generic_config_updater': ['gcu_services_validator.conf.json', 'gcu_field_operation_validators.conf.json'],
9497
'show': ['aliases.ini'],
@@ -139,6 +142,7 @@
139142
'scripts/flow_counters_stat',
140143
'scripts/gearboxutil',
141144
'scripts/generate_dump',
145+
'scripts/generate_ssd_dump',
142146
'scripts/generate_shutdown_order.py',
143147
'scripts/intfutil',
144148
'scripts/intfstat',

ssd-dump/vtFA_RTK_5766_v2

17.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)