sonic-net / sonic-platform-daemons

Platform module daemons for SONiC
Other
23 stars 152 forks source link

[xcvrd] Introduce regex style keys in media_settings for setting up port configuration in xcvrd #417

Closed vdahiya12 closed 9 months ago

vdahiya12 commented 10 months ago

Description

This PR introduces a new way of specifying keys in media_settings file in a regex format. This way port settings will be applied to ports specified in GLOBAL_MEDIA_PATTERN_SETTINGS key in the media_settings.json key and whichever port vendor key matches the regex format key, they will be configured with params specified for that key. If None of the keys match, default settings if any will be applied as in GLOBAL_MEDIA_SETTINGS or PORT_MEDIA_SETTINGS.

{
    "GLOBAL_MEDIA_PATTERN_SETTINGS": {
        "1-32": {
            "^QSFP28+\\.*10G.*SR.*": {
                   "interface_type": "sr4"

            },
            "^QSFP\\+.*40G.*": {
                   "interface_type": "sr4"

            },
            "QSFP\\+.*100GBASE-LR4.*": {
                   "interface_type": "sr4"

            }

        }
    }
}

Motivation and Context

How Has This Been Tested?

UT and testing on a sonic-mgmt Testbed

Additional Information (Optional)

prgeor commented 9 months ago

@vdahiya12 please update the HLD https://github.com/sonic-net/SONiC/blob/master/doc/media-settings/Media-based-Port-settings.md

vdahiya12 commented 9 months ago

hi @keboliu @Junchao-Mellanox can you review the change ?

StormLiangMS commented 9 months ago

hi @vdahiya12 this one more like an enhancement, what's the justification to have this into 202305?

lguohan commented 9 months ago

we should not accept this into 202305, @vdahiya12 , as we discussed, please do not backport this into 202305.

vdahiya12 commented 9 months ago

as discussed will add in master for now