Skip to content

Commit 6e52082

Browse files
author
vedganes
committed
Merge remote-tracking branch 'origin/master' into voq-inbandif-port
Signed-off-by: vedganes <vedavinayagam.ganesan@nokia.com>
2 parents c7e1600 + 1acf60e commit 6e52082

File tree

144 files changed

+15260
-1413
lines changed

Some content is hidden

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

144 files changed

+15260
-1413
lines changed

.artifactignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/*
2+
!*.deb

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ gearsyncd/gearsyncd
5656
mclagsyncd/mclagsyncd
5757
natsyncd/natsyncd
5858
neighsyncd/neighsyncd
59+
fdbsyncd/fdbsyncd
5960
orchagent/orchagent
6061
orchagent/orchagent_restart_check
6162
orchagent/routeresync

Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SUBDIRS = fpmsyncd neighsyncd portsyncd mclagsyncd natsyncd orchagent swssconfig cfgmgr tests gearsyncd
1+
SUBDIRS = fpmsyncd neighsyncd fdbsyncd portsyncd mclagsyncd natsyncd orchagent swssconfig cfgmgr tests gearsyncd
22

33
if HAVE_LIBTEAM
44
SUBDIRS += teamsyncd tlm_teamd

azure-pipelines.yml

+202
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
# C/C++ with GCC
2+
# Build your C/C++ project with GCC using make.
3+
# Add steps that publish test results, save build artifacts, deploy, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/apps/c-cpp/gcc
5+
6+
trigger:
7+
branches:
8+
include:
9+
- "*"
10+
11+
jobs:
12+
- job:
13+
displayName: "amd64"
14+
pool:
15+
vmImage: 'ubuntu-20.04'
16+
17+
container:
18+
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest
19+
20+
steps:
21+
- script: |
22+
sudo apt-get install -y libhiredis0.14 libhiredis-dev
23+
sudo apt-get install -y libzmq5 libzmq3-dev
24+
sudo apt-get install -qq -y \
25+
libhiredis-dev \
26+
libnl-3-dev \
27+
libnl-genl-3-dev \
28+
libnl-route-3-dev \
29+
libnl-nf-3-dev \
30+
swig3.0
31+
sudo apt-get install -y libdbus-1-3
32+
sudo apt-get install -y libteam-dev \
33+
libteam5 \
34+
libteamdctl0
35+
displayName: "Install dependencies"
36+
- task: DownloadPipelineArtifact@2
37+
inputs:
38+
source: specific
39+
project: build
40+
pipeline: 9
41+
artifacts: sonic-swss-common
42+
runVersion: 'latestFromBranch'
43+
runBranch: 'refs/heads/master'
44+
displayName: "Download sonic swss common deb packages"
45+
- task: DownloadPipelineArtifact@2
46+
inputs:
47+
source: specific
48+
project: build
49+
pipeline: 12
50+
artifacts: sonic-sairedis
51+
runVersion: 'latestFromBranch'
52+
runBranch: 'refs/heads/master'
53+
displayName: "Download sonic sairedis deb packages"
54+
- script: |
55+
sudo dpkg -i sonic-swss-common/libswsscommon_1.0.0_amd64.deb
56+
sudo dpkg -i sonic-swss-common/libswsscommon-dev_1.0.0_amd64.deb
57+
sudo dpkg -i sonic-sairedis/libsaivs_*.deb
58+
sudo dpkg -i sonic-sairedis/libsaivs-dev_*.deb
59+
sudo dpkg -i sonic-sairedis/libsairedis_*.deb
60+
sudo dpkg -i sonic-sairedis/libsairedis-dev_*.deb
61+
sudo dpkg -i sonic-sairedis/libsaimetadata_*.deb
62+
sudo dpkg -i sonic-sairedis/libsaimetadata-dev_*.deb
63+
sudo dpkg -i sonic-sairedis/syncd-vs_*.deb
64+
workingDirectory: $(Pipeline.Workspace)
65+
displayName: "Install sonic swss common and sairedis"
66+
- checkout: self
67+
submodules: true
68+
- script: |
69+
./autogen.sh
70+
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
71+
displayName: "Compile sonic swss"
72+
- publish: $(System.DefaultWorkingDirectory)/
73+
artifact: sonic-swss
74+
displayName: "Archive swss debian packages"
75+
76+
- job:
77+
displayName: "arm64"
78+
timeoutInMinutes: 180
79+
pool: sonicbld
80+
81+
container:
82+
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster-arm64:latest
83+
84+
steps:
85+
- script: |
86+
sudo apt-get install -y libhiredis0.14 libhiredis-dev
87+
sudo apt-get install -y libzmq5 libzmq3-dev
88+
sudo apt-get install -qq -y \
89+
libhiredis-dev \
90+
libnl-3-dev \
91+
libnl-genl-3-dev \
92+
libnl-route-3-dev \
93+
libnl-nf-3-dev \
94+
swig3.0
95+
sudo apt-get install -y libdbus-1-3
96+
sudo apt-get install -y libteam-dev \
97+
libteam5 \
98+
libteamdctl0
99+
displayName: "Install dependencies"
100+
- task: DownloadPipelineArtifact@2
101+
inputs:
102+
source: specific
103+
project: build
104+
pipeline: 9
105+
artifacts: sonic-swss-common.arm64
106+
runVersion: 'latestFromBranch'
107+
runBranch: 'refs/heads/master'
108+
displayName: "Download sonic swss common deb packages"
109+
- task: DownloadPipelineArtifact@2
110+
inputs:
111+
source: specific
112+
project: build
113+
pipeline: 12
114+
artifacts: sonic-sairedis.arm64
115+
runVersion: 'latestFromBranch'
116+
runBranch: 'refs/heads/master'
117+
displayName: "Download sonic sairedis deb packages"
118+
- script: |
119+
sudo dpkg -i sonic-swss-common.arm64/libswsscommon_1.0.0_arm64.deb
120+
sudo dpkg -i sonic-swss-common.arm64/libswsscommon-dev_1.0.0_arm64.deb
121+
sudo dpkg -i sonic-sairedis.arm64/libsaivs_*.deb
122+
sudo dpkg -i sonic-sairedis.arm64/libsaivs-dev_*.deb
123+
sudo dpkg -i sonic-sairedis.arm64/libsairedis_*.deb
124+
sudo dpkg -i sonic-sairedis.arm64/libsairedis-dev_*.deb
125+
sudo dpkg -i sonic-sairedis.arm64/libsaimetadata_*.deb
126+
sudo dpkg -i sonic-sairedis.arm64/libsaimetadata-dev_*.deb
127+
sudo dpkg -i sonic-sairedis.arm64/syncd-vs_*.deb
128+
workingDirectory: $(Pipeline.Workspace)
129+
displayName: "Install sonic swss common and sairedis"
130+
- checkout: self
131+
submodules: true
132+
- script: |
133+
./autogen.sh
134+
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
135+
displayName: "Compile sonic swss"
136+
- publish: $(System.DefaultWorkingDirectory)/
137+
artifact: sonic-swss.arm64
138+
displayName: "Archive swss debian packages"
139+
140+
- job:
141+
displayName: "armhf"
142+
timeoutInMinutes: 180
143+
pool: sonicbld
144+
145+
container:
146+
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster-armhf:latest
147+
148+
steps:
149+
- script: |
150+
sudo apt-get install -y libhiredis0.14 libhiredis-dev
151+
sudo apt-get install -y libzmq5 libzmq3-dev
152+
sudo apt-get install -qq -y \
153+
libhiredis-dev \
154+
libnl-3-dev \
155+
libnl-genl-3-dev \
156+
libnl-route-3-dev \
157+
libnl-nf-3-dev \
158+
swig3.0
159+
sudo apt-get install -y libdbus-1-3
160+
sudo apt-get install -y libteam-dev \
161+
libteam5 \
162+
libteamdctl0
163+
displayName: "Install dependencies"
164+
- task: DownloadPipelineArtifact@2
165+
inputs:
166+
source: specific
167+
project: build
168+
pipeline: 9
169+
artifacts: sonic-swss-common.armhf
170+
runVersion: 'latestFromBranch'
171+
runBranch: 'refs/heads/master'
172+
displayName: "Download sonic swss common deb packages"
173+
- task: DownloadPipelineArtifact@2
174+
inputs:
175+
source: specific
176+
project: build
177+
pipeline: 12
178+
artifacts: sonic-sairedis.armhf
179+
runVersion: 'latestFromBranch'
180+
runBranch: 'refs/heads/master'
181+
displayName: "Download sonic sairedis deb packages"
182+
- script: |
183+
sudo dpkg -i sonic-swss-common.armhf/libswsscommon_1.0.0_armhf.deb
184+
sudo dpkg -i sonic-swss-common.armhf/libswsscommon-dev_1.0.0_armhf.deb
185+
sudo dpkg -i sonic-sairedis.armhf/libsaivs_*.deb
186+
sudo dpkg -i sonic-sairedis.armhf/libsaivs-dev_*.deb
187+
sudo dpkg -i sonic-sairedis.armhf/libsairedis_*.deb
188+
sudo dpkg -i sonic-sairedis.armhf/libsairedis-dev_*.deb
189+
sudo dpkg -i sonic-sairedis.armhf/libsaimetadata_*.deb
190+
sudo dpkg -i sonic-sairedis.armhf/libsaimetadata-dev_*.deb
191+
sudo dpkg -i sonic-sairedis.armhf/syncd-vs_*.deb
192+
workingDirectory: $(Pipeline.Workspace)
193+
displayName: "Install sonic swss common and sairedis"
194+
- checkout: self
195+
submodules: true
196+
- script: |
197+
./autogen.sh
198+
dpkg-buildpackage -us -uc -b -j$(nproc) && cp ../*.deb .
199+
displayName: "Compile sonic swss"
200+
- publish: $(System.DefaultWorkingDirectory)/
201+
artifact: sonic-swss.armhf
202+
displayName: "Archive swss debian packages"

cfgmgr/Makefile.am

+17-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@ CFLAGS_SAI = -I /usr/include/sai
33
LIBNL_CFLAGS = -I/usr/include/libnl3
44
LIBNL_LIBS = -lnl-genl-3 -lnl-route-3 -lnl-3
55

6-
bin_PROGRAMS = vlanmgrd teammgrd portmgrd intfmgrd buffermgrd vrfmgrd nbrmgrd vxlanmgrd sflowmgrd natmgrd coppmgrd
6+
bin_PROGRAMS = vlanmgrd teammgrd portmgrd intfmgrd buffermgrd vrfmgrd nbrmgrd vxlanmgrd sflowmgrd natmgrd coppmgrd tunnelmgrd
7+
8+
cfgmgrdir = $(datadir)/swss
9+
10+
dist_cfgmgr_DATA = \
11+
buffer_check_headroom_mellanox.lua \
12+
buffer_headroom_mellanox.lua \
13+
buffer_pool_mellanox.lua \
14+
buffer_check_headroom_vs.lua \
15+
buffer_headroom_vs.lua \
16+
buffer_pool_vs.lua
717

818
if DEBUG
919
DBGFLAGS = -ggdb -DDEBUG
@@ -31,7 +41,7 @@ intfmgrd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
3141
intfmgrd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
3242
intfmgrd_LDADD = -lswsscommon
3343

34-
buffermgrd_SOURCES = buffermgrd.cpp buffermgr.cpp $(top_srcdir)/orchagent/orch.cpp $(top_srcdir)/orchagent/request_parser.cpp shellcmd.h
44+
buffermgrd_SOURCES = buffermgrd.cpp buffermgr.cpp buffermgrdyn.cpp $(top_srcdir)/orchagent/orch.cpp $(top_srcdir)/orchagent/request_parser.cpp shellcmd.h
3545
buffermgrd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
3646
buffermgrd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
3747
buffermgrd_LDADD = -lswsscommon
@@ -66,3 +76,8 @@ coppmgrd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
6676
coppmgrd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
6777
coppmgrd_LDADD = -lswsscommon
6878

79+
tunnelmgrd_SOURCES = tunnelmgrd.cpp tunnelmgr.cpp $(top_srcdir)/orchagent/orch.cpp $(top_srcdir)/orchagent/request_parser.cpp shellcmd.h
80+
tunnelmgrd_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
81+
tunnelmgrd_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_SAI)
82+
tunnelmgrd_LDADD = -lswsscommon
83+
+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
-- KEYS - port name
2+
-- ARGV[1] - profile name
3+
-- ARGV[2] - new size
4+
-- ARGV[3] - pg to add
5+
6+
local port = KEYS[1]
7+
local input_profile_name = ARGV[1]
8+
local input_profile_size = ARGV[2]
9+
local new_pg = ARGV[3]
10+
local accumulative_size = 0
11+
12+
local appl_db = "0"
13+
local config_db = "4"
14+
local state_db = "6"
15+
16+
local ret_true = {}
17+
local ret_false = {}
18+
local ret = {}
19+
local default_ret = {}
20+
21+
table.insert(ret_true, "result:true")
22+
table.insert(ret_false, "result:false")
23+
24+
-- Fetch the cable length from CONFIG_DB
25+
redis.call('SELECT', config_db)
26+
local cable_length_keys = redis.call('KEYS', 'CABLE_LENGTH*')
27+
if #cable_length_keys == 0 then
28+
return ret_true
29+
end
30+
31+
-- Check whether cable length exceeds 300m (maximum value in the non-dynamic-buffer solution)
32+
local cable_length_str = redis.call('HGET', cable_length_keys[1], port)
33+
if cable_length_str == nil then
34+
return ret_true
35+
end
36+
local cable_length = tonumber(string.sub(cable_length_str, 1, -2))
37+
if cable_length > 300 then
38+
default_ret = ret_false
39+
else
40+
default_ret = ret_true
41+
end
42+
table.insert(default_ret, 'debug:no max_headroom_size configured, check cable length instead')
43+
44+
local speed = redis.call('HGET', 'PORT|' .. port, 'speed')
45+
46+
-- Fetch the threshold from STATE_DB
47+
redis.call('SELECT', state_db)
48+
49+
local max_headroom_size = tonumber(redis.call('HGET', 'BUFFER_MAX_PARAM_TABLE|' .. port, 'max_headroom_size'))
50+
if max_headroom_size == nil then
51+
return default_ret
52+
end
53+
54+
local asic_keys = redis.call('KEYS', 'ASIC_TABLE*')
55+
local pipeline_delay = tonumber(redis.call('HGET', asic_keys[1], 'pipeline_latency'))
56+
if speed == 400000 then
57+
pipeline_delay = pipeline_delay * 2 - 1
58+
end
59+
accumulative_size = accumulative_size + 2 * pipeline_delay * 1024
60+
61+
-- Fetch all keys in BUFFER_PG according to the port
62+
redis.call('SELECT', appl_db)
63+
64+
local debuginfo = {}
65+
66+
local function get_number_of_pgs(keyname)
67+
local range = string.match(keyname, "Ethernet%d+:([^%s]+)$")
68+
local size
69+
if range == nil then
70+
table.insert(debuginfo, "debug:invalid pg:" .. keyname)
71+
return 0
72+
end
73+
if string.len(range) == 1 then
74+
size = 1
75+
else
76+
size = 1 + tonumber(string.sub(range, -1)) - tonumber(string.sub(range, 1, 1))
77+
end
78+
return size
79+
end
80+
81+
local no_input_pg = true
82+
if new_pg ~= nil then
83+
if get_number_of_pgs(new_pg) ~= 0 then
84+
no_input_pg = false
85+
new_pg = 'BUFFER_PG_TABLE:' .. new_pg
86+
end
87+
end
88+
89+
-- Fetch all the PGs, accumulate the sizes
90+
-- Assume there is only one lossless profile configured among all PGs on each port
91+
table.insert(debuginfo, 'debug:other overhead:' .. accumulative_size)
92+
local pg_keys = redis.call('KEYS', 'BUFFER_PG_TABLE:' .. port .. ':*')
93+
for i = 1, #pg_keys do
94+
local profile = string.sub(redis.call('HGET', pg_keys[i], 'profile'), 2, -2)
95+
local current_profile_size
96+
if profile ~= 'BUFFER_PROFILE_TABLE:ingress_lossy_profile' and (no_input_pg or new_pg ~= pg_keys[i]) then
97+
if profile ~= input_profile_name and not no_input_pg then
98+
local referenced_profile = redis.call('HGETALL', profile)
99+
for j = 1, #referenced_profile, 2 do
100+
if referenced_profile[j] == 'size' then
101+
current_profile_size = tonumber(referenced_profile[j+1])
102+
end
103+
end
104+
else
105+
current_profile_size = input_profile_size
106+
profile = input_profile_name
107+
end
108+
accumulative_size = accumulative_size + current_profile_size * get_number_of_pgs(pg_keys[i])
109+
table.insert(debuginfo, 'debug:' .. pg_keys[i] .. ':' .. profile .. ':' .. current_profile_size .. ':' .. get_number_of_pgs(pg_keys[i]) .. ':accu:' .. accumulative_size)
110+
end
111+
end
112+
113+
if not no_input_pg then
114+
accumulative_size = accumulative_size + input_profile_size * get_number_of_pgs(new_pg)
115+
table.insert(debuginfo, 'debug:' .. new_pg .. '*:' .. input_profile_name .. ':' .. input_profile_size .. ':' .. get_number_of_pgs(new_pg) .. ':accu:' .. accumulative_size)
116+
end
117+
118+
if max_headroom_size > accumulative_size then
119+
table.insert(ret, "result:true")
120+
else
121+
table.insert(ret, "result:false")
122+
end
123+
124+
table.insert(ret, "debug:max headroom:" .. max_headroom_size)
125+
table.insert(ret, "debug:accumulative headroom:" .. accumulative_size)
126+
127+
for i = 1, #debuginfo do
128+
table.insert(ret, debuginfo[i])
129+
end
130+
131+
return ret

cfgmgr/buffer_check_headroom_vs.lua

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
buffer_check_headroom_mellanox.lua

0 commit comments

Comments
 (0)