From a3895c31161d01dad4e3d68c27041bbc4292b77f Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Tue, 7 Jun 2022 20:05:54 +0800 Subject: [PATCH] [Mellanox] Update SN2201 sai profile and platform reboot script (#10978) - Why I did it 1. SN2201 sai profile needs to be updated according to the latest hardware. 2. In the reboot script, need to use the common symbol link of the power_cycle sysfs instead of directly accessing it due to SN2201 sysfs is different than other platforms. 3. echo 1 > $SYSFS_PWR_CYCLE will trigger the reboot immediately, the following sleep 3 and echo 0 > $SYSFS_PWR_CYCLE will never be executed, can be removed. - How I did it 1. Replace the SN2201 sai profile with the latest one. 2. In the platform_reboot script, replace the direct sysfs path with the symbol link path. 3. Remove the redundant code from platform_reboot - How to verify it Perform reboot on all the Nvidia platforms, and check all can be rebooted successfully. Signed-off-by: Kebo Liu --- .../x86_64-mlnx_msn2700-r0/platform_reboot | 4 +- .../ACS-SN2201/sai_2201.xml | 186 +++++++++--------- 2 files changed, 94 insertions(+), 96 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot index 7a38268ff0..b2188fde6f 100755 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/platform_reboot @@ -5,7 +5,7 @@ declare -r EXIT_ERROR="1" declare -r PENDING_COMPONENT_FW="/usr/bin/install-pending-fw.py" declare -r FW_UPGRADE_SCRIPT="/usr/bin/mlnx-fw-upgrade.sh" -declare -r SYSFS_PWR_CYCLE="/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/pwr_cycle" +declare -r SYSFS_PWR_CYCLE="/var/run/hw-management/system/pwr_cycle" FORCE_REBOOT="no" @@ -24,8 +24,6 @@ function SafePwrCycle() { sync ; sync umount -fa > /dev/null 2&>1 echo 1 > $SYSFS_PWR_CYCLE - sleep 3 - echo 0 > $SYSFS_PWR_CYCLE } ParseArguments "$@" diff --git a/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/sai_2201.xml b/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/sai_2201.xml index d50843270c..8c57d2f20b 100644 --- a/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/sai_2201.xml +++ b/device/mellanox/x86_64-nvidia_sn2201-r0/ACS-SN2201/sai_2201.xml @@ -36,337 +36,337 @@ 0 0 - - 3 + + 131072 62 1 1 0 - 3 + 131072 63 1 2 0 - 3 + 131072 64 1 3 0 - 3 + 131072 57 1 4 0 - 3 + 131072 58 1 5 0 - 3 + 131072 59 1 6 0 - 3 + 131072 60 1 7 0 - 3 + 131072 53 1 8 0 - 3 + 131072 54 1 9 0 - 3 + 131072 55 1 10 0 - 3 + 131072 56 1 11 0 - 3 + 131072 49 1 12 0 - 3 + 131072 50 1 13 0 - 3 + 131072 51 1 14 0 - 3 + 131072 52 1 15 0 - 3 + 131072 45 1 16 0 - 3 + 131072 46 1 17 0 - 3 + 131072 47 1 18 0 - 3 + 131072 48 1 19 0 - 3 + 131072 41 1 20 0 - 3 + 131072 42 1 21 0 - 3 + 131072 43 1 22 0 - 3 + 131072 44 1 23 0 - 3 + 131072 37 1 24 0 - 3 + 131072 38 1 25 0 - 3 + 131072 39 1 26 0 - 3 + 131072 40 1 27 0 - 3 + 131072 33 1 28 0 - 3 + 131072 34 1 29 0 - 3 + 131072 35 1 30 0 - 3 + 131072 36 1 31 0 - 3 + 131072 1 1 32 0 - 3 + 131072 2 1 33 0 - 3 + 131072 3 1 34 0 - 3 + 131072 4 1 35 0 - 3 - - - 5 - 1 - 36 - 0 - 3 - - - 6 - 1 - 37 - 0 - 3 - - - 17 - 1 - 38 - 0 - 3 - - - 18 - 1 - 39 - 0 - 3 - - - 19 - 1 - 40 - 0 - 3 - - - 20 - 1 - 41 - 0 - 3 + 131072 21 1 - 42 + 36 0 - 3 + 131072 22 1 - 43 + 37 0 - 3 + 131072 23 1 - 44 + 38 0 - 3 + 131072 24 1 - 45 + 39 0 - 3 + 131072 25 1 - 46 + 40 0 - 3 + 131072 26 1 + 41 + 0 + 131072 + + + 27 + 1 + 42 + 0 + 131072 + + + 28 + 1 + 43 + 0 + 131072 + + + 29 + 1 + 44 + 0 + 131072 + + + 30 + 1 + 45 + 0 + 131072 + + + 31 + 1 + 46 + 0 + 131072 + + + 32 + 1 47 0 - 3 + 131072 9 @@ -376,21 +376,21 @@ 11534336 - 7 + 5 4 49 3 11534336 - 13 + 17 4 50 3 11534336 - 11 + 13 4 51 3