Skip to content

[Smartswitch][DPU]Add multiple key handling#686

Merged
prabhataravind merged 3 commits intosonic-net:masterfrom
gpunathilell:dpu_state_change
Oct 1, 2025
Merged

[Smartswitch][DPU]Add multiple key handling#686
prabhataravind merged 3 commits intosonic-net:masterfrom
gpunathilell:dpu_state_change

Conversation

@gpunathilell
Copy link
Contributor

@gpunathilell gpunathilell commented Sep 23, 2025

Description

Main Logic Addition (sonic-chassisd/scripts/chassisd): Added a new condition check in the DpuStateManagerTask class The logic checks if there's a non-empty key AND the database is not 'CHASSIS_STATE_DB' When both conditions are true, it sets update_required = True and breaks out of the loop

Motivation and Context

When there is updates to multiple DBs at the same time, usually if there is update to CHASSIS_STATE_DB the update_required is set to false, this change is added to handle this case

How Has This Been Tested?

tests/test_dpu_chassisd.py::test_dpu_state_manager_update_required_logic PASSED [100%]
Manual test to shutdown interface/service and confirm that the data plane/control plane interfaces are set to down

Additional Information (Optional)

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@gpunathilell gpunathilell changed the title Add multiple key handling [Smartswitch][DPU]Add multiple key handling Sep 25, 2025
@gpunathilell gpunathilell marked this pull request as ready for review September 25, 2025 17:42
self.logger.log_info(f"DPU_STATE change detected: operation={op}, key={key}")
elif key:
# If there is any change in the non-DPU_STATE table, we need to update the state
update_required = True
Copy link
Contributor

Choose a reason for hiding this comment

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

Default value set is True already, won't that cover this case?

Copy link
Contributor

Choose a reason for hiding this comment

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

Had a discussion offline with @gpunathilell to clarify on this.

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202506: Azure/sonic-platform-daemons.msft#52

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