Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
JunhongMao committed Jun 11, 2024
2 parents 9995136 + 4f0fcaf commit e32c3d7
Show file tree
Hide file tree
Showing 364 changed files with 7,139 additions and 7,590 deletions.
3 changes: 1 addition & 2 deletions .azure-pipelines/build-swss-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ jobs:
path: $(Build.ArtifactStagingDirectory)/download
patterns: |
libdashapi*.deb
displayName: "Download dash api"

displayName: "Download dash api test"
- script: |
set -ex
# install libyang before install libswsscommon
Expand Down
5 changes: 3 additions & 2 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
sudo mkdir -m 755 /var/run/sswsyncd
sudo apt-get install -y rsyslog
sudo service rsyslog start
sudo rsyslogd
cat /etc/apt/sources.list
dpkg --list | grep libnl
Expand Down Expand Up @@ -167,7 +167,8 @@ jobs:
displayName: "Compile sonic sairedis with coverage enabled"
- script: |
sudo cp azsyslog.conf /etc/rsyslog.conf
sudo service rsyslog restart
sudo killall rsyslogd
sudo rsyslogd
displayName: "Update rsyslog.conf"
- ${{ if eq(parameters.run_unit_test, true) }}:
- script: |
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/test-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
# install packages for vs test
sudo apt-get install -y net-tools bridge-utils vlan
sudo apt-get install -y python3-pip
sudo pip3 install pytest==4.6.2 attrs==19.1.0 exabgp==4.0.10 distro==1.5.0 docker>=4.4.1 redis==3.3.4 flaky==3.7.0
sudo pip3 install pytest==4.6.2 attrs==19.1.0 exabgp==4.0.10 distro==1.5.0 docker>=4.4.1 redis==3.3.4 flaky==3.7.0 requests==2.31.0
displayName: "Install dependencies"
- script: |
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.so
*.pyc
*_wrap.cpp
*.bak

# Packaging Files #
###################
Expand Down Expand Up @@ -58,6 +59,10 @@ stamp-h1
python/build/
python/setup.py

lib/sai_redis.cpp
vslib/sai_vs.cpp
proxylib/sai_proxy.cpp

# Test Files #
##############
meta/test-suite.log
Expand Down Expand Up @@ -111,7 +116,11 @@ unittest/meta/tests
unittest/syncd/tests
unittest/vslib/tests
unittest/vslib/testslibsaivs
unittest/proxylib/tests
unittest/proxylib/testslibsaiproxy
vslib/tests
stub/tests
unittest/stub/stub/testslibsaistub

# Temporary files #
###################
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBDIRS = meta lib vslib pyext
SUBDIRS = meta lib vslib proxylib pyext

if SYNCD
SUBDIRS += syncd saiplayer saidump saidiscovery saisdkdump saiasiccmp tests unittest
Expand Down
2 changes: 1 addition & 1 deletion SAI
Submodule SAI updated 261 files
36 changes: 36 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,42 @@ stages:
syslog_artifact_name: sonic-sairedis.syslog.arm64
debian_version: ${{ parameters.debian_version }}

- stage: BuildBookworm
dependsOn: BuildArm
condition: succeeded('BuildArm')
jobs:
- template: .azure-pipelines/build-template.yml
parameters:
arch: amd64
sonic_slave: sonic-slave-bookworm
swss_common_artifact_name: sonic-swss-common-bookworm
artifact_name: sonic-sairedis-bookworm
syslog_artifact_name: sonic-sairedis-bookworm.syslog
run_unit_test: true
debian_version: ${{ parameters.debian_version }}

- template: .azure-pipelines/build-template.yml
parameters:
arch: armhf
timeout: 180
pool: sonicbld-armhf
sonic_slave: sonic-slave-bookworm-armhf
swss_common_artifact_name: sonic-swss-common-bookworm.armhf
artifact_name: sonic-sairedis-bookworm.armhf
syslog_artifact_name: sonic-sairedis-bookworm.syslog.armhf
debian_version: ${{ parameters.debian_version }}

