-
Notifications
You must be signed in to change notification settings - Fork 182
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
High power class enabling for SFF-8636 modules #521
base: master
Are you sure you want to change the base?
High power class enabling for SFF-8636 modules #521
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Commenter does not have sufficient privileges for PR 521 in repo sonic-net/sonic-platform-common |
/azpw run Azure.sonic-platform-common |
/AzurePipelines run Azure.sonic-platform-common |
Azure Pipelines successfully started running 1 pipeline(s). |
@longhuan-cisco Please help in fixing the built failure |
/azpw run Azure.sonic-platform-common |
/AzurePipelines run Azure.sonic-platform-common |
Azure Pipelines successfully started running 1 pipeline(s). |
@mihirpat1 It was due to issue in CICD infra. Issue was gone after rerun. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
power_class = int(power_class_str[prefix_len:prefix_len + 1]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The int conversion in get_power_class method does not handle potential ValueError if the substring is not a valid integer. Add a try-except block to handle the potential ValueError.
power_class = int(power_class_str[prefix_len:prefix_len + 1]) | |
try: | |
power_class = int(power_class_str[prefix_len:prefix_len + 1]) | |
except ValueError: | |
power_class = -1 |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -12,6 +12,7 @@ | |||
|
|||
class Sff8636Api(XcvrApi): | |||
NUM_CHANNELS = 4 | |||
POWER_CLASS_PREFIX = "Power Class " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@longhuan-cisco is the space at the end necessary?
@@ -637,3 +637,14 @@ def get_error_description(self): | |||
""" | |||
raise NotImplementedError | |||
|
|||
def set_high_power_class(self, enable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@longhuan-cisco Any reason for not defining this API in https://github.com/sonic-net/sonic-platform-common/blob/master/sonic_platform_base/sonic_xcvr/sfp_optoe_base.py too?
Description
Add platform common API support for enabling high power class if module's power class is greater or equal to 5 (Refer to SFF-8636 spec
6.2.6 Control Functions (Page 00h, Bytes 86-99)
for byte 93 definition)Motivation and Context
Without enabling high power class for those modules, the module won't operate properly with power output and link won't come up.
How Has This Been Tested?
Verified the module operate with proper power output.
Additional Information (Optional)