Skip to content

Commit e6df0f5

Browse files
authored
Merge branch 'master' into vrrp_orch
2 parents 7d77274 + 72eafd9 commit e6df0f5

195 files changed

Lines changed: 20677 additions & 1786 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.azure-pipelines/build-docker-sonic-vs-template.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ parameters:
2121
type: string
2222
default: '$(BUILD_BRANCH)'
2323

24+
- name: debian_version
25+
type: string
26+
2427
- name: artifact_name
2528
type: string
2629

@@ -132,6 +135,29 @@ jobs:
132135
path: $(Build.ArtifactStagingDirectory)/download
133136
patterns: '**/target/${{ parameters.artifact_name }}.gz'
134137
displayName: "Download sonic-buildimage ${{ parameters.artifact_name }}"
138+
- task: DownloadPipelineArtifact@2
139+
inputs:
140+
source: specific
141+
project: ${{ parameters.buildimage_artifact_project }}
142+
pipeline: ${{ parameters.buildimage_artifact_pipeline }}
143+
artifact: ${{ parameters.buildimage_artifact_name }}
144+
runVersion: 'latestFromBranch'
145+
runBranch: 'refs/heads/${{ parameters.buildimage_artifact_branch }}'
146+
path: $(Build.ArtifactStagingDirectory)/download
147+
patterns: '**/target/debs/${{ parameters.debian_version }}/framework_*.deb'
148+
displayName: "Download sonic-buildimage sonic-framework package"
149+
- task: DownloadPipelineArtifact@2
150+
inputs:
151+
source: specific
152+
project: build
153+
pipeline: sonic-net.sonic-platform-vpp
154+
artifact: vpp
155+
runVersion: 'latestFromBranch'
156+
runBranch: 'refs/heads/main'
157+
allowPartiallySucceededBuilds: true
158+
path: $(Build.ArtifactStagingDirectory)/download
159+
displayName: "Download sonic platform-vpp deb packages"
160+
condition: eq('${{ parameters.arch }}', 'amd64')
135161
- script: |
136162
set -ex
137163
echo $(Build.DefinitionName).$(Build.BuildNumber)
@@ -148,6 +174,7 @@ jobs:
148174
fi
149175
150176
pushd .azure-pipelines
177+
ls -l docker-sonic-vs/debs
151178
152179
build_dir=$(grep BUILD_DIR $(Build.ArtifactStagingDirectory)/download/build.info | cut -d= -f2)
153180
build_args="--build-arg build_dir=$build_dir"

.azure-pipelines/build-template.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,45 @@ jobs:
179179
set -ex
180180
cd download
181181
sudo dpkg -i $(find common -type f -name '*.deb')
182+
cd ..
183+
workingDirectory: $(Build.ArtifactStagingDirectory)
184+
displayName: "Install libnl3"
185+
- task: DownloadPipelineArtifact@2
186+
inputs:
187+
source: specific
188+
project: build
189+
pipeline: sonic-net.sonic-platform-vpp
190+
artifact: vpp
191+
runVersion: 'latestFromBranch'
192+
runBranch: 'refs/heads/main'
193+
allowPartiallySucceededBuilds: true
194+
path: $(Build.ArtifactStagingDirectory)/download
195+
displayName: "Download sonic platform-vpp deb packages"
196+
condition: eq('${{ parameters.arch }}', 'amd64')
197+
- script: |
198+
set -ex
199+
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/libvppinfra-dev_*_${{ parameters.arch }}.deb
200+
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/libvppinfra_*_${{ parameters.arch }}.deb
201+
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp_*_${{ parameters.arch }}.deb
202+
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp-crypto-engines_*_${{ parameters.arch }}.deb
203+
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp-dbg_*_${{ parameters.arch }}.deb
204+
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp-dev_*_${{ parameters.arch }}.deb
205+
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp-plugin-core_*_${{ parameters.arch }}.deb
206+
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp-plugin-devtools_*_${{ parameters.arch }}.deb
207+
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp-plugin-dpdk_*_${{ parameters.arch }}.deb
208+
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/python3-vpp-api_*_${{ parameters.arch }}.deb
209+
workingDirectory: $(Build.ArtifactStagingDirectory)
210+
displayName: "Install sonic platform-vpp packages"
211+
condition: eq('${{ parameters.arch }}', 'amd64')
212+
- script: |
213+
set -ex
214+
cd download
182215
sudo dpkg -i $(find swsscommon -type f -name '*.deb')
183216
sudo dpkg -i $(find sairedis -type f -name '*.deb')
184217
cd ..
185218
rm -rf download
186219
workingDirectory: $(Build.ArtifactStagingDirectory)
187-
displayName: "Install libnl3, sonic swss common and sairedis"
220+
displayName: "Install sonic swss common and sairedis"
188221
- script: |
189222
set -ex
190223
tar czf pytest.tgz tests

