Skip to content
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

[meta][sai] Move extensions SAI and API to 0x20000000 range #2028

Merged
merged 11 commits into from
Jul 14, 2024

Conversation

kcudnik
Copy link
Collaborator

@kcudnik kcudnik commented Jun 6, 2024

To make this binary backward compatible for extension enums, instead of starting form _ATTR_END and prevent enum shift each time new attribute is added

Update saisanitycheck to not use object type as index

Since we will move object type extensions to separate range we will need to update many shortcuts taken by saisanitycheck
when it was using object type as index to fast access arrays

NOTE: this will break current logic in sonic-saireids lib and vslib oid managers, also in https://github.com/sonic-net/DASH/blob/main/dash-pipeline/SAI/src/objectidmanager.cpp, since object type with extensions will not possible to encode on a single byte. Corresponding PR fixes will be made to mitigate this issue.

kcudnik added 3 commits June 6, 2024 17:42
To make this binary backward comparible for extension enums, instead of
starting form _ATTR_END and prevent enum shift each time new attribute
is added
Since we will move object type extensions to separate range
we will need to update many shorcuts taken by sisanitych check
when it was using obejct type as index to fast access arrays
@kcudnik kcudnik requested a review from rlhui June 6, 2024 21:51
@kcudnik
Copy link
Collaborator Author

kcudnik commented Jun 7, 2024

@marian-pritsak please take a look

@kcudnik kcudnik requested a review from lguohan June 9, 2024 14:54
@kcudnik
Copy link
Collaborator Author

kcudnik commented Jun 9, 2024

This commit will be require to update sonic-sairedis repo with this commit: sonic-net/sonic-sairedis#1390

@kcudnik
Copy link
Collaborator Author

kcudnik commented Jun 13, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@rck-innovium rck-innovium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The summary of the SAI discussion was :

  1. Custom range is to be used for attributes/enums/stats for vendor specific attrs
  2. The newly added extensions' base is to be used for attributes/enums/stats to be defined in experimental directory (for experimental features)
  3. Extensions base is added to switch and port since they are the only ones used in SAI extensions. Extensions based will be added to other objects when they are needed.

kcudnik added a commit to kcudnik/DASH that referenced this pull request Jun 13, 2024
Update OID format to support new extensions range base
More info in PR: opencomputeproject/SAI#2028
@kcudnik
Copy link
Collaborator Author

kcudnik commented Jun 13, 2024

NOTE: sai backward compatibility for enums is not checked in experimental directory due the dash api are changing often, we could enable backward compatibility check for specific apis/types, let me know

r12f pushed a commit to sonic-net/DASH that referenced this pull request Jun 14, 2024
Update OID format to support new extensions range base More info in PR: opencomputeproject/SAI#2028
@@ -302,11 +302,7 @@ typedef enum _sai_object_type_t
/** Must remain in last position */
SAI_OBJECT_TYPE_MAX,

/** Custom range base value */
SAI_OBJECT_TYPE_CUSTOM_RANGE_START = 256,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi Kamil, just found that these attributes are removed. do we need to keep them but maybe with a different value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currenty those are not needed, and they were added to fix gcc error, do a git blame and find commit for that change, if we want to add those back, then they need to start as custom range for other enums 0x10000000

@r12f
Copy link
Contributor

r12f commented Jun 23, 2024

NOTE: sai backward compatibility for enums is not checked in experimental directory due the dash api are changing often, we could enable backward compatibility check for specific apis/types, let me know

yea, I believe this is ok. maybe some day what we need to do it to move dash outside of the experiment folder but into another folder maybe called extension

@kcudnik
Copy link
Collaborator Author

kcudnik commented Jul 7, 2024

Please check in this change if there is no conflicts and approved @rlhui @lguohan

@kcudnik
Copy link
Collaborator Author

kcudnik commented Jul 14, 2024

Ping

@rlhui rlhui merged commit d15eca7 into opencomputeproject:master Jul 14, 2024
3 checks passed
@kcudnik kcudnik deleted the ext branch July 16, 2024 04:35
siqbal1986 pushed a commit to siqbal1986/SAI that referenced this pull request Sep 30, 2024
…uteproject#2028)

* [meta][sai] Move extensions SAI and API to 0x20000000 range

To make this binary backward comparible for extension enums, instead of
starting form _ATTR_END and prevent enum shift each time new attribute
is added

* [meta] Update saisanitycheck to not use object type as index

Since we will move object type extensions to separate range
we will need to update many shorcuts taken by sisanitych check
when it was using obejct type as index to fast access arrays

