-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Mellanox] Update the sfp platform API to get the ext_specification_compliance with new way #5123
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
Is it possible to move this constant to the sonic_sfp package in sonic-platform-common, and have it tied to a specific parser, rather than having each vendor specify it? This would allow us to keep all of this data in the "bulk info" and would prevent future issues if we decide to parse more fields as part of the bulk info. We could also specify the offsets as constants as well, so that the vendor can reference them by name rather than using unnamed integers. What do you think of this proposal?
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.
it doable, but not sure whether it's applicable to other vendors? I didn't deep dive into it but it seems to me that some vendors implemented it in a quite different way, like DELL.
And for the OFFSET, in Mellanox implementation, is not the absolute OFFSET starting from the beginning of the eeprom, it's a relative one for the implementation convenience.
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.
Yes, this is something I would like to avoid, and I feel that maybe defining these constants in the sonic_sfp package might prevent this, as all vendors would use the same constants.
Understood. If we define all of this in the sonic_sfp package, we would just have to make it clear. But the offsets should be fixed, not vendor specific, so I feel like these definitions belong as part of the sonic_sfp library itself.
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.
let me clarify, the current implementation is like this: in the vendor's implementation of the platform APIs, it read out the raw data from the EEPROM(with the given offset and width which defined by the constants we are talking about), and then feed the raw data to the parser functions defined in the common functions. So the idea is to move the definition of the offset and width to the platform common and when vendors read the EEPROM they should use the offset and width
constants defined in the platform common.
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.
This is along the lines of what I was thinking. As long as the offsets are only dependent on the SFP type, and are not vendor/platform-specific, we should abstract away the implementation as much as possible. We can take these changes for now to fix other vendors' implementations, and we can discuss this further offline.