[CMIS] Gracefully handle setting of max_banks_size in optoe#668
Open
prgeor wants to merge 4 commits into
Open
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Prince George <prgeor@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors CMIS/optoe bank-size handling so the maximum supported bank value can be derived from the CMIS EEPROM memory map and applied to the optoe max_bank_size sysfs entry when available.
Changes:
- Adds a CMIS API accessor for supported banks.
- Converts the CMIS
BanksSupportedfield to use a code table. - Updates optoe refresh logic to attempt setting
max_bank_sizeafter API refresh.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
sonic_platform_base/sonic_xcvr/sfp_optoe_base.py |
Updates optoe max_bank_size sysfs handling and refresh flow. |
sonic_platform_base/sonic_xcvr/api/public/cmis.py |
Adds a CMIS accessor for maximum supported banks. |
sonic_platform_base/sonic_xcvr/mem_maps/public/cmis.py |
Changes BanksSupported decoding to use CMIS code mappings. |
sonic_platform_base/sonic_xcvr/codes/public/cmis.py |
Adds the CMIS bank-support code table. |
Comment on lines
+335
to
+337
| except: | ||
| max_bank_size = 0 | ||
| pass |
| MAX_BANKS_SUPPORTED = { | ||
| 0: 0, | ||
| 1: 2, | ||
| 2: 4 |
Comment on lines
+147
to
+153
| def get_max_supported_banks(self): | ||
| """Returns max supported banks""" | ||
|
|
||
| if self.is_flat_memory(): | ||
| return 0 | ||
|
|
||
| return self.xcvr_eeprom.read(consts.BANKS_SUPPORTED_FIELD) |
Signed-off-by: Prince George <prgeor@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Prince George <prgeor@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Prince George <prgeor@microsoft.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
bgallagher-nexthop
approved these changes
May 19, 2026
Contributor
bgallagher-nexthop
left a comment
There was a problem hiding this comment.
LGTM, thanks Prince
mihirpat1
approved these changes
May 19, 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
Refactored the code to gracefully handle setting of the maximum bank size for platforms using optoe kernel driver for the CMIS compliant transceivers/CPO
Motivation and Context
Use existing EEPROM memory map scheme for max supported bank and handle cases where platform does not use optoe driver
How Has This Been Tested?
Unit test
Additional Information (Optional)