[sonic_xcvr] Use advertised timeouts for CDB firmware commands - #681
Conversation
Signed-off-by: Pavan Kalyan Nakka <pnakka@microsoft.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR updates the CMIS CDB firmware-management implementation in sonic_platform_base/sonic_xcvr to use module-advertised per-command MaxDuration values (from CMIS page 9Fh) as timeouts for firmware operations, and adjusts unit tests accordingly.
Changes:
- Parse and expose
MaxDurationfields (Start/Abort/Write/Complete/Copy) from CMIS page 9Fh CDB firmware management features. - Thread per-command timeouts into firmware Start/Abort/Write/Complete command execution paths (and add a shared safety-margin constant).
- Update unit tests to expect the new
timeout=arguments.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sonic_xcvr/test_cdb.py | Updates assertions to include the new timeout kwarg passed into send_cmd(). |
| tests/sonic_xcvr/test_cdb_fw.py | Updates firmware handler tests to expect per-command timeout parameters. |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/page9f_cdb.py | Adds MaxDuration fields to the firmware management features map on page 9Fh. |
| sonic_platform_base/sonic_xcvr/fields/cdb_consts.py | Adds new MaxDuration field names and a timeout safety-margin constant. |
| sonic_platform_base/sonic_xcvr/cdb/cdb.py | Plumbs timeout through firmware block-write helpers and uses the shared safety-margin constant. |
| sonic_platform_base/sonic_xcvr/cdb/cdb_fw.py | Computes per-command timeouts from advertised MaxDuration and passes them into Start/Abort/Write/Complete commands. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Pavan Kalyan Nakka <pnakka@microsoft.com>
e107776 to
203d431
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
This PR has backport request label(s) for branch(es): 202605, but is missing required test information. Please make sure you tick the tested branch(es) in the Tested branch section and provide test evidence (e.g., 202605: <test result>) in the Test result section as well in your PR description. ---Powered by SONiC BuildBot
|
|
@pnakka28 — This PR is requested for the 202605 branch but is missing test evidence. To move forward with cherry-pick approval, please:
Also, to help us prioritize correctly, could you clarify: Is this PR a bug fix / regression fix, a new feature, a platform config change, or a dependency/infra update? Understanding the nature of the change helps us triage the cherry-pick queue. Thank you! Review by @vaibhavhd via automated tooling |
This is a spec-compliance fix, not a new feature. No new user-facing feature, platform config change, or dependency update. Tested against 202605 and updated the PR description with the image version and test results. Note on ordering: this PR should be cherry-picked to 202605 before #722, which builds on it. I verified that #681 cherry-picks cleanly onto the current 202605 branch, and #722 then applies cleanly on top with no conflict. @vaibhavhd |
Description
Use module advertised timeouts for CDB firmware commands. This change parses the
MaxDurationfields and uses them as per-command timeouts for firmware operations. These timeouts are passed to the Start, Abort, Write, and Complete firmware commands. Commands without a spec definedMaxDurationcontinue to use the default timeout. Unit tests have been updated accordingly.Motivation and Context
The CDB firmware commands previously used a default timeout for all operations. However, per CMIS spec, modules advertise per command MaxDuration values, and commands can have different execution times. This change ensures to respect module advertised timing constraints as defined in the CMIS specification.
How Has This Been Tested?
MaxDurationvalues are correctly parsed from the moduletest_cdb_fw.pyandtest_cdb.pypass with new timeout parameters -> 98 passedAdditional Information (Optional)
MSFT ADO - 38035182