Skip to content

Support multiple pcie configuration file and change the pcie status table name #7886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2021
Merged
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
7 changes: 4 additions & 3 deletions files/image_config/pcie-check/pcie-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ VERBOSE="no"
RESULTS="PCIe Device Checking All Test"
EXPECTED="PCIe Device Checking All Test ----------->>> PASSED"
MAX_WAIT_SECONDS=15
PCIE_STATUS_TABLE="PCIE_DEVICES|status"

function debug()
{
Expand All @@ -19,7 +20,7 @@ function check_and_rescan_pcie_devices()
PCIE_CHK_CMD='sudo pcieutil check | grep "$RESULTS"'
PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform)

if [ ! -f /usr/share/sonic/device/$PLATFORM/pcie.yaml ]; then
if [ ! -f /usr/share/sonic/device/$PLATFORM/pcie*.yaml ]; then
debug "pcie.yaml does not exist! Can't check PCIe status!"
exit
fi
Expand All @@ -37,7 +38,7 @@ function check_and_rescan_pcie_devices()
fi

if [ "$(eval $PCIE_CHK_CMD)" = "$EXPECTED" ]; then
redis-cli -n 6 HSET "PCIE_DEVICES" "status" "PASSED"
redis-cli -n 6 HSET $PCIE_STATUS_TABLE "status" "PASSED"
debug "PCIe check passed"
exit
else
Expand All @@ -53,7 +54,7 @@ function check_and_rescan_pcie_devices()

done
debug "PCIe check failed"
redis-cli -n 6 HSET "PCIE_DEVICES" "status" "FAILED"
redis-cli -n 6 HSET $PCIE_STATUS_TABLE "status" "FAILED"
}

check_and_rescan_pcie_devices