Skip to content

[ChassisBase] Add get_media_settings_key() override hook - #754

Open
jemston-CLS wants to merge 1 commit into
sonic-net:masterfrom
jemston-CLS:platform_media_key
Open

[ChassisBase] Add get_media_settings_key() override hook#754
jemston-CLS wants to merge 1 commit into
sonic-net:masterfrom
jemston-CLS:platform_media_key

Conversation

@jemston-CLS

Copy link
Copy Markdown

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 returns None by default. Platforms may override it to derive a
custom key used to look up SerDes SI settings in media_settings.json. The four parameters
mirror 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.json using 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 None by default keeps behavior identical on every
existing platform.

How Has This Been Tested?

Added test_get_media_settings_key asserting the base class returns None
(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.

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

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants