Skip to content

[Smartswitch] Use MODULE_ADMIN_DOWN when DPU operational state is offline#772

Merged
liat-grozovik merged 1 commit intosonic-net:masterfrom
gpunathilell:frc_pw_down
Mar 12, 2026
Merged

[Smartswitch] Use MODULE_ADMIN_DOWN when DPU operational state is offline#772
liat-grozovik merged 1 commit intosonic-net:masterfrom
gpunathilell:frc_pw_down

Conversation

@gpunathilell
Copy link
Contributor

Description

  • Remove MODULE_PRE_SHUTDOWN constant and all related handling from chassisd.
  • When DPU admin state is MODULE_STATUS_EMPTY, always submit MODULE_ADMIN_DOWN to the callback (no longer use MODULE_PRE_SHUTDOWN when operational state is offline).
  • Simplify submit_dpu_callback: it no longer invokes module_pre_shutdown; it only calls set_admin_state_gracefully when admin state is MODULE_ADMIN_DOWN.
  • Update unit tests to match: expect MODULE_ADMIN_DOWN for the empty-offline case, and remove tests for MODULE_PRE_SHUTDOWN.

Motivation and Context

The DPU can be in an intermediate state where operational_state is offline but we still need to force power off the DPU. Previously, when admin state was EMPTY and operational state was OFFLINE, the daemon used MODULE_PRE_SHUTDOWN, which did not reliably power off the DPU in this case. By always using MODULE_ADMIN_DOWN when admin state is EMPTY (regardless of operational state), we ensure the DPU is forced power off when required.

How Has This Been Tested?

  • Updated and ran unit tests in sonic-chassisd/tests/test_chassisd.py:
    • test_set_initial_dpu_admin_state_empty_offline: now expects MODULE_ADMIN_DOWN instead of MODULE_PRE_SHUTDOWN.
    • test_set_initial_dpu_admin_state_empty_not_offline: assertion/comment aligned with new behavior.
    • test_submit_dpu_callback: removed MODULE_PRE_SHUTDOWN scenario; retained MODULE_ADMIN_DOWN test.

Additional Information (Optional)

@gpunathilell gpunathilell requested a review from vvolam March 11, 2026 15:06
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@vvolam vvolam left a comment

Choose a reason for hiding this comment

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

LGTM

@vvolam vvolam requested a review from rameshraghupathy March 11, 2026 18:35
@liat-grozovik liat-grozovik merged commit 7d8007d into sonic-net:master Mar 12, 2026
6 checks passed
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.

5 participants