Signed-off-by: siqbal1986 <[email protected]>
kcudnik pushed a commit that referenced this pull request Nov 6, 2024
Fixed the RPC build failure in sonic-net/sonic-buildimage#20322. The PR #2028 introduced some SAI header file changes and Since Vendor (ex BCM) SAI header files do not have these changes and also the sai-thrift includes the sai header files installed from Vendor SAI debian package, the saithrift build fails.
This PR modifies the sai-thrift make to include the SAI header files from sai-redis SAI/inc folder instead of the SAI headers installed from Vendor SAI debian package.

Signed-off-by: saksarav <[email protected]>
erohsik pushed a commit to erohsik/SAI that referenced this pull request Nov 7, 2024
…uteproject#2028)

* [meta][sai] Move extensions SAI and API to 0x20000000 range

To make this binary backward comparible for extension enums, instead of
starting form _ATTR_END and prevent enum shift each time new attribute
is added

* [meta] Update saisanitycheck to not use object type as index

Since we will move object type extensions to separate range
we will need to update many shorcuts taken by sisanitych check
when it was using obejct type as index to fast access arrays
srj102 pushed a commit to JaiOCP/SAI that referenced this pull request Nov 7, 2024
Fixed the RPC build failure in sonic-net/sonic-buildimage#20322. The PR opencomputeproject#2028 introduced some SAI header file changes and Since Vendor (ex BCM) SAI header files do not have these changes and also the sai-thrift includes the sai header files installed from Vendor SAI debian package, the saithrift build fails.
This PR modifies the sai-thrift make to include the SAI header files from sai-redis SAI/inc folder instead of the SAI headers installed from Vendor SAI debian package.

Signed-off-by: saksarav <[email protected]>
@kcudnik
Copy link
Collaborator Author

kcudnik commented Nov 9, 2024

i decribed issue on the on the github comment:
sonic-net/sonic-buildimage#20725 (comment)

and yes, if if DASH is implemented in the SAI lib, on older version thatn v1.15.0 then it's before enums DASH shifted, so if we use v1.15.0 headers with v1.14.0 libsai, then new port attributes will overlay DASH extensions, and return output will not match the attribute type

i proposed solution for that to update metadata for each attribute with specific attribute version when it was introduced, so comparing version with libsai will prevent that

of course for dash attributes, currently syncd is not using that, but that enum shift to range 0x20000000 is not backward compatible, so there is no easy fix for that, also syncd is not doing discovery on experimental headers, and since they can change any time, then there is no point to assign version to those attributes

tjchadaga pushed a commit that referenced this pull request Nov 14, 2024
Fixed the RPC build failure in sonic-net/sonic-buildimage#20322. The PR #2028 introduced some SAI header file changes and Since Vendor (ex BCM) SAI header files do not have these changes and also the sai-thrift includes the sai header files installed from Vendor SAI debian package, the saithrift build fails.
This PR modifies the sai-thrift make to include the SAI header files from sai-redis SAI/inc folder instead of the SAI headers installed from Vendor SAI debian package.

Signed-off-by: saksarav <[email protected]>
kcudnik pushed a commit to kcudnik/SAI that referenced this pull request Nov 18, 2024
Fixed the RPC build failure in sonic-net/sonic-buildimage#20322. The PR opencomputeproject#2028 introduced some SAI header file changes and Since Vendor (ex BCM) SAI header files do not have these changes and also the sai-thrift includes the sai header files installed from Vendor SAI debian package, the saithrift build fails.
This PR modifies the sai-thrift make to include the SAI header files from sai-redis SAI/inc folder instead of the SAI headers installed from Vendor SAI debian package.

Signed-off-by: saksarav <[email protected]>
kcudnik pushed a commit to kcudnik/SAI that referenced this pull request Nov 18, 2024
Fixed the RPC build failure in sonic-net/sonic-buildimage#20322. The PR opencomputeproject#2028 introduced some SAI header file changes and Since Vendor (ex BCM) SAI header files do not have these changes and also the sai-thrift includes the sai header files installed from Vendor SAI debian package, the saithrift build fails.
This PR modifies the sai-thrift make to include the SAI header files from sai-redis SAI/inc folder instead of the SAI headers installed from Vendor SAI debian package.

Signed-off-by: saksarav <[email protected]>
kcudnik added a commit that referenced this pull request Nov 18, 2024
Fixed the RPC build failure in sonic-net/sonic-buildimage#20322. The PR #2028 introduced some SAI header file changes and Since Vendor (ex BCM) SAI header files do not have these changes and also the sai-thrift includes the sai header files installed from Vendor SAI debian package, the saithrift build fails.
This PR modifies the sai-thrift make to include the SAI header files from sai-redis SAI/inc folder instead of the SAI headers installed from Vendor SAI debian package.

Signed-off-by: saksarav <[email protected]>
Co-authored-by: saksarav-nokia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants