From a0c76b1bc9fb93ed1975fe73b75eb8c54e9df469 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Mon, 18 Apr 2022 15:55:56 +0800 Subject: [PATCH] [Mellanox] support newly added reboot cause (#10531) - Why I did it Implement newly added reboot causes in PR Azure/sonic-platform-common#277 - How I did it Map the reboot cause sysfs to the newly added reboot causes. - How to verify it manual test, check whether the reboot cause is correct after rebooting the switch in various ways. run the community reboot test to see whether the reboot cause checker is passing. Signed-off-by: Kebo Liu --- .../sonic_platform/chassis.py | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py index 1cc3d0f756..c7bafc0d89 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -657,24 +657,23 @@ class Chassis(ChassisBase): self.reboot_major_cause_dict = { 'reset_main_pwr_fail' : self.REBOOT_CAUSE_POWER_LOSS, 'reset_aux_pwr_or_ref' : self.REBOOT_CAUSE_POWER_LOSS, + 'reset_comex_pwr_fail' : self.REBOOT_CAUSE_POWER_LOSS, 'reset_asic_thermal' : self.REBOOT_CAUSE_THERMAL_OVERLOAD_ASIC, + 'reset_comex_thermal' : self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, 'reset_hotswap_or_wd' : self.REBOOT_CAUSE_WATCHDOG, + 'reset_comex_wd' : self.REBOOT_CAUSE_WATCHDOG, 'reset_swb_wd' : self.REBOOT_CAUSE_WATCHDOG, - 'reset_sff_wd' : self.REBOOT_CAUSE_WATCHDOG - } - self.reboot_minor_cause_dict = { - 'reset_fw_reset' : "Reset by ASIC firmware", - 'reset_long_pb' : "Reset by long press on power button", - 'reset_short_pb' : "Reset by short press on power button", - 'reset_comex_thermal' : "ComEx thermal shutdown", - 'reset_comex_pwr_fail' : "ComEx power fail", - 'reset_comex_wd' : "Reset requested from ComEx", - 'reset_from_asic' : "Reset requested from ASIC", - 'reset_reload_bios' : "Reset caused by BIOS reload", - 'reset_hotswap_or_halt' : "Reset caused by hotswap or halt", - 'reset_from_comex' : "Reset from ComEx", - 'reset_voltmon_upgrade_fail': "Reset due to voltage monitor devices upgrade failure" + 'reset_sff_wd' : self.REBOOT_CAUSE_WATCHDOG, + 'reset_hotswap_or_halt' : self.REBOOT_CAUSE_HARDWARE_OTHER, + 'reset_voltmon_upgrade_fail': self.REBOOT_CAUSE_HARDWARE_OTHER, + 'reset_reload_bios' : self.REBOOT_CAUSE_HARDWARE_BIOS, + 'reset_from_comex' : self.REBOOT_CAUSE_HARDWARE_CPU, + 'reset_fw_reset' : self.REBOOT_CAUSE_HARDWARE_RESET_FROM_ASIC, + 'reset_from_asic' : self.REBOOT_CAUSE_HARDWARE_RESET_FROM_ASIC, + 'reset_long_pb' : self.REBOOT_CAUSE_HARDWARE_BUTTON, + 'reset_short_pb' : self.REBOOT_CAUSE_HARDWARE_BUTTON } + self.reboot_minor_cause_dict = {} self.reboot_by_software = 'reset_sw_reset' self.reboot_cause_initialized = True