[CPO] Extend ChassisBase to support CPO ports - #700
Merged
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
bgallagher-nexthop
force-pushed
the
chassis-cpo
branch
from
June 25, 2026 22:34
af14632 to
8c32a89
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
bgallagher-nexthop
force-pushed
the
chassis-cpo
branch
from
July 1, 2026 00:47
6c9faf7 to
313e70d
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
bgallagher-nexthop
force-pushed
the
chassis-cpo
branch
from
July 1, 2026 00:49
313e70d to
29ee0ac
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
micas-net
reviewed
Jul 6, 2026
prgeor
reviewed
Jul 6, 2026
KroosMicas
reviewed
Jul 7, 2026
9 tasks
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
bgallagher-nexthop
force-pushed
the
chassis-cpo
branch
from
July 13, 2026 17:58
d69d4f8 to
6e478a4
Compare
Collaborator
|
/azp run |
Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
bgallagher-nexthop
marked this pull request as ready for review
July 28, 2026 16:56
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Natgerbi
reviewed
Jul 29, 2026
| """ | ||
| cpo = None | ||
| try: | ||
| cpo = self._cpo_list[index] |
There was a problem hiding this comment.
do we want to return an error in case the entry in specific index is "None"?
Contributor
Author
There was a problem hiding this comment.
I have copied the behaviour of get_sfp here, which is to just log an error and return None if an out-of-bounds index is used.
So for the two scenarios where an incorrect access occurs, we return None in both cases:
- index is out of bounds ->
Nonereturned - index is for a non-CPO port ->
Nonereturned
| from sonic_py_common import device_info | ||
| cpo_data = device_info.get_cpo_data() | ||
| if cpo_data: | ||
| self.construct_cpo_devices(cpo_data) |
There was a problem hiding this comment.
is the construct_cpo_devices responsible also to add the "None" for the sfps?
Contributor
Author
There was a problem hiding this comment.
Correct, the intention is that the implementation of this method should add None for any non-CPO ports
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). |
abelamit
previously approved these changes
Aug 4, 2026
prgeor
previously approved these changes
Aug 4, 2026
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>
bgallagher-nexthop
dismissed stale reviews from prgeor, abelamit, and micas-net
via
August 5, 2026 15:32
fc51057
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
prgeor
approved these changes
Aug 5, 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
The "Port Mapping for CPO" HLD proposes changes to the Chassis object for CPO hardware platforms, where a function called
construct_cpo_devicesis called when ancpo.jsonfile is present for the SONiC device. The intent is for vendors to implementconstruct_cpo_devicesand create the CPO platform API objects required for each interface on the vendor's switch.Example usage, from the HLD:
This PR adds a
construct_cpo_devicesstub function for vendors to implement and calls this function whencpo.jsonis present. It also adds function to store and retrieve CpoBase objects on a Chassis object. Additionally, it changes CPO Platform objects to inherit from DeviceBase so that they adhere to the DeviceBase interface.Note: this PR requires sonic-net/sonic-buildimage#28077 to be merged first.
Motivation and Context
This change is required to instantiate the required platform API objects (OE, ELSFP, etc) for a Chassis that models CPO hardware.
How Has This Been Tested?
Unit-tests have been added.