Create ELSFP memory map classes#678
Open
aditya-nexthop wants to merge 9 commits into
Open
Conversation
Signed-off-by: Abhi Singh <abhi@nexthop.ai>
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
Signed-off-by: aditya-nexthop <aditya@nexthop.ai>
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
Signed-off-by: aditya-nexthop <aditya@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This was referenced May 26, 2026
micas-net
reviewed
May 27, 2026
micas-net
reviewed
May 27, 2026
prgeor
reviewed
May 27, 2026
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: aditya-nexthop <aditya@nexthop.ai>
f19c2cf to
73a334a
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: aditya-nexthop <aditya@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds ELSFP (OIF-ELSFP-CMIS-01.0) support to sonic-platform-common by introducing an ELSFP-specific CMIS memory map, new page implementations (1Ah/1Bh), and the accompanying field constants and code tables so ELSFP modules can be identified and their ELSFP-only fields can be accessed via the existing mem-map APIs.
Changes:
- Introduces
ElsfpMemMapcomposed from standard CMIS pages plus new ELSFP pages 0x1A/0x1B (excluding CMIS lane-datapath pages 0x10–0x13). - Adds ELSFP page implementations and ELSFP-specific field-name constants and code tables.
- Extends CMIS page 0x00 lower to expose
MODULE_FUNCTION_TYPEin anEXTENDED_MODULE_INFO_FIELD, with a new unit test covering page composition and basic field/code availability.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sonic_xcvr/test_elsfp.py | Adds unit tests for ElsfpMemMap page composition, field resolvability, and ELSFP-specific code tables. |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/page1a.py | Adds ELSFP CMIS page 0x1A fields (advertisements, flags, controls, masks, lane state). |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/page1b.py | Adds ELSFP CMIS page 0x1B fields (per-lane setpoints/monitors). |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/page00_lower.py | Adds EXTENDED_MODULE_INFO_FIELD containing MODULE_FUNCTION_TYPE for ELSFP identification. |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/consts.py | Defines ELSFP page number constants (0x1A, 0x1B). |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/pages/init.py | Re-exports ELSFP page constants and page classes. |
| sonic_platform_base/sonic_xcvr/mem_maps/public/cmis/elsfp.py | Adds ElsfpMemMap that composes the appropriate CMIS + ELSFP pages. |
| sonic_platform_base/sonic_xcvr/fields/elsfp_consts.py | Adds ELSFP-specific field-name constants for pages 0x1A and 0x1B. |
| sonic_platform_base/sonic_xcvr/fields/consts.py | Adds shared field-name constants for MODULE_FUNCTION_TYPE and EXTENDED_MODULE_INFO_FIELD. |
| sonic_platform_base/sonic_xcvr/codes/public/elsfp.py | Adds ElsfpCodes extending CMIS codes with ELSFP-specific code tables. |
| sonic_platform_base/sonic_xcvr/codes/public/cmis.py | Adds MODULE_FUNCTION_TYPE code table and extends VDM type entries. |
prgeor
reviewed
May 28, 2026
…eview comments Signed-off-by: aditya-nexthop <aditya@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.
Cherry pick commits from nexthop-ai#2 to public fork since it wasn't possible to move the original PR to
sonic-netDescription
Add memory-map support for ELSFP (External Laser Source Function Plug,
OIF-ELSFP-CMIS-01.0). Builds on the per-page CMIS refactor from #667.
mem_maps/public/elsfp.py—ElsfpMemMapextendsCmisFlatMemMapand composes pages 01h, 02h, 1Ah, 1Bh, 2Fh, 9Fh via
add_pages(...).Excludes lane-datapath pages 10h–13h (not present on ELSFP modules).
cmis/pages/page1a.py—ElsfpAdvertisementsFlagsCtrlPage(CMIS 1Ah,OIF-ELSFP Tables 4–10): module advertisements, lane faults/warnings,
laser save/restore, alarm masks, per-lane fault/warning codes, lane
controls, lane-to-fiber mapping, per-lane frequency.
cmis/pages/page1b.py—ElsfpSetpointsMonitorsPage(CMIS 1Bh,Tables 11–12): per-lane bias-current / optical-power setpoints and
monitors, voltage monitor, ICC monitor.
fields/elsfp_consts.py— ELSFP field-name constants.codes/public/cmis.py— addsCONTROL_MODE,LANE_FAULT_CODE,LANE_WARNING_CODE,LANE_STATEcode tables.cmis/pages/consts.py+__init__.py— ELSFP page-number constantsand new-class re-exports.
cmis/pages/page00_lower.py— addsEXTENDED_MODULE_INFO_FIELD(
MODULE_FUNCTION_TYPEat byte 57) so ELSFP modules are identifiablevia the standard module-info block.
Motivation and Context
ELSFP modules expose CMIS but substitute the lane-datapath pages
(10h–13h) for laser-source control pages (1Ah/1Bh) and add their own
fault/warning vocabulary. Without these classes, none of the
ELSFP-specific fields are addressable from sonic-platform-common.
The per-page memory-map refactor in #667 made this composable:
ElsfpMemMapreuses every shared CMIS page and only adds the two ELSFPpages plus the small set of new codes/consts they reference.
How Has This Been Tested?
pytestsuite: 1168 passed in 1.53s (no regressions vs master).ElsfpMemMap(CmisCodes)instantiates cleanly and exposes the newfield groups via the inherited
XcvrMemMap.get_field()lookup.Additional Information (Optional)
Purely additive — no existing class is modified semantically.