Skip to content

Add CDB support field to get_transceiver_info - #721

Open
bgallagher-nexthop wants to merge 2 commits into
sonic-net:masterfrom
nexthop-ai:add-cdb-support-field-to-get
Open

Add CDB support field to get_transceiver_info#721
bgallagher-nexthop wants to merge 2 commits into
sonic-net:masterfrom
nexthop-ai:add-cdb-support-field-to-get

Conversation

@bgallagher-nexthop

Copy link
Copy Markdown
Contributor

Description

Add a key to the dictionary returned by get_transceiver_info that indicates whether the transceiver advertises CDB support.

Motivation and Context

This change will provide the following benefits:

  • CDB support for an interface will be stored in STATE_DB (TRANSCEIVER_INFO table). CLI commands like show interface transceiver info can leverage that to conveniently display whether CDB is supported.
  • sfputil can similarly display CDB support conveniently in sfputil show eeprom.

How Has This Been Tested?

Fixed the existing unit-test to actually exercise the underlying code and extended it to cover this PR's changes.

Signed-off-by: Brian Gallagher <bgallagher@nexthop.ai>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Signed-off-by: aditya-nexthop <aditya@nexthop.ai>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@prgeor

prgeor commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

@bgallagher-nexthop can you check if this new field addition breaks any existing sonic-mgmt test? @mihirpat1 fyi

@mihirpat1

Copy link
Copy Markdown
Contributor

@bgallagher-nexthop can you check if this new field addition breaks any existing sonic-mgmt test? @mihirpat1 fyi

@pnakka28 Can we add a testcase for this new field?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 the CMIS transceiver info interface in sonic-platform-common by adding a cdb_supported key to the dictionary returned by get_transceiver_info(), enabling downstream components (e.g., STATE_DB population and CLI tooling) to surface whether a module advertises CDB support.

Changes:

  • Add cdb_supported to CMIS_XCVR_INFO_DEFAULT_DICT and include it in CmisApi.get_transceiver_info().
  • Update CMIS unit tests to more directly exercise get_transceiver_info() and validate the new field.
  • Update C-CMIS unit tests’ expected transceiver info payloads to include cdb_supported.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/sonic_xcvr/test_cmis.py Updates get_transceiver_info() unit test inputs/expectations and adds coverage for the new cdb_supported field.
tests/sonic_xcvr/test_ccmis.py Updates expected transceiver info structures to include cdb_supported.
sonic_platform_base/sonic_xcvr/api/public/cmis.py Adds cdb_supported to the default dict and returns it from get_transceiver_info().

Comment thread sonic_platform_base/sonic_xcvr/api/public/cmis.py
@bgallagher-nexthop

Copy link
Copy Markdown
Contributor Author

can you check if this new field addition breaks any existing sonic-mgmt test?

@prgeor I have opened sonic-net/sonic-mgmt#26662 to fix a sonic-mgmt test that will break due to this PR's changes

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.

6 participants