[ChassisBase] Add get_media_settings_key() override hook - #754
Open
jemston-CLS wants to merge 1 commit into
Open
[ChassisBase] Add get_media_settings_key() override hook#754jemston-CLS wants to merge 1 commit into
jemston-CLS wants to merge 1 commit into
Conversation
Add an optional get_media_settings_key(physical_port, transceiver_dict, port_speed, lane_count) hook to ChassisBase, returning None by default. Platforms may override it to derive a custom media_settings.json lookup key. The default None preserves existing behavior on all platforms. Signed-off-by: Jemston Fernando <sjemstonirudayam.fernando@celestica.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Collaborator
|
Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks! ---Powered by SONiC BuildBot
|
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.
Add an optional get_media_settings_key(physical_port, transceiver_dict, port_speed, lane_count) hook to ChassisBase, returning None by default. Platforms may override it to derive a custom media_settings.json lookup key. The default None preserves existing behavior on all platforms.
Description
Add an optional
get_media_settings_key(self, physical_port, transceiver_dict, port_speed, lane_count)method to
ChassisBase. It returnsNoneby default. Platforms may override it to derive acustom key used to look up SerDes SI settings in
media_settings.json. The four parametersmirror xcvrd's module-level media-settings key builder so a platform override is not limited
in what it can key on.
Motivation and Context
xcvrd resolves SerDes SI media settings from
media_settings.jsonusing vendor / media /medium-lane-speed keys. Some platforms need a platform-vendor-defined key that these fixed keys
cannot express. This adds a chassis-level hook so a platform can supply its own key without changing
the common resolution logic. Returning
Noneby default keeps behavior identical on everyexisting platform.
How Has This Been Tested?
Added
test_get_media_settings_keyasserting the base class returnsNone(
chassis = ChassisBase(); assert chassis.get_media_settings_key(0, {}, 100000, 4) is None).Additional Information (Optional)
This is the base hook only; the consuming change lives in sonic-platform-daemons (xcvrd) .
No platform currently overrides the hook, so no platform behavior changes as of now.