sonic-net / sonic-sairedis

SAI object interface to Redis database, as used in the SONiC project
Other
56 stars 265 forks source link

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

Closed kcudnik closed 1 year ago

kcudnik commented 1 year ago

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

vaibhavhd commented 1 year ago

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

kcudnik commented 1 year ago

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

it adds this commit in SAI: https://github.com/opencomputeproject/SAI/commit/ad12e9eac34996501691d7a159391e25d4353c46

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

liushilongbuaa commented 1 year ago

@kcudnik ,https://github.com/sonic-net/sonic-buildimage/pull/16168 The submodule update PR always failed on braodcom/barefoot/mellanox build. Please check.

liushilongbuaa commented 1 year ago

https://dev.azure.com/mssonic/build/_build/results?buildId=343938&view=results

kcudnik commented 1 year ago

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: https://github.com/sonic-net/sonic-sairedis/pull/1278

kcudnik commented 1 year ago

already merged, please update sairedis submodule on https://github.com/sonic-net/sonic-buildimage/pull/16168 to help integrate the fix

liushilongbuaa commented 1 year ago

@kcudnik , https://dev.azure.com/mssonic/build/_build/results?buildId=354040&view=logs&j=712a2a98-2630-52ac-ed49-4850e5af4e10&t=b2c30a30-98c5-58f9-7d50-fefbf2c245dc Still has errors.

kcudnik commented 1 year ago

@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