- template: .azure-pipelines/build-template.yml
parameters:
arch: arm64
timeout: 180
pool: sonicbld-arm64
sonic_slave: sonic-slave-bookworm-arm64
swss_common_artifact_name: sonic-swss-common-bookworm.arm64
artifact_name: sonic-sairedis-bookworm.arm64
syslog_artifact_name: sonic-sairedis-bookworm.syslog.arm64
debian_version: ${{ parameters.debian_version }}

- stage: BuildSwss
dependsOn: Build
condition: succeeded('Build')
Expand Down
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ AC_ARG_WITH(sai,
esac])
AM_CONDITIONAL(SAIVS, test x$sai = xvs)

AC_ARG_WITH(dashsai,
[ --with-dashsai compiling against DASH SAI],
[AM_CONDITIONAL(DASHSAI, true)],
[AM_CONDITIONAL(DASHSAI, false)])

AC_ARG_WITH(swss-common-inc,
[ --with-swss-common-inc=DIR
prefix where swss-common includes are installed],
Expand Down Expand Up @@ -113,6 +118,7 @@ if test "x$asan_enabled" = "xtrue"; then
CFLAGS_ASAN+=" -fsanitize=address"
CFLAGS_ASAN+=" -DASAN_ENABLED"
CFLAGS_ASAN+=" -ggdb -fno-omit-frame-pointer -U_FORTIFY_SOURCE"
CFLAGS_ASAN+=" -Wno-maybe-uninitialized"
AC_SUBST(CFLAGS_ASAN)

LDFLAGS_ASAN+=" -lasan"
Expand Down Expand Up @@ -284,11 +290,13 @@ AC_OUTPUT(Makefile
saidiscovery/Makefile
saiasiccmp/Makefile
tests/Makefile
proxylib/Makefile
unittest/Makefile
unittest/meta/Makefile
unittest/lib/Makefile
unittest/vslib/Makefile
unittest/syncd/Makefile
unittest/proxylib/Makefile
pyext/Makefile
pyext/py2/Makefile
pyext/py3/Makefile)
5 changes: 4 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ endif
ifneq ($(filter syncd,$(DEB_BUILD_PROFILES)),)
ifneq ($(filter vs,$(DEB_BUILD_PROFILES)),)
configure_opts += --with-sai=vs
ifneq ($(filter dashsai,$(DEB_BUILD_PROFILES)),)
configure_opts += --with-dashsai
endif
endif
else
configure_opts += --disable-syncd
Expand All @@ -52,7 +55,7 @@ endif
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)

override_dh_auto_configure:
dh_auto_configure -- ${SWSS_COMMON_CONFIG} $(configure_opts)
dh_auto_configure -- ${SWSS_COMMON_CONFIG} $(configure_opts) $(DEB_CONFIGURE_EXTRA_FLAGS)

override_dh_install:
ifneq ($(filter rpc,$(DEB_BUILD_PROFILES)),)
Expand Down
60 changes: 56 additions & 4 deletions lib/ClientSai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ ClientSai::~ClientSai()

if (m_apiInitialized)
{
uninitialize();
apiUninitialize();
}
}

