Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create is_transceiver_vdm_supported API for CMIS transceivers #527

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

mihirpat1
Copy link
Contributor

@mihirpat1 mihirpat1 commented Jan 3, 2025

Description

is_transceiver_vdm_supported API needs to be created so that xcvrd can directly skip freezing/unfreezing of VDM stats (done to read VDM and PM data from the transceiver) for transceivers which do not support VDM feature.

Motivation and Context

XCVRD will call is_transceiver_vdm_supported API before performing freeze of VDM stats.

How Has This Been Tested?

Following types of modules were tested with this changeset

  1. CMIS module supporting VDM - ensured is_transceiver_vdm_supported returns True
  2. SFF-8472 module - ensured is_transceiver_vdm_supported returns False

Additional Information (Optional)

MSFT ADO - 30657693

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mihirpat1 mihirpat1 requested a review from prgeor January 3, 2025 19:56
@mihirpat1 mihirpat1 added the CMIS label Jan 3, 2025
@mihirpat1 mihirpat1 marked this pull request as ready for review January 3, 2025 19:56
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -55,6 +55,10 @@ def is_coherent_module(self):
api = self.get_xcvr_api()
return api.is_coherent_module() if api is not None else None

def is_transceiver_vdm_supported(self):
api = self.get_xcvr_api()
return api.is_transceiver_vdm_supported() if api is not None else None
Copy link
Collaborator

Choose a reason for hiding this comment

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

return False on falure? @mihirpat1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@prgeor I am currently returning None because the caller (xcvrd in this case) treats None as False and will not perform VDM-related operations. This approach ensures that the current behavior remains unchanged. Additionally, if in the future the caller needs to differentiate between False (explicitly not supported) and None (indeterminate or error state), the current implementation will allow for this distinction without requiring changes to the existing implementation.

@prgeor prgeor merged commit cb5564c into sonic-net:master Jan 30, 2025
5 checks passed
@prgeor
Copy link
Collaborator

prgeor commented Jan 30, 2025

@mihirpat1 we need in 202412 branch

@mihirpat1
Copy link
Contributor Author

@kperumalbfn Can you please help to cherry-pick this to 202411 branch?
@r12f Can you please help to cherry-pick this to 202412 branch?

MSFT ADO - 30657693

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202411: #537

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

Successfully merging this pull request may close these issues.

4 participants