Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix for bug-21459: Set the initial DPU admin state #588

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rameshraghupathy
Copy link
Contributor

@rameshraghupathy rameshraghupathy commented Feb 9, 2025

Description

Set the initial DPU admin state to "down" for DPUs that don't have the "CHASSIS_MODULE" configured. The default is "down"

Fixes: sonic-net/sonic-buildimage#21459

Motivation and Context

The chassisd config change handler is not triggering the config change event the very first time.

How Has This Been Tested?

The new set of smartswitch tests added into sonic-mgmt

Additional Information (Optional)

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vvolam
Copy link
Contributor

vvolam commented Feb 19, 2025

@rameshraghupathy could you update fixes tag in description to point to sonic-net/sonic-buildimage#21459?

@rameshraghupathy
Copy link
Contributor Author

Fixes: sonic-net/sonic-platform-daemons#21459

@vvolam Done

try:
# Get admin state of DPU
admin_state = self.module_updater.get_module_admin_status(module_name)
if admin_state == 'empty' and operational_state != ModuleBase.MODULE_STATUS_ONLINE:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if admin_state == 'empty' and operational_state != ModuleBase.MODULE_STATUS_ONLINE:
if admin_state == 'empty' and operational_state == ModuleBase.MODULE_STATUS_ONLINE:

Shouldnt the admin state be set to down if there is no data in CONFIG_DB and if the module is currently online?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Smartswitch] DPUs are not powered off on Switch startup if there is no config entry for admin state present
4 participants