-
Notifications
You must be signed in to change notification settings - Fork 163
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
[xcvrd] Introduce regex style keys in media_settings for setting up port configuration in xcvrd #417
Conversation
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
sonic-xcvrd/xcvrd/xcvrd.py
Outdated
|
||
for dkey, val in media_dict.items(): | ||
if re.match(dkey, key[1]): | ||
return media_dict[key[1]] |
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.
@vdahiya12 dkey = "^QSFP28+\.*10G.SR.", then the return should be media_dict["^QSFP28+\.*10G.SR."]
need to return media_dict[dkey] ?
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.
added suggestion
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
hi @keboliu @Junchao-Mellanox can you review the change ? |
hi @vdahiya12 this one more like an enhancement, what's the justification to have this into 202305? |
we should not accept this into 202305, @vdahiya12 , as we discussed, please do not backport this into 202305. |
as discussed will add in master for now |
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
orPORT_MEDIA_SETTINGS
.Motivation and Context
How Has This Been Tested?
UT and testing on a sonic-mgmt Testbed
Additional Information (Optional)