[202012][Mellanox]Fix lpmode set when logical port is larger than 64 (#14138)#14202
Merged
qiluo-msft merged 1 commit intosonic-net:202012from Mar 14, 2023
Merged
Conversation
…et#14138) - Why I did it In sfplpm API, the number of logical ports is hardcoded as 64. When a system contains more port than this, the SDK APIs would fail with a syslog as below Mar 7 03:53:58.105980 r-leopard-58 ERR syncd#SDK: [MGMT_LIB.ERR] Slot [0] Module [0] has logport [0x00010069] in enabled state Mar 7 03:53:58.105980 r-leopard-58 ERR syncd#SDK: [SDK_MGMT_LIB.ERR] Failed in __sdk_mgmt_phy_module_pwr_attr_set, error: Internal Error Mar 7 03:53:58.106118 r-leopard-58 ERR pmon#-c: Error occurred when setting power mode for SFP module 0, slot 0, error code 1 - How I did it Remove the hardcoded value of 64. Obtained the number of logical ports from SDK - How to verify it Manual testing
prgeor
approved these changes
Mar 10, 2023
Collaborator
Author
|
This PR is needed in addition to #14137. In 202012 we use plugins and in addition we have platform API. This PR fixes the platform API while previous 202012 PR fixes plugin |
github-actions bot
pushed a commit
to liushilongbuaa/sonic-buildimage
that referenced
this pull request
Aug 29, 2023
…202012 to internal-202012 Merge the commits from sonic-net/sonic-buildimage 202012 to internal-202012 Related work items: sonic-net#279, sonic-net#2666, sonic-net#2686, sonic-net#2692, sonic-net#12684, sonic-net#13803, sonic-net#13805, sonic-net#13911, sonic-net#13926, sonic-net#13930, sonic-net#13992, sonic-net#14006, sonic-net#14009, sonic-net#14012, sonic-net#14013, sonic-net#14025, sonic-net#14056, sonic-net#14066, sonic-net#14080, sonic-net#14111, sonic-net#14137, sonic-net#14138, sonic-net#14171, sonic-net#14202, sonic-net#14205, sonic-net#14220, sonic-net#14241
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.
Manual cherry-pick of #14138
In sfplpm API, the number of logical ports is hardcoded as 64. When a system contains more port than this, the SDK APIs would fail with a syslog as below
Mar 7 03:53:58.105980 r-leopard-58 ERR syncd#SDK: [MGMT_LIB.ERR] Slot [0] Module [0] has logport [0x00010069] in enabled state
Mar 7 03:53:58.105980 r-leopard-58 ERR syncd#SDK: [SDK_MGMT_LIB.ERR] Failed in __sdk_mgmt_phy_module_pwr_attr_set, error: Internal Error
Mar 7 03:53:58.106118 r-leopard-58 ERR pmon#-c: Error occurred when setting power mode for SFP module 0, slot 0, error code 1
How I did it
Remove the hardcoded value of 64. Obtained the number of logical ports from SDK
How to verify it
Manual testing
Description for the changelog
Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)