[Smartswitch] Use MODULE_ADMIN_DOWN when DPU operational state is offline#772
Merged
liat-grozovik merged 1 commit intosonic-net:masterfrom Mar 12, 2026
Merged
Conversation
…offline Signed-off-by: gpunathilell <[email protected]>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
dgsudharsan
approved these changes
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
MODULE_PRE_SHUTDOWNconstant and all related handling from chassisd.MODULE_STATUS_EMPTY, always submitMODULE_ADMIN_DOWNto the callback (no longer useMODULE_PRE_SHUTDOWNwhen operational state is offline).submit_dpu_callback: it no longer invokesmodule_pre_shutdown; it only callsset_admin_state_gracefullywhen admin state isMODULE_ADMIN_DOWN.MODULE_ADMIN_DOWNfor the empty-offline case, and remove tests forMODULE_PRE_SHUTDOWN.Motivation and Context
The DPU can be in an intermediate state where
operational_stateis offline but we still need to force power off the DPU. Previously, when admin state was EMPTY and operational state was OFFLINE, the daemon usedMODULE_PRE_SHUTDOWN, which did not reliably power off the DPU in this case. By always usingMODULE_ADMIN_DOWNwhen admin state is EMPTY (regardless of operational state), we ensure the DPU is forced power off when required.How Has This Been Tested?
sonic-chassisd/tests/test_chassisd.py:test_set_initial_dpu_admin_state_empty_offline: now expectsMODULE_ADMIN_DOWNinstead ofMODULE_PRE_SHUTDOWN.test_set_initial_dpu_admin_state_empty_not_offline: assertion/comment aligned with new behavior.test_submit_dpu_callback: removedMODULE_PRE_SHUTDOWNscenario; retainedMODULE_ADMIN_DOWNtest.Additional Information (Optional)