Merged
Conversation
Signed-off-by: Prince George <[email protected]>
Collaborator
Author
|
@lguohan @andywongarista can you review? |
4 tasks
vdahiya12
approved these changes
Aug 26, 2021
Contributor
|
@prgeor do we need to merge this in other branches ? |
lguohan
approved these changes
Aug 26, 2021
Contributor
|
LGTM. |
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.
Signed-off-by: Prince George [email protected]
Description
SFP index on some platforms can start from non-zero index. Updated the comment to reflect the same.
Handle non existing SFP indices in chassis's _sfp_list[]
Motivation and Context
Updated the comment to avoid any confusion in future.
Platform can have 'None' for invalid SFP index in chassis's _sfp_list[], so handle the same in get_all_sfps() to return only valid SFP objects. With this change, platform need not override ChassisBase's get_all_sfp() and get_sfp() to handle case where SFP index starts from 1. This change can handle a case where the platform has "holes" in indices, for eg:-
valid port indices :1, 3, 5, 7
_sfp_list = [None, Sfp1, None, Sfp3, None, Sfp5, None, Sfp7]
get_all_sfps() = [Sfp1, Sfp3, Sfp5, Sfp7]
get_sfp() - There is now 1:1 mapping between the sfp_list[] index and port index
How Has This Been Tested?
Run SFP test in test_chassis.py
Additional Information (Optional)