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

Adding support for new SAI API sai_query_attribute_capability() #645

Merged
merged 5 commits into from
Jul 22, 2020
Merged

Adding support for new SAI API sai_query_attribute_capability() #645

merged 5 commits into from
Jul 22, 2020

Conversation

gechiang
Copy link
Contributor

@gechiang gechiang commented Jul 21, 2020

This change adds the support of allowing application to invoking SAI API "sai_query_attribute_capability()" from the sonic application side.
This change has been tested using the Mellanox platform by exercising this new change to query the port object attribute SAI_PORT_ATTR_TPID

status = sai_query_attribute_capability(gSwitchId, SAI_OBJECT_TYPE_PORT, SAI_PORT_ATTR_TPID, &capability);

as well as LAG object attribute SAI_LAG_ATTR_TPID.

status = sai_query_attribute_capability(gSwitchId, SAI_OBJECT_TYPE_LAG, SAI_LAG_ATTR_TPID, &capability);

These two calls were exercised at orchagent init time in order to test out the changes are working.
I could not test this with BRCM platform due to the required SAI API "sai_query_attribute_capability()" although is defined in the SAI header file but was not part of the BRCM SAI code in 3.7.5.1 and causes link issue during build. So the final change that I am asking to check in comments out the final call to "sai_query_attribute_capability()". When BRCM SAI 4.2 (which has this SAI API support) is finally integrated into the master branch, I will have this uncommented out, tested and raise another PR to enable this full functionality.

Please see attached for the syslog and sairedis record captured during my testing using the Mellanox platform.
AttrCapabilityQueryTestLog.txt

Please note that this PR has a dependency on sonic-net/sonic-swss-common#362
If this PR is needed in other branches, one must ensure that the change for sonic-net/sonic-swss-common#362 is already picked up in that branch as well.

@gechiang gechiang requested review from kcudnik and daall July 21, 2020 16:56
@gechiang gechiang requested a review from rlhui July 21, 2020 17:43
meta/Meta.cpp Outdated Show resolved Hide resolved
syncd/Syncd.cpp Outdated Show resolved Hide resolved
vslib/src/Sai.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@kcudnik kcudnik left a comment

Choose a reason for hiding this comment

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

Please address comments

lib/inc/Recorder.h Outdated Show resolved Hide resolved
lib/inc/Recorder.h Outdated Show resolved Hide resolved
lib/inc/SaiInterface.h Outdated Show resolved Hide resolved
@rlhui
Copy link

rlhui commented Jul 21, 2020

Typo in the PR title.

@gechiang gechiang changed the title Addind support for new SAI API sai_query_attribute_capability() Adding support for new SAI API sai_query_attribute_capability() Jul 21, 2020
Copy link
Contributor

@daall daall left a comment

Choose a reason for hiding this comment

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

See comments.

lib/src/RedisRemoteSaiInterface.cpp Outdated Show resolved Hide resolved
meta/Meta.cpp Show resolved Hide resolved
syncd/VendorSai.cpp Show resolved Hide resolved
@gechiang gechiang requested review from kcudnik and daall July 21, 2020 20:42
daall
daall previously approved these changes Jul 21, 2020
Copy link
Contributor

@daall daall left a comment

Choose a reason for hiding this comment

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

LGTM

@gechiang gechiang requested review from kcudnik and daall July 22, 2020 16:25
@gechiang
Copy link
Contributor Author

Please address comments

All comments have been addressed. Please help take a look at my last change and see if anything else needs to be addressed.
Thanks!

@gechiang gechiang merged commit 4a3a568 into sonic-net:master Jul 22, 2020
gechiang added a commit to sonic-net/sonic-buildimage that referenced this pull request Jul 28, 2020
Advanced Submodule head of Sonic-Sairedis and picked up the following changes:

Workaround getSwitchType failure due to NPU SAI not yet supporting it (#647)
sonic-net/sonic-sairedis#647

Adding support for new SAI API sai_query_attribute_capability() (#645)
sonic-net/sonic-sairedis#645

[syncd] ARM32 bit fixes, for 64bit printf format specifier. (#643)  
Signed-off-by: Rajkumar Pennadam Ramamoorthy <[email protected]>
sonic-net/sonic-sairedis#643

[syncd] Add support for synchronous bulk api (#640)
sonic-net/sonic-sairedis#640
gechiang added a commit that referenced this pull request Aug 6, 2020
)

Previously the code to support query SAI attribute capabilities were commented out due to discovered missing BRCM Vendor SAI API missing in their 3.7.5.1 debian package that caused linking error during image build.
See #645 for details on the SAI attribute capability query support.

Since BRCM has provided the patch for the missing API stub code and included them in BRCM SAI 3.7.5.1-2 (see sonic-net/sonic-buildimage#5101), I am raising this PR to re-enable the calling to Vendor SAI API sai_query_attribute_capability().

I have tested this with the new BRCM SAI 3.7.5.1-2 debians and ensured that the linking issue was fixed by that patch.
pettershao-ragilenetworks pushed a commit to pettershao-ragilenetworks/sonic-sairedis that referenced this pull request Nov 18, 2022
…c-net#645)

* Addind support for new SAI API sai_query_attribute_capability()
pettershao-ragilenetworks pushed a commit to pettershao-ragilenetworks/sonic-sairedis that referenced this pull request Nov 18, 2022
…onic-net#651)

Previously the code to support query SAI attribute capabilities were commented out due to discovered missing BRCM Vendor SAI API missing in their 3.7.5.1 debian package that caused linking error during image build.
See sonic-net#645 for details on the SAI attribute capability query support.

Since BRCM has provided the patch for the missing API stub code and included them in BRCM SAI 3.7.5.1-2 (see sonic-net/sonic-buildimage#5101), I am raising this PR to re-enable the calling to Vendor SAI API sai_query_attribute_capability().

I have tested this with the new BRCM SAI 3.7.5.1-2 debians and ensured that the linking issue was fixed by that patch.
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