.azure-pipelines/docker-sonic-vs/Dockerfile

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,34 @@ ENV BUILD_DIR=$build_dir
77

88
COPY ["debs", "/debs"]
99

10-
# Remove existing packages first before installing the new/current packages. This is to overcome limitations with
10+
# Remove the libswsscommon package first with force all option.
11+
# Remove the other existing packages before installing the new/current packages. This is to overcome limitations with
1112
# Docker's diff detection mechanism, where only the file size and the modification timestamp (which will remain the
1213
# same, even though contents have changed) are checked between the previous and current layer.
13-
RUN dpkg --purge libswsscommon python3-swsscommon sonic-db-cli libsaimetadata libsairedis libsaivs syncd-vs swss sonic-eventd libdashapi
14+
RUN dpkg --remove --force-all libswsscommon
15+
RUN apt --fix-broken install -y
16+
RUN dpkg --purge python3-swsscommon sonic-db-cli libsaimetadata libsairedis libsaivs syncd-vs swss sonic-eventd libdashapi framework
1417

1518
RUN apt-get update
1619

20+
# vpp package configure requires to set:
21+
# permission denied on key "vm.nr_hugepages"
22+
# permission denied on key "vm.hugetlb_shm_group"
23+
# permission denied on key "fs.protected_fifos"
24+
# permission denied on key "fs.protected_hardlinks"
25+
# permission denied on key "fs.protected_regular"
26+
# permission denied on key "fs.protected_symlinks"
27+
28+
# which can't be done during "docker build" command
29+
# so let's put "true" command as sysctl, and after install let's bring it back
30+
31+
RUN cp /usr/sbin/sysctl /usr/sbin/sysctl.org
32+
RUN cp /usr/bin/true /usr/sbin/sysctl
33+
34+
RUN apt install -y $(ls /debs/*.deb | grep vpp)
35+
36+
RUN mv /usr/sbin/sysctl.org /usr/sbin/sysctl
37+
1738
RUN apt install -y /debs/libdashapi_1.0.0_amd64.deb \
1839
/debs/libswsscommon_1.0.0_amd64.deb \
1940
/debs/python3-swsscommon_1.0.0_amd64.deb \

.azure-pipelines/docker-sonic-vs/start.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ elif [ "$HWSKU" == "DPU-2P" ]; then
7575
cp /usr/share/sonic/hwsku/sai_dpu_2p.profile /usr/share/sonic/hwsku/sai.profile
7676
fi
7777

78+
if [ "$BFDOFFLOAD" == "false" ]; then
79+
if ! grep -q "SAI_VS_BFD_OFFLOAD_SUPPORTED=" /usr/share/sonic/hwsku/sai.profile; then
80+
echo 'SAI_VS_BFD_OFFLOAD_SUPPORTED=false' >> /usr/share/sonic/hwsku/sai.profile
81+
else
82+
sed -i "s/SAI_VS_BFD_OFFLOAD_SUPPORTED.*/SAI_VS_BFD_OFFLOAD_SUPPORTED=false/g" /usr/share/sonic/hwsku/sai.profile
83+
fi
84+
fi
85+
7886
mkdir -p /etc/swss/config.d/
7987

8088
rm -f /var/run/rsyslogd.pid

.github/CODEOWNERS

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@
2020
/cfgmgr/teammgr* @judyjoseph
2121

2222
# Buffer Management, PFC
23-
/orchagent/bufferorch* @neethajohn
24-
/orchagent/qosorch* @neethajohn
25-
/orchagent/pfc* @neethajohn
26-
/cfgmgr/buffer* @neethajohn
23+
/orchagent/bufferorch* @kperumalbfn
24+
/orchagent/qosorch* @kperumalbfn
25+
/orchagent/pfc* @kperumalbfn
26+
/cfgmgr/buffer* @kperumalbfn
2727

2828
# Chassis
2929
/orchagent/fabricportsorch* @abdosi @judyjoseph
3030
/tests/test_virtual_chassis.py @abdosi @judyjoseph
3131

32-
# Vnet Orch
33-
/orchagent/vnet* @siqbal1986
32+
# Mux Orch
33+
/orchagent/mux* @Ndancejic
3434

3535
# Acl Orch
36-
/orchagent/acl* @siqbal1986
36+
/orchagent/acl* @bingwang-ms
3737

.github/workflows/codeql-analysis.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,21 @@ jobs:
127127
git config --local --unset user.name
128128
git config --local --unset user.email
129129
ln -s ../debian debian
130-
dpkg-buildpackage -rfakeroot -us -uc -b -j$(nproc)
130+
DPKG_GENSYMBOLS_CHECK_LEVEL=0 dpkg-buildpackage -rfakeroot -us -uc -b -j$(nproc)
131131
popd
132-
dpkg-deb -x libnl-3-200_${LIBNL3_VER}-${LIBNL3_REV}_amd64.deb $(dirname $GITHUB_WORKSPACE)
133-
dpkg-deb -x libnl-3-dev_${LIBNL3_VER}-${LIBNL3_REV}_amd64.deb $(dirname $GITHUB_WORKSPACE)
134-
dpkg-deb -x libnl-genl-3-200_${LIBNL3_VER}-${LIBNL3_REV}_amd64.deb $(dirname $GITHUB_WORKSPACE)
135-
dpkg-deb -x libnl-genl-3-dev_${LIBNL3_VER}-${LIBNL3_REV}_amd64.deb $(dirname $GITHUB_WORKSPACE)
136-
dpkg-deb -x libnl-route-3-200_${LIBNL3_VER}-${LIBNL3_REV}_amd64.deb $(dirname $GITHUB_WORKSPACE)
137-
dpkg-deb -x libnl-route-3-dev_${LIBNL3_VER}-${LIBNL3_REV}_amd64.deb $(dirname $GITHUB_WORKSPACE)
138-
dpkg-deb -x libnl-nf-3-200_${LIBNL3_VER}-${LIBNL3_REV}_amd64.deb $(dirname $GITHUB_WORKSPACE)
139-
dpkg-deb -x libnl-nf-3-dev_${LIBNL3_VER}-${LIBNL3_REV}_amd64.deb $(dirname $GITHUB_WORKSPACE)
132+
dpkg-deb -x libnl-3-200_${LIBNL3_VER}-${LIBNL3_REV_SONIC}_amd64.deb $(dirname $GITHUB_WORKSPACE)
133+
dpkg-deb -x libnl-3-dev_${LIBNL3_VER}-${LIBNL3_REV_SONIC}_amd64.deb $(dirname $GITHUB_WORKSPACE)
134+
dpkg-deb -x libnl-genl-3-200_${LIBNL3_VER}-${LIBNL3_REV_SONIC}_amd64.deb $(dirname $GITHUB_WORKSPACE)
135+
dpkg-deb -x libnl-genl-3-dev_${LIBNL3_VER}-${LIBNL3_REV_SONIC}_amd64.deb $(dirname $GITHUB_WORKSPACE)
136+
dpkg-deb -x libnl-route-3-200_${LIBNL3_VER}-${LIBNL3_REV_SONIC}_amd64.deb $(dirname $GITHUB_WORKSPACE)
137+
dpkg-deb -x libnl-route-3-dev_${LIBNL3_VER}-${LIBNL3_REV_SONIC}_amd64.deb $(dirname $GITHUB_WORKSPACE)
138+
dpkg-deb -x libnl-nf-3-200_${LIBNL3_VER}-${LIBNL3_REV_SONIC}_amd64.deb $(dirname $GITHUB_WORKSPACE)
139+
dpkg-deb -x libnl-nf-3-dev_${LIBNL3_VER}-${LIBNL3_REV_SONIC}_amd64.deb $(dirname $GITHUB_WORKSPACE)
140140
popd
141141
env:
142142
LIBNL3_VER: "3.7.0"
143143
LIBNL3_REV: "0.2"
144+
LIBNL3_REV_SONIC: "0.2+b1sonic1"
144145

145146
- if: matrix.language == 'cpp'
146147
name: Build repository

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ cfgmgr/sflowmgrd
5959
cfgmgr/macsecmgrd
6060
cfgmgr/coppmgrd
6161
cfgmgr/tunnelmgrd
62+
cfgmgr/fabricmgrd
63+
cfgmgr/stpmgrd
6264
fpmsyncd/fpmsyncd
6365
gearsyncd/gearsyncd
6466
mclagsyncd/mclagsyncd
@@ -83,6 +85,8 @@ tests/mock_tests/tests_portsyncd
8385

8486
# Test Files #
8587
##############
88+
*gcda
89+
*gcno
8690
tests/log
8791
tests/mock_tests/test-suite.log
8892
tests/mock_tests/tests.log
@@ -92,5 +96,4 @@ tests/tests.log
9296
tests/tests.trs
9397
tests/mock_tests/**/*log
9498
tests/mock_tests/**/*trs
95-
orchagent/p4orch/tests/**/*gcda
96-
orchagent/p4orch/tests/**/*gcno
99+
orchagent/p4orch/tests/p4orch_tests

azure-pipelines.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ stages:
106106
swss_common_artifact_name: sonic-swss-common-${{ parameters.debian_version }}
107107
sairedis_artifact_name: sonic-sairedis-${{ parameters.debian_version }}
108108
swss_artifact_name: sonic-swss-${{ parameters.debian_version }}
109+
debian_version: ${{ parameters.debian_version }}
109110
artifact_name: docker-sonic-vs
110111

111112
- stage: BuildDockerAsan
@@ -118,6 +119,7 @@ stages:
118119
sairedis_artifact_name: sonic-sairedis-${{ parameters.debian_version }}
119120
swss_artifact_name: sonic-swss-asan-${{ parameters.debian_version }}
120121
artifact_name: docker-sonic-vs-asan
122+
debian_version: ${{ parameters.debian_version }}
121123
asan: true
122124

123125
- stage: Test

cfgmgr/Makefile.am

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LIBNL_LIBS = -lnl-genl-3 -lnl-route-3 -lnl-3
55
SAIMETA_LIBS = -lsaimeta -lsaimetadata -lzmq
66
COMMON_LIBS = -lswsscommon -lpthread
77

8-
bin_PROGRAMS = vlanmgrd teammgrd portmgrd intfmgrd buffermgrd vrfmgrd nbrmgrd vxlanmgrd sflowmgrd natmgrd coppmgrd tunnelmgrd macsecmgrd fabricmgrd
8+
bin_PROGRAMS = vlanmgrd teammgrd portmgrd intfmgrd buffermgrd vrfmgrd nbrmgrd vxlanmgrd sflowmgrd natmgrd coppmgrd tunnelmgrd macsecmgrd fabricmgrd stpmgrd
99

1010
cfgmgrdir = $(datadir)/swss
1111

@@ -101,6 +101,12 @@ macsecmgrd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI) $(CF
101101
macsecmgrd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI) $(CFLAGS_ASAN)
102102
macsecmgrd_LDADD = $(LDFLAGS_ASAN) $(COMMON_LIBS) $(SAIMETA_LIBS)
103103

