[Mellanox] Update syncd_init_common.sh to include SAI parameters from per-asic sai profile#5
Closed
[Mellanox] Update syncd_init_common.sh to include SAI parameters from per-asic sai profile#5
Conversation
9 tasks
1a0a5ad to
c476fce
Compare
dprital
approved these changes
Jul 2, 2025
DavidZagury
reviewed
Jul 2, 2025
DavidZagury
reviewed
Jul 2, 2025
… per-asic sai profile
c476fce to
f84f328
Compare
syncd/scripts/syncd_init_common.sh
Outdated
|
|
||
| echo >> /tmp/sai-temp.profile | ||
|
|
||
| DEVICE_TYPE="$(mlxfwmanager | awk -F'Device Type: *' '/Device Type/ {print $2}')" |
There was a problem hiding this comment.
mlxfwmanager is too heavy to use for getting the SPC version. Please use the same approach as we have in the mlnx-fw-update.sh script with the PCI device ID:
function GetAsicType() {
local -r VENDOR_ID="15b3"
local -r SPC1_PRODUCT_ID="cb84"
local -r SPC2_PRODUCT_ID="cf6c"
local -r SPC3_PRODUCT_ID="cf70"
local -r SPC4_PRODUCT_ID="cf80"
local -r SPC5_PRODUCT_ID="cf82"
local -r BF3_PRODUCT_ID="a2dc"
local -i QUERY_RETRY_COUNT="0"
local -i QUERY_RETRY_COUNT_MAX="10"
local pcitree=$(lspci -n 2>/dev/null)
ERROR_CODE="$?"
while [[ ("${QUERY_RETRY_COUNT}" -lt "QUERY_RETRY_COUNT_MAX") && ("${ERROR_CODE}" != "${EXIT_SUCCESS}") ]]; do
sleep 1s
((QUERY_RETRY_COUNT++))
pcitree=$(lspci -n 2>/dev/null)
ERROR_CODE="$?"
done
if echo $pcitree | grep "${VENDOR_ID}:${SPC1_PRODUCT_ID}" &>/dev/null; then
echo "${SPC1_ASIC}"
exit "${EXIT_SUCCESS}"
elif echo $pcitree | grep "${VENDOR_ID}:${SPC2_PRODUCT_ID}" &>/dev/null; then
echo "${SPC2_ASIC}"
exit "${EXIT_SUCCESS}"
elif echo $pcitree | grep "${VENDOR_ID}:${SPC3_PRODUCT_ID}" &>/dev/null; then
echo "${SPC3_ASIC}"
exit "${EXIT_SUCCESS}"
elif echo $pcitree | grep "${VENDOR_ID}:${SPC4_PRODUCT_ID}" &>/dev/null; then
echo "${SPC4_ASIC}"
exit "${EXIT_SUCCESS}"
elif echo $pcitree | grep "${VENDOR_ID}:${SPC5_PRODUCT_ID}" &>/dev/null; then
echo "${SPC5_ASIC}"
exit "${EXIT_SUCCESS}"
elif echo $pcitree | grep "${VENDOR_ID}:${BF3_PRODUCT_ID}" &>/dev/null; then
echo "${BF3_NIC}"
exit "${EXIT_SUCCESS}"
fi
echo "${UNKN_ASIC}"
exit "${EXIT_FAILURE}"
}
Owner
Author
There was a problem hiding this comment.
@oleksandrivantsiv Done. please check.
Also, please review the related PR noaOrMlnx/sonic-buildimage#66
9 tasks
oleksandrivantsiv
approved these changes
Jul 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed config_mlnx_syncd() functionality to use per-asic sai.profile for all Spectrum{x} SKUs.
The function will apply specific SKU sai.profile, then per-asic sai.profile and lastly - sai-common.profile (which is for all Mellanox SKUs).
Why I did it
To have the ability to add common parameters to only 1 file instead of all SKUs - but per asic.
depends on noaOrMlnx/sonic-buildimage#66 that installs pciutils to Mellanox syncd docker - so we could execute lspci command inside syncd docker.