Skip to content

Commit

Permalink
Merge branch 'master' into fc-acl-counter
Browse files Browse the repository at this point in the history
  • Loading branch information
stepanblyschak authored Nov 8, 2021
2 parents de1ddc9 + eba6a1b commit a94a769
Show file tree
Hide file tree
Showing 170 changed files with 11,676 additions and 5,160 deletions.
23 changes: 18 additions & 5 deletions .azure-pipelines/build-swss-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ jobs:
sudo apt-get install -y libzmq5 libzmq3-dev
sudo apt-get install -qq -y \
libhiredis-dev \
libnl-3-dev \
libnl-genl-3-dev \
libnl-route-3-dev \
libnl-nf-3-dev \
swig3.0
sudo apt-get install -y libdbus-1-3
sudo apt-get install -y libteam-dev \
Expand All @@ -73,7 +69,24 @@ jobs:
inputs:
artifact: ${{ parameters.sairedis_artifact_name }}
displayName: "Download sonic sairedis deb packages"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 1
artifact: sonic-buildimage.vs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic buildimage"
- script: |
sudo dpkg -i target/debs/buster/libnl-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-3-dev_*.deb
sudo dpkg -i target/debs/buster/libnl-genl-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-genl-3-dev_*.deb
sudo dpkg -i target/debs/buster/libnl-route-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-route-3-dev_*.deb
sudo dpkg -i target/debs/buster/libnl-nf-3-200_*.deb
sudo dpkg -i target/debs/buster/libnl-nf-3-dev_*.deb
sudo dpkg -i libswsscommon_1.0.0_${{ parameters.arch }}.deb
sudo dpkg -i libswsscommon-dev_1.0.0_${{ parameters.arch }}.deb
sudo dpkg -i libsaivs_*.deb
Expand All @@ -84,7 +97,7 @@ jobs:
sudo dpkg -i libsaimetadata-dev_*.deb
sudo dpkg -i syncd-vs_*.deb
workingDirectory: $(Pipeline.Workspace)
displayName: "Install sonic swss common and sairedis"
displayName: "Install libnl3, sonic swss common, and sairedis"
- checkout: sonic-swss
path: s
submodules: true
Expand Down
43 changes: 41 additions & 2 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ parameters:
type: string
values:
- sonicbld
- sonicbld-arm64
- sonicbld-armhf
- default
default: default

Expand All @@ -33,10 +35,18 @@ parameters:
type: boolean
default: false

- name: archive_gcov
type: boolean
default: false

jobs:
- job:
displayName: ${{ parameters.arch }}
timeoutInMinutes: ${{ parameters.timeout }}
variables:
DIFF_COVER_CHECK_THRESHOLD: 50
${{ if eq(parameters.run_unit_test, true) }}:
DIFF_COVER_ENABLE: 'true'

pool:
${{ if ne(parameters.pool, 'default') }}:
Expand Down Expand Up @@ -97,20 +107,49 @@ jobs:
- checkout: self
submodules: true
- script: |
set -ex
./autogen.sh
fakeroot dpkg-buildpackage -b -us -uc -Tbinary-syncd-vs -j$(nproc) && cp ../*.deb .
displayName: "Compile sonic sairedis"
fakeroot debian/rules DEB_CONFIGURE_EXTRA_FLAGS='--enable-code-coverage' CFLAGS="" CXXFLAGS="" binary-syncd-vs && cp ../*.deb .
displayName: "Compile sonic sairedis with coverage enabled"
- script: |
sudo cp azsyslog.conf /etc/rsyslog.conf
sudo service rsyslog restart
displayName: "Update rsyslog.conf"
- ${{ if eq(parameters.run_unit_test, true) }}:
- script: |
set -ex
git clone https://github.com/Spacetown/gcovr.git
cd gcovr/
git checkout origin/recursive_search_file
sudo pip3 install setuptools
sudo python3 setup.py install
cd ..
sudo rm -rf gcovr
displayName: "Install gcovr 5.0 with recursive fix"
- script: |
set -ex
make check
gcovr --version
find SAI/meta -name "*.gc*" | xargs rm -vf
gcovr -r ./ -e ".*/SAI/.*" -e ".+/json.hpp" -e "swss/.+" -e ".*/.libs/.*" -e ".*/debian/.*" --exclude-unreachable-branches --exclude-throw-branches -x --xml-pretty -o coverage.xml
displayName: "Run sonic sairedis unit tests"
- publish: $(System.DefaultWorkingDirectory)/
artifact: ${{ parameters.artifact_name }}
displayName: "Archive sonic sairedis debian packages"
- ${{ if eq(parameters.archive_gcov, true) }}:
- script: |
set -ex
# Install .NET CORE
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/debian/10/prod
sudo apt-get update
sudo apt-get install -y dotnet-sdk-5.0
displayName: "Install .NET CORE"
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
displayName: 'Publish test coverage'
- script: |
pwd
sudo chmod a+r /var/log/syslog*
Expand Down
1 change: 1 addition & 0 deletions .azure-pipelines/build_and_install_module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function build_and_install_kmodule()
grep NET_TEAM .config.bk >> .config
echo CONFIG_NET_VRF=m >> .config
echo CONFIG_MACSEC=m >> .config
echo CONFIG_SYSTEM_REVOCATION_LIST=n >> .config
make VERSION=$VERSION PATCHLEVEL=$PATCHLEVEL SUBLEVEL=$SUBLEVEL EXTRAVERSION=-${EXTRAVERSION} LOCALVERSION=-${LOCALVERSION} modules_prepare
make M=drivers/net/team
mv drivers/net/Makefile drivers/net/Makefile.bak
Expand Down
14 changes: 10 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,25 @@ deps/
# Executables #
###############
lib/tests
vslib/tests
meta/tests
saiasiccmp/saiasiccmp
saidiscovery/saidiscovery
saidump/saidump
saiplayer/saiplayer
saisdkdump/saisdkdump
syncd/syncd
syncd/syncd_request_shutdown
tests/syncd
tests/vssyncd
saiasiccmp/saiasiccmp
tests/tests
tests/testclient
tests/tests
tests/vssyncd
unittest/lib/tests
unittest/lib/testslibsairedis
unittest/meta/tests
unittest/syncd/tests
unittest/vslib/tests
unittest/vslib/testslibsaivs
vslib/tests

