Skip to content

Add BMCWatchdog base class to be used in SONiC BMC - #702

Open
chander-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:chander.bmc-watchdog
Open

Add BMCWatchdog base class to be used in SONiC BMC#702
chander-nexthop wants to merge 1 commit into
sonic-net:masterfrom
nexthop-ai:chander.bmc-watchdog

Conversation

@chander-nexthop

Copy link
Copy Markdown

in SONiC BMC, the watchdog service would be modeled along the classic linux watchdog daemon model, where one daemon would be the owner of /dev/watchdog0. However watchdog util expects the watchdog class to implement the SONiC watchdog API's like arm/disarm etc. So create a BMCWatchdog that implements all these API's as IPC calls to the daemon.

Description

BMCWatchdog implements the Linux watchdog API as an IPC client to the hw-watchdog-mgrd daemon (the sole owner of /dev/watchdog0), with a read-only sysfs fallback for is_armed() when the daemon is unreachable. socket and sysfs paths are configurable via the constructor. Includes unit tests.

Motivation and Context

By having the BMCWatchdog, all vendors that have their BMC based on aspeed 2720 SoC will instantiate this class within their Chassis object. The watchdog daemon is already part of the aspeed SONiC image.

How Has This Been Tested?

Unit tests have been added.

Additional Information (Optional)

Refer to sonic-net/sonic-buildimage#27776 for the discussions.

BMCWatchdog implements the Linux watchdog API as an IPC client to the
hw-watchdog-mgrd daemon (the sole owner of /dev/watchdog0), with a
read-only sysfs fallback for is_armed() when the daemon is unreachable.
socket and sysfs paths are configurable via the constructor. Includes
unit tests.

Signed-off-by: Chandrasekaran Swaminathan <chander@nexthop.ai>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks!

---Powered by SONiC BuildBot


# Default IPC socket served by the hw-watchdog-mgrd daemon. This must match
# SOCKET_PATH in the platform's hw-watchdog-mgrd.py daemon.
SOCKET_PATH = "/run/hw-watchdog-mgrd.sock"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chander-nexthop not sure if you already working on this .. but we need a way to mount this path in pmon docker to be able to using platform_api infra to arm/unarm or other operations on watchdog

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't. In fact had asked you about this here at sonic-net/sonic-buildimage#28715 (comment)

I shall take this up, but don't think this PR needs to be gated for that.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix the path in this PR after that PR merges.

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request label(s) for branch(es): msft-202608, but is missing required test information. Please make sure you tick the tested branch(es) in the Tested branch section and provide test evidence (e.g., 202608: <test result>) in the Test result section as well in your PR description.

---Powered by SONiC BuildBot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants