[sonic_xcvr] Fix firmware download TypeError - #744
Merged
Conversation
Signed-off-by: Pavan Kalyan Nakka <pnakka@microsoft.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes CDB firmware downloads by normalizing module-reported block sizes to integers before file reads.
Changes:
- Converts firmware payload and block sizes to integers.
- Adds coverage for floating-point EPL block sizes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
sonic_platform_base/sonic_xcvr/cdb/cdb_fw.py |
Normalizes firmware block-size fields. |
tests/sonic_xcvr/test_cdb_fw.py |
Verifies EPL block-size conversion. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mihirpat1
approved these changes
Aug 24, 2026
Collaborator
|
The change is not in 202605 yet. @pnakka28, please manually create the cherry pick PR for branch 202605. ---Powered by SONiC BuildBot
|
vaibhavhd
pushed a commit
that referenced
this pull request
Aug 28, 2026
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
The CDB firmware block size fields come back from the module as floats. That float made it all to
file.read()during firmware download, which only accepts an integer, so the download crashed with a TypeError on any EPL-capable module that didn't advertise the maximum block size.Motivation and Context
Motivation and Context
Firmware download fails on any module that doesn't advertise the maximum block size:
How Has This Been Tested?
On version 202605:
Hardware: Reproduced the
TypeErroron the unpatched code, then confirmed firmware download proceeds past block-write with the fix applied.Unit tests:
pytest tests/sonic_xcvr/test_cdb_fw.pyAdditional Information (Optional)
MSFT ADO - 39388348