# Temporary files #
###################
Expand Down
2 changes: 1 addition & 1 deletion SAI
Submodule SAI updated 77 files
+22 −0 .gitignore
+10 −11 azure-pipelines.yml
+211 −0 doc/ECMP/Class-Based-Forwarding.md
+104 −0 doc/FEC/FEC-configuration.md
+261 −0 doc/IPsec/SAI_IPsec_API_Proposal.md
+ doc/IPsec/figures/ipsecFig1.png
+ doc/IPsec/figures/ipsecFig2.png
+ doc/IPsec/figures/ipsecFig3.png
+ doc/IPsec/figures/ipsecFig4.png
+ doc/IPsec/figures/ipsecFig5.png
+ doc/IPsec/figures/ipsecFig6.png
+22 −0 doc/My-Mac.md
+479 −0 doc/SAI-IPv6-Segment-Routing-Update.md
+178 −0 doc/SAI_1.7.1_ReleaseNotes.md
+722 −0 doc/SAI_1.8.1 Release notes.md
+ doc/behavioral model/pipeline_v9.vsdx
+ doc/figures/SRv6_Endpoint_behavioral_model.png
+ doc/figures/SRv6_Headend_behavioral_model.png
+ doc/macsec-gearbox/Auto_Negotiated_FEC.png
+190 −0 doc/macsec-gearbox/Copper_PHY_Attributes_Proposal.md
+63 −0 doc/macsec-gearbox/PAI_Auto_Negotiated_FEC.md
+63 −0 doc/recycle_port.md
+1 −1 experimental/saiextensions.h
+1 −1 experimental/saiswitchextensions.h
+1 −1 experimental/saitypesextensions.h
+7 −3 inc/sai.h
+303 −291 inc/saiacl.h
+2 −2 inc/saibfd.h
+3 −6 inc/saibridge.h
+14 −0 inc/saidebugcounter.h
+34 −34 inc/saihash.h
+39 −2 inc/saihostif.h
+1 −1 inc/saiipmcgroup.h
+1,020 −0 inc/saiipsec.h
+1 −1 inc/saiisolationgroup.h
+1 −1 inc/sail2mcgroup.h
+1 −1 inc/saimirror.h
+13 −0 inc/saimpls.h
+172 −0 inc/saimymac.h
+2 −2 inc/sainat.h
+7 −75 inc/sainexthop.h
+123 −7 inc/sainexthopgroup.h
+4 −0 inc/saiobject.h
+375 −32 inc/saiport.h
+6 −0 inc/saiqosmap.h
+1 −1 inc/sairpfgroup.h
+0 −168 inc/saisegmentroute.h
+567 −0 inc/saisrv6.h
+173 −9 inc/saiswitch.h
+3 −3 inc/saitam.h
+89 −6 inc/saitunnel.h
+25 −2 inc/saitypes.h
+1 −1 inc/saiversion.h
+14 −9 meta/Makefile
+29 −17 meta/acronyms.txt
+243 −0 meta/ancestry.pl
+10 −0 meta/aspell.en.pws
+119 −0 meta/checkancestry.sh
+38 −0 meta/checkenumlock.sh
+29 −1 meta/checkheaders.pl
+372 −22 meta/parse.pl
+1 −1 meta/saidepgraphgen.cpp
+119 −6 meta/saimetadatatypes.h
+212 −84 meta/saimetadatautils.c
+27 −1 meta/saimetadatautils.h
+731 −58 meta/saisanitycheck.c
+44 −21 meta/saiserialize.c
+52 −0 meta/saiserialize.h
+76 −19 meta/saiserializetest.c
+2 −2 meta/serialize.pm
+75 −15 meta/style.pm
+213 −8 meta/utils.pm
+18 −0 meta/xmlutils.pm
+3 −1 test/Makefile
+2 −1 test/basic_router/Makefile
+2 −2 test/sai_ut/Makefile
+2 −1 test/saithrift/Makefile
9 changes: 5 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ stages:
artifact_name: sonic-sairedis
syslog_artifact_name: sonic-sairedis.syslog
run_unit_test: true
archive_gcov: true

