forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
[Mellanox] Add common sai.profile per asic and asic_detect.sh script #67
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
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
385d5d5
[Mellanox] Add common asic_detect script and use if in mlnx-fw-upgrad…
noaOrMlnx 6e9e603
Add per-asic sai.profile with relevant parameters and copy them to sy…
noaOrMlnx 3dd95c3
Fix CR comments: RC for asic_detect and right folder to nv bluefield
noaOrMlnx 508557f
Add mount to asic_detect in nv-bluefield syncd container
noaOrMlnx 8a53612
Update asic_detect.sh to fit ARM for nvidia-bluefield
noaOrMlnx 304ee46
Update nvidia-bluefield install.sh.j2 to copy asic_detect folder
noaOrMlnx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
device/mellanox/x86_64-nvidia_sn5640-r0/Mellanox-SN5640-C448O16/sai.profile
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_5640_448x100g_16x400g.xml | ||
| SAI_KEY_SPC5_LOSSY_SCHEDULING=1 | ||
| SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 |
1 change: 0 additions & 1 deletion
1
device/mellanox/x86_64-nvidia_sn5640-r0/Mellanox-SN5640-C512S2/sai.profile
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_5640_512x100g.xml | ||
| SAI_KEY_SPC5_LOSSY_SCHEDULING=1 | ||
| SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 |
2 changes: 0 additions & 2 deletions
2
device/mellanox/x86_64-nvidia_sn5640_simx-r0/ACS-SN5640/sai.profile
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,2 @@ | ||
| SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_5640.xml | ||
| SAI_KEY_SPC5_LOSSY_SCHEDULING=1 | ||
| SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 | ||
|
|
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES | ||
| # Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| SUCCESS_CODE=0 | ||
| RC=-1 | ||
|
|
||
| if [[ -f "/usr/bin/asic_detect/asic_type" ]]; then | ||
| cat /usr/bin/asic_detect/asic_type | ||
| exit $SUCCESS_CODE | ||
| fi | ||
|
|
||
| # make sure that DEVICE_DICT keys are the same as values in DEVICE_ORDER | ||
| declare -A DEVICE_DICT=( | ||
| ["cb84"]="spc1" | ||
| ["cf6c"]="spc2" | ||
| ["cf70"]="spc3" | ||
| ["cf80"]="spc4" | ||
| ["cf82"]="spc5" | ||
| ["a2dc"]="bf3" | ||
| ) | ||
| TYPE_UNKNOWN="unknown" | ||
| VENDOR_ID="15b3" | ||
| DEVICE_TYPE=$TYPE_UNKNOWN | ||
|
|
||
| # bf3 should be the last device in the list | ||
| DEVICE_ORDER=("cb84" "cf6c" "cf70" "cf80" "cf82" "a2dc") | ||
|
|
||
| lspci_output=$(lspci -n 2>/dev/null) | ||
| if [[ -n "$lspci_output" ]]; then | ||
| for key in "${DEVICE_ORDER[@]}"; do | ||
| if echo "$lspci_output" | grep "$VENDOR_ID:$key" &>/dev/null; then | ||
| DEVICE_TYPE="${DEVICE_DICT[$key]}" | ||
| RC=$SUCCESS_CODE | ||
| break | ||
| fi | ||
| done | ||
| if [[ -n "$DEVICE_TYPE" ]]; then | ||
| echo "$DEVICE_TYPE" | tee >( [[ "$DEVICE_TYPE" != "$TYPE_UNKNOWN" ]] && cat > /usr/bin/asic_detect/asic_type ) | ||
| fi | ||
| exit $RC | ||
| fi | ||
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
Empty file.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| SAI_MIRROR_SESSION_HW_ID_RESERVATION=7 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| SAI_MIRROR_SESSION_HW_ID_RESERVATION=7 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| SAI_MIRROR_SESSION_HW_ID_RESERVATION=7 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| SAI_MIRROR_SESSION_HW_ID_RESERVATION=7 | ||
| SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1 |
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
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
Empty file.
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if during the previous execution script saved "unknown" into the file we need to try to detect ASIC again. E.g.:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oleksandrivantsiv I already handled it on line 43 - I am not writing to asic_type unless it's different from "unknown".