[PMON HLD] update get_reboot_cause mechanism and add get_midplane_dow… - #2385
Conversation
…n_reason The commit updates 2 main parts: - when to run get_reboot_cause - get_midplane_down_reason Signed-off-by: Charles Tsai <chartsai@nvidia.com>
|
/azp run |
|
No pipelines are associated with this pull request. |
|
@vvolam any further comments or this HLD can be approved and merged? |
@liat-grozovik In between the review. I will approve this week, if no further comments. |
| | 0.4 | 06/06/2024 | Ramesh Raghupathy | Added schema for DPU health-info and called out phase:1 and phase:2 activities for DPU health-info. Added key suffix to module reboot-cause to avoid key conflicts | | ||
| | 0.5 | 04/30/2025 | Gagan Punathil Ellath | Added Post Startup and Pre shutdown sections for DPU | | ||
| | 0.6 | 06/12/2025 | Gagan Punathil Ellath | DPU State Management Implementation | | ||
| | 0.7 | 06/11/2026 | Charles Tsai | Updated DPU reboot-cause and midplane-down reason | |
There was a problem hiding this comment.
@chartsai-nvidia What is the rationale for this change?
There was a problem hiding this comment.
This change updates the HLD to reflect the addition of the new reboot cause mechanism and get_midplane_down_reason() API. The version number is updated accordingly.
There was a problem hiding this comment.
@chartsai-nvidia The question was why are we changing the existing behavior of capturing and reporting the reboot-cause of DPUs even when the DPUs are down, which was done intentionally in the existing implementation to help debug DPU failure.
There was a problem hiding this comment.
@rameshraghupathy This was already discussed in the platform meeting, we need to make sure that the behavior is aligned to the switch side, we do not want 2 reboot causes for each DPU reboots (->offline->Online) . That is why the get_midplane_down_reason() is being added newly so that the platform can still provide additional info to help debug DPU failure. Do you want this to be explicitly recorded?
95bf3bc
|
/azp run |
|
No pipelines are associated with this pull request. |
|
@chartsai-nvidia Please fix DCO issue by amending your signoff to all commits. |
Signed-off-by: Charles Tsai <chartsai@nvidia.com>
95bf3bc to
761566a
Compare
|
/azp run |
|
No pipelines are associated with this pull request. |
Done. Thanks |
vvolam
left a comment
There was a problem hiding this comment.
LGTM other than a small nit. @rameshraghupathy @seveerap79 do you have comments?
| | 0.4 | 06/06/2024 | Ramesh Raghupathy | Added schema for DPU health-info and called out phase:1 and phase:2 activities for DPU health-info. Added key suffix to module reboot-cause to avoid key conflicts | | ||
| | 0.5 | 04/30/2025 | Gagan Punathil Ellath | Added Post Startup and Pre shutdown sections for DPU | | ||
| | 0.6 | 06/12/2025 | Gagan Punathil Ellath | DPU State Management Implementation | | ||
| | 0.7 | 06/11/2026 | Charles Tsai | Updated DPU reboot-cause and midplane-down reason | |
There was a problem hiding this comment.
@chartsai-nvidia The question was why are we changing the existing behavior of capturing and reporting the reboot-cause of DPUs even when the DPUs are down, which was done intentionally in the existing implementation to help debug DPU failure.
Signed-off-by: Charles Tsai <chartsai@nvidia.com>
|
/azp run |
|
/azp run |
|
No pipelines are associated with this pull request. |
| * On an `up -> down` midplane transition, chassisd records a reason string in `dpu_midplane_link_reason`: | ||
| - **Planned** — a DPU lifecycle operation is active, so the link loss is expected. Recorded as `Planned: '<transition_type>'`. | ||
| - **Unplanned** — otherwise, chassisd queries the platform through `get_midplane_down_reason()` and records `Unplanned: '<reason>'`, or `Unplanned: 'Unknown'` when the platform provides no reason. | ||
| * A DPU lifecycle operation counts as active only when all three hold: `transition_in_progress` is `"True"`, `transition_type` is one of the valid types, and `transition_start_time` has not exceeded the timeout for that `transition_type`. A stale value left behind by a completed, timed-out or failed operation therefore cannot classify a later failure as Planned. |
There was a problem hiding this comment.
@chartsai-nvidia Looks like the current SmartSwitch transition field used by the surrounding design and implementation is state_transition_in_progress, not transition_in_progress. Can you double check?
There was a problem hiding this comment.
Thanks for catching the inconsistency. I checked the current runtime path and found that the deployed implementation uses transition_in_progress:
ModuleBase.set_module_state_transition()writestransition_in_progress.- This implementation was introduced by sonic-platform-common#608.
- I also confirmed that the code deployed on Bobcat-1250 reads and writes
transition_in_progress.
state_transition_in_progress appears in several related places:
- The earlier graceful-shutdown HLD
- The DPU robustness HLD
- A sonic-gnmi test fixture
- sonic-utilities docstrings and log messages
However, I could not find a current production writer for state_transition_in_progress. sonic-utilities delegates transition handling to the platform API, which currently writes transition_in_progress.
Therefore, changing only this HLD to state_transition_in_progress would make it disagree with the current runtime implementation.
@vvolam, since you implemented the related transition handling in sonic-platform-common and sonic-utilities, could you clarify which field name should we use: transition_in_progress or state_transition_in_progress?
We can determine whether this HLD should change or whether the older documentation and related references are stale.
There was a problem hiding this comment.
@rameshraghupathy transition_in_progress is the right DB parameter. Any references in the code for state_transition_in_progress should be fixed accordingly.
rameshraghupathy
left a comment
There was a problem hiding this comment.
@chartsai-nvidia Can you please address the coments?
Signed-off-by: Charles Tsai <chartsai@nvidia.com>
|
/azp run |
|
No pipelines are associated with this pull request. |
|
@rameshraghupathy done, please check, thanks |
|
@chartsai-nvidia The DPU reboot sequence diagram
This conflicts with the new Could you please regenerate |
@vvolam Sure. @rameshraghupathy do you still have the source used to generate this diagram? If not, I’ll reconstruct it and update both the source and SVG to reflect the new flow. Thanks |
@chartsai-nvidia Find below the mmd file content |
Signed-off-by: Charles Tsai <chartsai@nvidia.com>
8b06f6d
|
/azp run |
|
No pipelines are associated with this pull request. |
|
@vvolam The svg has updated. Thanks |
vvolam
left a comment
There was a problem hiding this comment.
LGTM, Thank you.
Please verify if we need to add reboot_cause testcases to cover the scenarios.
Also, you may have to add a testcase to cover midplane_down reason in DPU crash scenarios and check if the reason is being updated..
|
@rameshraghupathy are we good? if so approve |
rameshraghupathy
left a comment
There was a problem hiding this comment.
@chartsai-nvidia Just provided one comment. Mostly LGTM. Please address that and hen I'll approve it.
rameshraghupathy
left a comment
There was a problem hiding this comment.
@chartsai-nvidia Can you call out that when the the platforms don't implement get_midplane_down_reason(), the ModuleBase default should return the string "Unknown" ?
Why I did it
Refines the SmartSwitch PMON HLD for DPU reboot-cause and midplane-down handling:
only by an offline→online transition. Now the cause is captured only when the midplane is online,
using a per-boot
boot_idso chassisd reliably detects a real DPU reboot.get_midplane_down_reason()platform API and documents planned vs. unplanned midplane-downreasons.
Work item tracking
How I did it
boot_id: the DPU publishes a fresh per-boot UUID intoCHASSIS_STATE_DB; the NPU chassisd compares it to the last persisted value and calls
get_reboot_cause()only on a real reboot with midplane up.boot_idto theREBOOT_CAUSEandDPU_STATEschema examples.up→downmidplane handling (planned via transition flag vs. unplanned viaget_midplane_down_reason()) and added the new API definition.How to verify it
Merge Dependencies
sonic-platform-commondefines the platform API, andsonic-buildimageimplements it for Mellanox.sonic-platform-daemonsconsumes the API, captures DPU reboot causes, and persists the records.sonic-host-servicesrestores persisted records intoCHASSIS_STATE_DBduring boot. It has no merge dependency on the other changes.