- stage: BuildArm
dependsOn: Build
Expand All @@ -35,8 +36,8 @@ stages:
- template: .azure-pipelines/build-template.yml
parameters:
arch: armhf
timeout: 180
pool: sonicbld
timeout: 240
pool: sonicbld-armhf
sonic_slave: sonic-slave-buster-armhf
swss_common_artifact_name: sonic-swss-common.armhf
artifact_name: sonic-sairedis.armhf
Expand All @@ -45,8 +46,8 @@ stages:
- template: .azure-pipelines/build-template.yml
parameters:
arch: arm64
timeout: 180
pool: sonicbld
timeout: 240
pool: sonicbld-arm64
sonic_slave: sonic-slave-buster-arm64
swss_common_artifact_name: sonic-swss-common.arm64
artifact_name: sonic-sairedis.arm64
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ binary-syncd-vs:

override_dh_auto_configure:
./autogen.sh
dh_auto_configure -- $(shell cat /tmp/syncd-build) ${SWSS_COMMON_CONFIG}
dh_auto_configure -- $(DEB_CONFIGURE_EXTRA_FLAGS) $(shell cat /tmp/syncd-build) ${SWSS_COMMON_CONFIG}

override_dh_install:
dh_install
Expand Down
2 changes: 1 addition & 1 deletion lib/ClientConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ std::shared_ptr<ClientConfig> ClientConfig::loadFromFile(
auto cc = std::make_shared<ClientConfig>();

cc->m_zmqEndpoint = j["zmq_endpoint"];
cc->m_zmqNtfEndpoint = j["zmq_endpoint_ntf"];
cc->m_zmqNtfEndpoint = j["zmq_ntf_endpoint"];

SWSS_LOG_NOTICE("client config: %s, %s",
cc->m_zmqEndpoint.c_str(),
Expand Down
83 changes: 83 additions & 0 deletions lib/ClientSai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,16 @@ sai_status_t ClientSai::getStats(
return waitForGetStatsResponse(number_of_counters, counters);
}

sai_status_t ClientSai::queryStatsCapability(
_In_ sai_object_id_t switchId,
_In_ sai_object_type_t objectType,
_Inout_ sai_stat_capability_list_t *stats_capability)
{
SWSS_LOG_ENTER();

return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t ClientSai::waitForGetStatsResponse(
_In_ uint32_t number_of_counters,
_Out_ uint64_t *counters)
Expand Down Expand Up @@ -1179,6 +1189,38 @@ sai_status_t ClientSai::bulkCreate(
object_statuses);
}

sai_status_t ClientSai::bulkCreate(
_In_ uint32_t object_count,
_In_ const sai_my_sid_entry_t* my_sid_entry,
_In_ const uint32_t *attr_count,
_In_ const 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();

// TODO support mode

std::vector<std::string> serialized_object_ids;

// on create vid is put in db by syncd
for (uint32_t idx = 0; idx < object_count; idx++)
{
std::string str_object_id = sai_serialize_my_sid_entry(my_sid_entry[idx]);
serialized_object_ids.push_back(str_object_id);
}

return bulkCreate(
SAI_OBJECT_TYPE_MY_SID_ENTRY,
serialized_object_ids,
attr_count,
attr_list,
mode,
object_statuses);
}

// BULK CREATE HELPERS

sai_status_t ClientSai::bulkCreate(
Expand Down Expand Up @@ -1335,6 +1377,26 @@ sai_status_t ClientSai::bulkRemove(
return bulkRemove(SAI_OBJECT_TYPE_FDB_ENTRY, serializedObjectIds, mode, object_statuses);
}

sai_status_t ClientSai::bulkRemove(
_In_ uint32_t object_count,
_In_ const sai_my_sid_entry_t *my_sid_entry,
_In_ sai_bulk_op_error_mode_t mode,
_Out_ sai_status_t *object_statuses)
{
MUTEX();
SWSS_LOG_ENTER();
REDIS_CHECK_API_INITIALIZED();

std::vector<std::string> serializedObjectIds;

for (uint32_t idx = 0; idx < object_count; idx++)
{
serializedObjectIds.emplace_back(sai_serialize_my_sid_entry(my_sid_entry[idx]));
}

return bulkRemove(SAI_OBJECT_TYPE_MY_SID_ENTRY, serializedObjectIds, mode, object_statuses);
}

// BULK REMOVE HELPERS

sai_status_t ClientSai::bulkRemove(
Expand Down Expand Up @@ -1485,6 +1547,27 @@ sai_status_t ClientSai::bulkSet(
return bulkSet(SAI_OBJECT_TYPE_FDB_ENTRY, serializedObjectIds, attr_list, mode, object_statuses);
}

sai_status_t ClientSai::bulkSet(
_In_ uint32_t object_count,
_In_ const sai_my_sid_entry_t *my_sid_entry,
_In_ const 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();

std::vector<std::string> serializedObjectIds;

for (uint32_t idx = 0; idx < object_count; idx++)
{
serializedObjectIds.emplace_back(sai_serialize_my_sid_entry(my_sid_entry[idx]));
}

return bulkSet(SAI_OBJECT_TYPE_MY_SID_ENTRY, serializedObjectIds, attr_list, mode, object_statuses);
}

// BULK SET HELPERS

sai_status_t ClientSai::bulkSet(
Expand Down
5 changes: 5 additions & 0 deletions lib/ClientSai.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ namespace sairedis
_In_ const sai_stat_id_t *counter_ids,
_Out_ uint64_t *counters) override;

virtual sai_status_t queryStatsCapability(
_In_ sai_object_id_t switch_id,
_In_ sai_object_type_t object_type,
_Inout_ sai_stat_capability_list_t *stats_capability) override;

virtual sai_status_t getStatsExt(
_In_ sai_object_type_t object_type,
_In_ sai_object_id_t object_id,
Expand Down
12 changes: 12 additions & 0 deletions lib/ClientServerSai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,18 @@ sai_status_t ClientServerSai::getStats(
counters);
}

sai_status_t ClientServerSai::queryStatsCapability(
_In_ sai_object_id_t switchId,
_In_ sai_object_type_t objectType,
_Inout_ sai_stat_capability_list_t *stats_capability)
{
MUTEX();
SWSS_LOG_ENTER();
REDIS_CHECK_API_INITIALIZED();

return SAI_STATUS_NOT_IMPLEMENTED;
}

sai_status_t ClientServerSai::getStatsExt(
_In_ sai_object_type_t object_type,
_In_ sai_object_id_t object_id,
Expand Down
5 changes: 5 additions & 0 deletions lib/ClientServerSai.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ namespace sairedis
_In_ const sai_stat_id_t *counter_ids,
_Out_ uint64_t *counters) override;

virtual sai_status_t queryStatsCapability(
_In_ sai_object_id_t switch_id,
_In_ sai_object_type_t object_type,
_Inout_ sai_stat_capability_list_t *stats_capability) override;

virtual sai_status_t getStatsExt(
_In_ sai_object_type_t object_type,
_In_ sai_object_id_t object_id,
Expand Down
6 changes: 4 additions & 2 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ libsairedis_la_SOURCES = \
sai_redis_samplepacket.cpp \
sai_redis_scheduler.cpp \
sai_redis_schedulergroup.cpp \
sai_redis_segmentroute.cpp \
sai_redis_srv6.cpp \
sai_redis_stp.cpp \
sai_redis_switch.cpp \
sai_redis_system_port.cpp \
Expand All @@ -74,7 +74,9 @@ libsairedis_la_SOURCES = \
sai_redis_udf.cpp \
sai_redis_virtual_router.cpp \
sai_redis_vlan.cpp \
sai_redis_wred.cpp
sai_redis_wred.cpp \
sai_redis_ipsec.cpp \
sai_redis_my_mac.cpp

libSaiRedis_a_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
libSaiRedis_a_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) $(CODE_COVERAGE_CXXFLAGS)
Expand Down
Loading

0 comments on commit a94a769

Please sign in to comment.