-
Notifications
You must be signed in to change notification settings - Fork 194
Add support for custom serdes attributes #643
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
base: master
Are you sure you want to change the base?
Add support for custom serdes attributes #643
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@prgeor @mihirpat1 could you please review, thanks |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Pull Request Overview
This PR adds support for custom SerDes attributes in the media settings parser, allowing custom attributes to be defined in media_settings.json with a CUSTOM:
prefix and converted to JSON format for consumption by the SAI layer.
- Introduces parsing logic for custom SerDes attributes prefixed with
CUSTOM:
- Adds conversion functions to handle hex/int string values and convert them to signed integers
- Implements JSON serialization of custom attributes for database storage
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py | Adds custom SerDes attribute parsing logic, helper functions for string-to-int conversion, and integration into the media setting notification flow |
sonic-xcvrd/tests/test_xcvrd.py | Adds unit tests for the custom SerDes attribute handling functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
sonic-swss side change: sonic-net/sonic-swss#3764
Description
Add support for custom serdes attrs SAI_PORT_SERDES_ATTR_CUSTOM_COLLECTION
In media_settings.json, custom attributes can be defined by using
CUSTOM:
as prefix, and existing parsing logic/format will be reused.Example media_settings.json snippet
Motivation and Context
How Has This Been Tested?
Tested end-to-end xcvrd->OA->SAI/SDK on 8-hostlanes optics with both non-breakout and breakout modes.
Additional Information (Optional)