sai_status_t ClientSai::initialize(
sai_status_t ClientSai::apiInitialize(
_In_ uint64_t flags,
_In_ const sai_service_method_table_t *service_method_table)
{
Expand Down Expand Up @@ -91,7 +91,7 @@ sai_status_t ClientSai::initialize(
return SAI_STATUS_SUCCESS;
}

sai_status_t ClientSai::uninitialize(void)
sai_status_t ClientSai::apiUninitialize(void)
{
SWSS_LOG_ENTER();
REDIS_CHECK_API_INITIALIZED();
Expand Down Expand Up @@ -433,6 +433,26 @@ sai_status_t ClientSai::bulkSet(

SAIREDIS_DECLARE_EVERY_BULK_ENTRY(DECLARE_BULK_SET_ENTRY)

// BULK GET

#define DECLARE_BULK_GET_ENTRY(OT,ot) \
sai_status_t ClientSai::bulkGet( \
_In_ uint32_t object_count, \
_In_ const sai_ ## ot ## _t *ot, \
_In_ const uint32_t *attr_count, \
_Inout_ sai_attribute_t **attr_list, \
_In_ sai_bulk_op_error_mode_t mode, \
_Out_ sai_status_t *object_statuses) \
{ \
MUTEX(); \
SWSS_LOG_ENTER(); \
REDIS_CHECK_API_INITIALIZED(); \
SWSS_LOG_ERROR("FIXME not implemented"); \
return SAI_STATUS_NOT_IMPLEMENTED; \
}

SAIREDIS_DECLARE_EVERY_BULK_ENTRY(DECLARE_BULK_GET_ENTRY)

// QUAD API HELPERS

sai_status_t ClientSai::create(
Expand Down Expand Up @@ -814,7 +834,7 @@ sai_status_t ClientSai::waitForQueryAttributeCapabilityResponse(

// QUERY ATTRIBUTE ENUM CAPABILITY

sai_status_t ClientSai::queryAattributeEnumValuesCapability(
sai_status_t ClientSai::queryAttributeEnumValuesCapability(
_In_ sai_object_id_t switchId,
_In_ sai_object_type_t objectType,
_In_ sai_attr_id_t attrId,
Expand Down Expand Up @@ -1337,6 +1357,26 @@ sai_status_t ClientSai::bulkSet(
return waitForBulkResponse(SAI_COMMON_API_BULK_SET, (uint32_t)serialized_object_ids.size(), object_statuses);
}

// BULK GET

sai_status_t ClientSai::bulkGet(
_In_ sai_object_type_t object_type,
_In_ uint32_t object_count,
_In_ const sai_object_id_t *object_id,
_In_ const uint32_t *attr_count,
_Inout_ sai_attribute_t **attr_list,
_In_ sai_bulk_op_error_mode_t mode,
_Out_ sai_status_t *object_statuses)
{
MUTEX();
SWSS_LOG_ENTER();
REDIS_CHECK_API_INITIALIZED();

SWSS_LOG_ERROR("not implemented, FIXME");

return SAI_STATUS_NOT_IMPLEMENTED;
}

// BULK RESPONSE HELPERS

sai_status_t ClientSai::waitForBulkResponse(
Expand Down Expand Up @@ -1497,3 +1537,15 @@ sai_status_t ClientSai::logSet(

return SAI_STATUS_SUCCESS;
}

sai_status_t ClientSai::queryApiVersion(
_Out_ sai_api_version_t *version)
{
MUTEX();
SWSS_LOG_ENTER();
REDIS_CHECK_API_INITIALIZED();

SWSS_LOG_ERROR("queryApiVersion not implemented, FIXME");

return SAI_STATUS_NOT_IMPLEMENTED;
}
18 changes: 15 additions & 3 deletions lib/ClientSai.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ namespace sairedis

public:

sai_status_t initialize(
sai_status_t apiInitialize(
_In_ uint64_t flags,
_In_ const sai_service_method_table_t *service_method_table) override;

sai_status_t uninitialize(void) override;
sai_status_t apiUninitialize(void) override;

public: // SAI interface overrides

Expand Down Expand Up @@ -88,6 +88,15 @@ namespace sairedis
_In_ sai_bulk_op_error_mode_t mode,
_Out_ sai_status_t *object_statuses) override;

virtual sai_status_t bulkGet(
_In_ sai_object_type_t object_type,
_In_ uint32_t object_count,
_In_ const sai_object_id_t *object_id,
_In_ const uint32_t *attr_count,
_Inout_ sai_attribute_t **attr_list,
_In_ sai_bulk_op_error_mode_t mode,
_Out_ sai_status_t *object_statuses) override;

public: // stats API

virtual sai_status_t getStats(
Expand Down Expand Up @@ -159,7 +168,7 @@ namespace sairedis
_In_ sai_attr_id_t attr_id,
_Out_ sai_attr_capability_t *capability) override;

virtual sai_status_t queryAattributeEnumValuesCapability(
virtual sai_status_t queryAttributeEnumValuesCapability(
_In_ sai_object_id_t switch_id,
_In_ sai_object_type_t object_type,
_In_ sai_attr_id_t attr_id,
Expand All @@ -175,6 +184,9 @@ namespace sairedis
_In_ sai_api_t api,
_In_ sai_log_level_t log_level) override;

virtual sai_status_t queryApiVersion(
_Out_ sai_api_version_t *version) override;

private: // QUAD API helpers

sai_status_t create(
Expand Down
Loading

0 comments on commit e32c3d7

Please sign in to comment.