Implement ELSFP CMIS API#684
Open
bgallagher-nexthop wants to merge 4 commits into
Open
Conversation
Add API methods to interact with an ELSFP module, specifically adding methods to cover the information exposed in pages 1Ah and 1Bh of the ELSFP EEPROM. ELSFP CMIS Spec Document: https://www.oiforum.com/wp-content/uploads/OIF-ELSFP-CMIS-01.0.pdf This is required to expose the ELSFP memory map to application code. This PR contains new unit-tests that exercises each new API method using an in-memory EEPROM. --------- Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends sonic_platform_base’s transceiver abstraction by adding an ELSFP-specific CMIS API (ElsfpApi) to expose data from ELSFP EEPROM pages 1Ah/1Bh, along with unit tests that exercise the new API using an in-memory EEPROM backend.
Changes:
- Added
ElsfpApiimplementing read/write helpers and page 1Ah/1Bh accessors for ELSFP modules. - Added ELSFP save/restore command/confirmation enums and expanded CMIS API support with
get_module_function_type()plus a guard inget_active_apsel_hostlane(). - Added unit tests and an
InMemoryEepromtest utility to validate encode/decode logic end-to-end.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sonic_xcvr/test_elsfp.py | Adds extensive unit tests for the new ELSFP API methods using an in-memory EEPROM. |
| tests/sonic_xcvr/eeprom_utils.py | Introduces an in-memory XcvrEeprom wrapper for tests to simulate EEPROM reads/writes. |
| sonic_platform_base/sonic_xcvr/fields/elsfp_consts.py | Adds enums for ELSFP save/restore command and confirmation codes. |
| sonic_platform_base/sonic_xcvr/api/public/elsfp.py | New ElsfpApi implementing ELSFP CMIS page 1Ah/1Bh accessors and helpers. |
| sonic_platform_base/sonic_xcvr/api/public/cmis.py | Adds get_module_function_type() and uses it to short-circuit APSel reads for resource modules. |
prgeor
reviewed
Jun 2, 2026
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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
Add API methods to interact with an ELSFP module, specifically adding methods to cover the information exposed in pages 1Ah and 1Bh of the ELSFP EEPROM.
ELSFP CMIS Spec Document:
https://www.oiforum.com/wp-content/uploads/OIF-ELSFP-CMIS-01.0.pdf
Motivation and Context
This is required to expose the information in the ELSFP memory map to application code.
How Has This Been Tested?
This PR contains new unit-tests that exercises each new API method using an in-memory EEPROM.