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

[submodule] Update SAI to latest v1.12 branch #1272

Merged
merged 6 commits into from
Aug 15, 2023
Merged

Conversation

kcudnik
Copy link
Collaborator

@kcudnik kcudnik commented Aug 8, 2023

Also update VendorSai class to use latest generic api from SAI metadata.

Since latest SAI uses version v1.12 on master branch, force require sai_query_api_version to be present at all SAI libs

@kcudnik kcudnik requested a review from lguohan August 8, 2023 13:48
@kcudnik kcudnik requested a review from vaibhavhd August 9, 2023 07:17
@vaibhavhd
Copy link
Contributor

Please address merge conflicts. How can I know what new features/fixes come w/ new SAI?

@kcudnik
Copy link
Collaborator Author

kcudnik commented Aug 9, 2023

Please address merge conflicts. How can I know what new features/fixes come w/ new SAI?

it adds this commit in SAI:
opencomputeproject/SAI@ad12e9e

and VendorSai.cpp starts using generated metadata API structure and generic functions to execute common tasks, take a look at file changes

@@ -24,6 +24,40 @@ VendorSai::VendorSai()
m_apiInitialized = false;

memset(&m_apis, 0, sizeof(m_apis));

sai_global_apis_t ga =
Copy link
Collaborator Author

@kcudnik kcudnik Aug 9, 2023

Choose a reason for hiding this comment

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

from now on, we keep sai global api pointers in a metadata generated structs, this will be handy when we will want to load dynamically another vendor libsai.so into memory

@kcudnik kcudnik merged commit ee308bb into sonic-net:master Aug 15, 2023
@kcudnik kcudnik deleted the apiver branch August 15, 2023 16:32
@liushilongbuaa
Copy link
Contributor

@kcudnik ,sonic-net/sonic-buildimage#16168
The submodule update PR always failed on braodcom/barefoot/mellanox build.
Please check.

@liushilongbuaa
Copy link
Contributor

@kcudnik
Copy link
Collaborator Author

kcudnik commented Aug 23, 2023

for mellanox and broadcom the same error happens:

VendorSai.cpp: In constructor 'syncd::VendorSai::VendorSai()':
VendorSai.cpp:44:10: error: request for member 'dbg_generate_dump' in 'sai_bulk_object_get_stats', which is of non-class type 'sai_status_t(sai_object_id_t, sai_object_type_t, uint32_t, const sai_object_key_t*, uint32_t, const sai_stat_id_t*, sai_stats_mode_t, sai_status_t*, uint64_t*)' {aka 'int(long unsigned int, _sai_object_type_t, unsigned int, const _sai_object_key_t*, unsigned int, const unsigned int*, _sai_stats_mode_t, int*, long unsigned int*)'}
   44 |         .dbg_generate_dump = nullptr,
      |          ^~~~~~~~~~~~~~~~~

which build is for barefoot ?

btw. i found the issue, fixe is here: #1278

@kcudnik
Copy link
Collaborator Author

kcudnik commented Aug 23, 2023

already merged, please update sairedis submodule on sonic-net/sonic-buildimage#16168 to help integrate the fix

@kcudnik
Copy link
Collaborator Author

kcudnik commented Sep 5, 2023

@liushilongbuaa this is the issue:

checking whether CXX supports -Wno-cast-function-type... yes
checking for sai_query_api_version... no
configure: error: "SAI library libsai.so does not have sai_query_api_version API which is required"
	tail -v -n \+0 config.log
==> config.log <==
This file contains any messages produced by compilers while

libsai which is build with that image does not implement sai_query_api_version, in this PR i enabled required field for that sai library method saiversion.h header was introduced in in version v1.9.0 in this commit 0b929737 which was on Feb 2022, that SAI library used in that build should already implement that API, lets contact marverll to update library with that api, it's 5min change, implementation looks like this: https://github.com/sonic-net/sonic-sairedis/blob/master/vslib/sai_vs_interfacequery.cpp#L208

sai_status_t sai_query_api_version(
        _Out_ sai_api_version_t *version)
{
    *version = SAI_API_VERSION;
    return SAI_STATUS_SUCCESS;
}

@lguohan fyi

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