-
Notifications
You must be signed in to change notification settings - Fork 506
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
Add custom serdes attributes for saiport.h #2156
base: master
Are you sure you want to change the base?
Add custom serdes attributes for saiport.h #2156
Conversation
a592ded
to
9e05d9e
Compare
custom attributes are per vendor, and are not meant to be public, please remove those, and each vendor should implement its own custom attributes, please reffer to this PR: #2122 and take a look at its documentation |
cc @prgeor |
Thanks for the pointer. But the situation here is: The SAI requestor side, such as SONiC’s orchagent (which is public, platform agnostic and independently built as separate docker), might not be able to include vendor specific headers. If today's enum range |
your assumption is false, if OA will require custom headers then it will need to include them as metadata generated from headers is per vendor, so if 1st vendor will have custom attribute let say int, and 2nd vendor the same attribute as oid list, you will get crash right away. if OA want to use custom headers, it need to include them per vendor, and it needs to be compiled per vendor. Adding unnamed custom attributes make no sense, and it's unsolvable. that's why #2122 is introduced |
Signed-off-by: Longyin Huang <longhuan@cisco.com>
Signed-off-by: Longyin Huang <longhuan@cisco.com>
5ac25c6
to
b8fbbcc
Compare
In this particular case here (sai_port_serdes_attr_t), the values of SAI_PORT_SERDES_ATTR are always of type sai_s32_list_t where the count is number lanes in a port and the list specifies list of values to be applied to each lane, regardless of vendors. (I updated the diff by adding comments indicating the value type as And OA is platform agnostic, it would not be able to include any vendor specific headers. Any particular reasons to not be able to introduce dummy serdes attributes with the same value type? Is this a deviation from SAI design? Add @prgeor for comments also |
Custom range is for each vendor to use, and they are not compatoble, for public interface attributes should be added to main range. Lepsze discuss this on todays sai community meeting |
I understood the And, unlike most other types of attributes, a port serdes attribute is always inherently meant to be a list of integers (each integer represents a value for each serdes lane of the specific port), regardless of whether it's common or vendor-specific. That's why I predefined the type of all public custom serdes attributers as On the other hand, in today's SONiC, the serdes attributes are applied to SAI/SDK by OA on a per-platform basis: each platform/vendor defines its own attribute abbreviation->attribute value in
(Not sure if I'm understanding correctly) Or were you suggesting to put all the public custom serdes attributers at main range right after |
inc/saiport.h
Outdated
SAI_PORT_SERDES_ATTR_CUSTOM_RANGE_END, | ||
|
||
/** Public custom range base value */ | ||
SAI_PORT_SERDES_ATTR_PUBLIC_CUSTOM_RANGE_START = 0x20000000, |
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.
this range is reserved for DASH
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.
Changed to 0x30000000
to avoid conflict with DASH.
And will discuss more in the meeting.
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.
lets have a live discussion since i dont see point of introducing arbitrary incompatible attributes for all vendors
@kcudnik, @longhuan-cisco - do you want to discuss this in this week's SAI community meeting? |
sure, let's discuss, could you please send me (longhuan@cisco.com) the link and include @prgeor also. |
Signed-off-by: Longyin Huang <longhuan@cisco.com>
my proposal: /**
* @brief custom vendor intersface
*
* vendor have 3 attributes: custom_1, custom_2, custom_3
*
* we carete json/ini/or vendor format:
*
* std::string s1 =
* {
* "custom_1": "value1"
* }
*
*
*
* sai_attribute_t a;
* a.id = SAI_PORT_SERDES_ATTR_CUSTOM_INTERFACE;
* a.value.s32list.count = s1.lenght();
* a.value.s32list.data = s1.data()
* portserdesapi->set_port_serteds_attribute(&a); // this will set custom_1
*
*
*
* std::string s2 =
* {
* "custom_1": "value1" // string, int, bool
* "custom_2": "value2"
* }
*
* foo=bar // old ini file format
*
*
* a.value.s32list.count = s2.lenght();
* a.value.s32list.data = s2.data()
* portserdesapi->set_port_serteds_attribute(&a); // this will set custom_1 and custom_@
*
* @type sai_s32_list_t
* @flags CREATE_AND_SET
* @default internal
*/
SAI_PORT_SERDES_ATTR_CUSTOM_INTERFACE, // etc |
…ttrs Signed-off-by: Longyin Huang <longhuan@cisco.com>
Thanks @kcudnik for joining today's discussion and the proposal. BTW. Since it's your idea, just feel free to close mine, in case if you feel more comfortable to raise your own PR, |
Problem description:
Today, saiport.h and SONiC only supports 10+ NPU SI serdes attributes, but there are below situations for certain vendors/platforms:
Proposal:
(credit to @kcudnik for his idea #2156 (comment))
Add one single attribute, whose value is a string that includes a JSON object with key-value pairs. Each pair's key represents the serdes attribute name, and each pair's value is a list of values for every serdes lane. This allows vendor-specific serdes attributes to be forwarded in a JSON string without the sender needing to know the details. The sender simply passes along the data, vendor-defined rules (e.g. for SONiC, it's media_settings.json on platform side) determine which key-value pairs to include, and the vendor SDK interprets the JSON accordingly.