[Smartswitch][pcied] Fix pcied handling for smartswitch during DPU detach #5#633
Merged
judyjoseph merged 3 commits intosonic-net:masterfrom Jul 8, 2025
Merged
[Smartswitch][pcied] Fix pcied handling for smartswitch during DPU detach #5#633judyjoseph merged 3 commits intosonic-net:masterfrom
judyjoseph merged 3 commits intosonic-net:masterfrom
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
oleksandrivantsiv
approved these changes
Jun 26, 2025
Contributor
|
@gpunathilell could you update PR description with the testing info. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates how pcied handles DPU detach information by removing manual cleanup of detach entries and adapting to a tuple-based return format from detach_info.get.
- Drop deletion of
PCIE_DETACH_INFOentries in__del__ - Convert the
(exists, field_list)tuple fromdetach_info.getinto a dict for correct field access - Update tests to reflect the new tuple format
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/test_DaemonPcied.py | Removed assertions on detach_info._del; adjusted mock get() to return tuples |
| scripts/pcied | Deleted cleanup code for detach_info; unpacked tuple return and built dict |
Contributor
|
LGTM |
rameshraghupathy
approved these changes
Jul 3, 2025
Contributor
Author
Updated |
judyjoseph
reviewed
Jul 8, 2025
Collaborator
|
Cherry-pick PR to 202505: #641 |
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
Two changes are being done in this PR:
Remove deletion of the
PCIE_DETACH_INFOfrom the pcied (This should be handled by the power off/power on of the DPU from the module_base implementation)The returned value from
self.detach_info.get(key)in pcied is of the form tuple:(True, [('bus_info', '0000:03:00.1'), ('dpu_state', 'detaching')])This has to be handled correctly by the pcied (which was expecting a dictionaryMotivation and Context
This is required since the pcied should not delete the entries from the
PCIE_DETACH_INFOtable as opposed to the module_base implementationHow Has This Been Tested?
Unit tests:
Also tested manually on smart switch system,
Restarted pcied (
supervisorctl restart pciedin pmon docker) and checked that the detach info table is not deleted)Checked the logs to confirm that pcied is not crashing due to the additional change for processing of detach table
Additional Information (Optional)