104+
105+
stpmgrd_SOURCES = stpmgrd.cpp stpmgr.cpp $(COMMON_ORCH_SOURCE) shellcmd.h
106+
stpmgrd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI) $(CFLAGS_ASAN)
107+
stpmgrd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI) $(CFLAGS_ASAN)
108+
stpmgrd_LDADD = $(LDFLAGS_ASAN) $(COMMON_LIBS) $(SAIMETA_LIBS)
109+
104110
if GCOV_ENABLED
105111
vlanmgrd_SOURCES += ../gcovpreload/gcovpreload.cpp
106112
teammgrd_SOURCES += ../gcovpreload/gcovpreload.cpp
@@ -116,6 +122,7 @@ natmgrd_SOURCES += ../gcovpreload/gcovpreload.cpp
116122
coppmgrd_SOURCES += ../gcovpreload/gcovpreload.cpp
117123
tunnelmgrd_SOURCES += ../gcovpreload/gcovpreload.cpp
118124
macsecmgrd_SOURCES += ../gcovpreload/gcovpreload.cpp
125+
stpmgrd_SOURCES += ../gcovpreload/gcovpreload.cpp
119126
endif
120127

121128
if ASAN_ENABLED
@@ -133,5 +140,6 @@ coppmgrd_SOURCES += $(top_srcdir)/lib/asan.cpp
133140
tunnelmgrd_SOURCES += $(top_srcdir)/lib/asan.cpp
134141
macsecmgrd_SOURCES += $(top_srcdir)/lib/asan.cpp
135142
fabricmgrd_SOURCES += $(top_srcdir)/lib/asan.cpp
143+
stpmgrd_SOURCES += $(top_srcdir)/lib/asan.cpp
136144
endif
137145

cfgmgr/buffermgrdyn.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,6 +1462,26 @@ task_process_status BufferMgrDynamic::refreshPgsForPort(const string &port, cons
14621462
continue;
14631463
}
14641464

1465+
// If cable len is 0m, remove lossless PG, keep lossy PG.
1466+
if (cable_length == "0m" && portPg.lossless)
1467+
{
1468+
if (oldProfile.empty())
1469+
{
1470+
SWSS_LOG_INFO("No lossless profile found for port %s when cable length is set to '0m'.", port.c_str());
1471+
continue;
1472+
}
1473+
1474+
if (m_bufferProfileLookup.find(oldProfile) != m_bufferProfileLookup.end())
1475+
{
1476+
m_bufferProfileLookup[oldProfile].port_pgs.erase(key);
1477+
}
1478+
1479+
updateBufferObjectToDb(key, oldProfile, false);
1480+
profilesToBeReleased.insert(oldProfile);
1481+
portPg.running_profile_name.clear();
1482+
continue;
1483+
}
1484+
14651485
string threshold;
14661486
// Calculate new headroom size
14671487
if (portPg.static_configured)

0 commit comments

Comments
 (0)