Skip to content

Platform Support for CPO#682

Open
bgallagher-nexthop wants to merge 6 commits into
sonic-net:masterfrom
nexthop-ai:cpo-separate-eeprom-access
Open

Platform Support for CPO#682
bgallagher-nexthop wants to merge 6 commits into
sonic-net:masterfrom
nexthop-ai:cpo-separate-eeprom-access

Conversation

@bgallagher-nexthop
Copy link
Copy Markdown
Contributor

@bgallagher-nexthop bgallagher-nexthop commented May 29, 2026

Description

This PR makes the following changes:

  • Creates mixin classes that contain EEPROM read/write functionality and optoe functionality.
  • Refactors SfpBase and SfpOptoeBase to use these mixin classes.
  • Adds CPO base classes that leverage the above EEPROM read/write classes: CpoBase, OeBase, ElsfpBase, OptoeOeBase, OptoeElsfpBase.
  • Adds a CPO API factory class that handles instantiation of the appropriate API based on the type of CPO hardware.

Motivation and Context

This change is required to implement a platform data model for CPO hardware that SONiC daemons can use.

How Has This Been Tested?

Unit-tests are a work-in-progress, and will be updated once folks are happy with this design and example code (like in the CPO API factory) has been removed.

Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
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).

@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>
@bgallagher-nexthop bgallagher-nexthop force-pushed the cpo-separate-eeprom-access branch from e21b2ec to 025551a Compare May 29, 2026 00:34
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

# CMIS AdvBnkSupport (page 01h byte 142, bits 0-1): 00b->1, 01b->2, 10b->4 banks.
CMIS_BANKS_SUPPORTED_TO_MAX_BANK_SIZE = {0: 0, 1: 2, 2: 4}

class OptoeEepromReadWriteMixin(EepromReadWriteMixin, ABC):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@bgallagher-nexthop what does Mixin mean?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

https://en.wikipedia.org/wiki/Mixin

It is just a pattern for including functionality in a class without being a standalone instantiable class itself.

Comment thread sonic_platform_base/sonic_xcvr/optoe_eeprom_rw.py Outdated
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).

@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>
@bgallagher-nexthop bgallagher-nexthop force-pushed the cpo-separate-eeprom-access branch from 7436ad6 to 76b9602 Compare May 29, 2026 20:13
@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 May 29, 2026 20:40
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.

3 participants