Skip to content

Implement ELSFP CMIS API#684

Open
bgallagher-nexthop wants to merge 4 commits into
sonic-net:masterfrom
nexthop-ai:elsfp-api
Open

Implement ELSFP CMIS API#684
bgallagher-nexthop wants to merge 4 commits into
sonic-net:masterfrom
nexthop-ai:elsfp-api

Conversation

@bgallagher-nexthop
Copy link
Copy Markdown
Contributor

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.

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>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@bgallagher-nexthop bgallagher-nexthop marked this pull request as ready for review June 2, 2026 02:09
@prgeor prgeor requested a review from Copilot June 2, 2026 13:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ElsfpApi implementing 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 in get_active_apsel_hostlane().
  • Added unit tests and an InMemoryEeprom test 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.

Comment thread sonic_platform_base/sonic_xcvr/api/public/elsfp.py
Comment thread sonic_platform_base/sonic_xcvr/api/public/elsfp.py
Comment thread sonic_platform_base/sonic_xcvr/api/public/elsfp.py Outdated
Comment thread sonic_platform_base/sonic_xcvr/api/public/elsfp.py Outdated
Comment thread tests/sonic_xcvr/test_elsfp.py
Comment thread sonic_platform_base/sonic_xcvr/api/public/elsfp.py Outdated
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants