Skip to content
New issue

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

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

Already on GitHub? # to your account

[barefoot][platform] Chassis.get_reboot_cause #7794

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

vboykox
Copy link
Member

@vboykox vboykox commented Jun 4, 2021

Signed-off-by: Volodymyr Boyko volodymyrx.boiko@intel.com

Why I did it

To fix determine-reboot-cause service which was failing due to non-implemented thrown from get_reboot_case, if the reboot was done with sudo reboot (cold reboot)

How I did it

Added get_reboot_case implementation that will always return Non-Hardware reason.

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012

Description for the changelog

barefoot implementation of sonic_platform.chassis.Chassis.get_reboot_cause

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
@vboykox vboykox requested a review from lguohan as a code owner June 4, 2021 13:40
@vboykox vboykox closed this Jun 4, 2021
@vboykox vboykox reopened this Jun 4, 2021
@vboykox
Copy link
Member Author

vboykox commented Jun 4, 2021

@akokhan

@vboykox
Copy link
Member Author

vboykox commented Jun 4, 2021

@jleveque to me it looks confusing that if platform does not support determining any of REBOOT_CAUSE_ it should return Non-Hardware to make determine-reboot-cause work.
imho REBOOT_CAUSE_NON_HARDWARE should only mean none of other conditions, which could be tracked by platform (power loss, etc), happened.
The alternative PR: #7796

@jleveque
Copy link
Contributor

jleveque commented Jun 4, 2021

@jleveque to me it looks confusing that if platform does not support determining any of REBOOT_CAUSE_ it should return Non-Hardware to make determine-reboot-cause work.
imho REBOOT_CAUSE_NON_HARDWARE should only mean none of other conditions, which could be tracked by platform (power loss, etc), happened.
The alternative PR: #7796

REBOOT_CAUSE_NON_HARDWARE implies that a hardware-initiated reboot cause (e.g., power loss, thermal overload, etc.) did not occur. If the platform doesn't support detecting any hardware-initiated reboot causes, then REBOOT_CAUSE_NON_HARDWARE makes sense, because we were unable to determine that a hardware-initiated reboot occurred.

Your platform doesn't support detecting any hardware-initiated reboot causes?

@vboykox
Copy link
Member Author

vboykox commented Jun 4, 2021

@jleveque For now we will not support it in SONiC.
So we have to state that reason is not hardware even if device lost power. There is no "I don't know" option.

@jleveque
Copy link
Contributor

jleveque commented Jun 4, 2021

@jleveque For now we will not support it in SONiC.
So we have to state that reason is not hardware even if device lost power. There is no "I don't know" option.

If the platform API returns REBOOT_CAUSE_NON_HARDWARE, the reboot cause determination logic will check to see if a software reboot was initiated. If there is no record of a software reboot, the reboot cause will be "Unknown". So in your case, if a hardware-initiated reboot occurs but you return REBOOT_CAUSE_NON_HARDWARE, the reboot cause should be "Unknown".

@vboykox
Copy link
Member Author

vboykox commented Jun 4, 2021

@jleveque Yes, specifically for determine-reboot-cause, it makes sense to return NON_HARDWARE in combination with sw cause check.
Thank you for explanation!

@vboykox
Copy link
Member Author

vboykox commented Jun 10, 2021

@lguohan

1 similar comment
@vboykox
Copy link
Member Author

vboykox commented Jun 10, 2021

@lguohan

@jleveque jleveque merged commit 3b451b7 into sonic-net:master Jun 11, 2021
qiluo-msft pushed a commit that referenced this pull request Jun 16, 2021
To fix determine-reboot-cause service which was failing due to non-implemented thrown from get_reboot_case, if the reboot was done with `sudo reboot` (cold reboot)

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
Junchao-Mellanox pushed a commit to Junchao-Mellanox/sonic-buildimage that referenced this pull request Jun 24, 2021
To fix determine-reboot-cause service which was failing due to non-implemented thrown from get_reboot_case, if the reboot was done with `sudo reboot` (cold reboot)

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
To fix determine-reboot-cause service which was failing due to non-implemented thrown from get_reboot_case, if the reboot was done with `sudo reboot` (cold reboot)

Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants