Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"ACS-MSN2700-A1", "Mellanox-SN2700-A1", "Mellanox-SN2700-A1-C28D8", "Mellanox-SN2700-A1-D40C8S8", "Mellanox-SN2700-A1-D44C10", "Mellanox-SN2700-A1-D48C8" ],
"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" ],
"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",
"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-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"],
"spc4": [ "ACS-SN5600", "Mellanox-SN5600-O128", "Mellanox-SN5600-V256", "Mellanox-SN5600-C256S1", "ACS-SN5400", "Mellanox-SN5600-C224O8", "Mellanox-SN5610N-C256S2", "Mellanox-SN5610N-C224O8" ],
"spc5": ["ACS-SN5640", "Mellanox-SN5640-C512S2", "Mellanox-SN5640-C448O16" ]
"spc5": ["ACS-SN5640", "Mellanox-SN5640-C512S2", "Mellanox-SN5640-C448O16", "Mellanox-SN5640-C512X2", "Mellanox-SN5640-C508O1X2", "Mellanox-SN5640-O128X2" ]
},
"broadcom_asics": {
"th": [ "Force10-S6100", "Arista-7060CX-32S-C32", "Arista-7060CX-32S-C32-T1", "Arista-7060CX-32S-D48C8", "Celestica-DX010-C32", "Seastone-DX010" ],
Expand Down
10 changes: 10 additions & 0 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,16 @@ collect_mellanox() {

save_cmd "show interfaces autoneg status" "autoneg.status"

save_cmd "/usr/local/bin/generate_ssd_dump" "ssd.dump"
# generate_ssd_dump saved the output of vtFA_RTK_5766_v2 if exists in $ssd_dump_generated_files
ssd_dump_generated_files=/tmp/ssd_dump_generated_files
if [ -d $ssd_dump_generated_files ]; then
for file in $(find_files "$ssd_dump_generated_files"); do
save_file ${file} dump false
done
rm -rf ${ssd_dump_generated_files}
fi

wait
}

Expand Down
101 changes: 101 additions & 0 deletions scripts/generate_ssd_dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/usr/bin/env bash
#
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
#
# This software product is a proprietary product of Nvidia Corporation and its affiliates
# (the "Company") and all right, title, and interest in and to the software
# product, including all associated intellectual property rights, are and
# shall remain exclusively with the Company.
#
# This software product is governed by the End User License Agreement
# provided with the software product.
#

# Usage: ./nvme_checks.sh [<ns_dev> [<ctrl_dev>]]
# Defaults: /dev/nvme0n1 (namespace), /dev/nvme0 (controller)
# Override timeout/grace via env: TIMEOUT=10s KILL_DELAY=2s ./nvme_checks.sh

NS_DEV=${1:-/dev/nvme0n1}
CTRL_DEV=${2:-/dev/nvme0}
TIMEOUT=${TIMEOUT:-5s}
KILL_DELAY=${KILL_DELAY:-1s}

run_nvme_cmd() {
subcmd=$1
dev=$2
echo -e "\n\nRunning nvme $subcmd $dev (timeout $TIMEOUT)\n\n"
if timeout -k "$KILL_DELAY" "$TIMEOUT" nvme "$subcmd" "$dev"; then
echo "nvme $subcmd succeeded for $dev."
else
rc=$?
if [[ $rc -eq 124 ]]; then
echo "nvme $subcmd timed out after $TIMEOUT and was terminated."
else
echo "nvme $subcmd failed for $dev (exit code $rc)."
fi
fi
}

echo -e "Running nvme list --output=json \n\n"
nvme_list_output=$(timeout ${TIMEOUT} nvme list --output=json)
echo ${nvme_list_output}

# Namespace-level commands (require block device like /dev/nvme0n1)
if [[ -b "$NS_DEV" ]]; then
for subcmd in smart-log error-log fw-log; do
run_nvme_cmd "$subcmd" "$NS_DEV"
done
else
echo "Namespace device $NS_DEV not found (skipping smart-log/error-log/fw-log)."
fi

# Controller-level command (requires controller device like /dev/nvme0, usually a char device)
if [[ -c "$CTRL_DEV" || -b "$CTRL_DEV" ]]; then
run_nvme_cmd "id-ctrl" "$CTRL_DEV"
else
echo "Controller device $CTRL_DEV not found (skipping id-ctrl)."
fi

if ! printf '%s' "$nvme_list_output" | jq -e . >/dev/null 2>&1; then
echo "nvme list output is empty or invalid JSON"
elif printf '%s' "$nvme_list_output" | jq -e '.Devices[] | select(.ModelNumber=="Virtium VTPM24CEXI080-BM110006")' >/dev/null; then
echo "Found NVMe with ModelNumber VTPM24CEXI080-BM110006"
echo -e "\n\nRunning /usr/local/bin/vtFA_RTK_5766_v2 ${CTRL_DEV}\n\n"
#Create tmp directory to run vtFA_RTK_5766_v2, then get the output from that directory
ssd_dump_generated_files=/tmp/ssd_dump_generated_files
rm -rf ${ssd_dump_generated_files}
mkdir -p ${ssd_dump_generated_files}
cd ${ssd_dump_generated_files}
# Try to run vtFA_RTK_5766_v2 with retry
RETRIES="2"
DELAY="2"
attempt=1
rc=1
while [ "$attempt" -le "$RETRIES" ]; do
echo "Attempt $attempt/$RETRIES: vtFA_RTK_5766_v2 $CTRL_DEV (timeout $TIMEOUT)"
if timeout -k "$KILL_DELAY" "$TIMEOUT" /usr/local/bin/vtFA_RTK_5766_v2 "$CTRL_DEV"; then
echo "vtFA_RTK_5766_v2 succeeded for $CTRL_DEV."
rc=0
break
else
rc=$?
if [ "$rc" -eq 124 ]; then
echo "vtFA_RTK_5766_v2 timed out after $TIMEOUT and was terminated."
else
echo "vtFA_RTK_5766_v2 failed (exit code $rc)."
fi
if [ "$attempt" -lt "$RETRIES" ]; then
echo "Retrying in $DELAY seconds..."
sleep "$DELAY"
fi
fi
attempt=$((attempt + 1))
done
if [ "$rc" -ne 0 ]; then
echo "Failed to run vtFA_RTK_5766_v2 after $RETRIES attempts."
fi
cd - >/dev/null
# generate_dump script will collect files from ${ssd_dump_generated_files} and then remove the folder
else
echo "Skiping vtFA_RTK_5766_v2"
fi
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
'watchdogutil',
'sonic_cli_gen',
],
data_files=[
("bin", ["ssd-dump/vtFA_RTK_5766_v2"]),
],
package_data={
'generic_config_updater': ['gcu_services_validator.conf.json', 'gcu_field_operation_validators.conf.json'],
'show': ['aliases.ini'],
Expand Down Expand Up @@ -139,6 +142,7 @@
'scripts/flow_counters_stat',
'scripts/gearboxutil',
'scripts/generate_dump',
'scripts/generate_ssd_dump',
'scripts/generate_shutdown_order.py',
'scripts/intfutil',
'scripts/intfstat',
Expand Down
Binary file added ssd-dump/vtFA_RTK_5766_v2
Binary file not shown.
Loading