Skip to content

Commit 29f3eac

Browse files
authored
Merge pull request sonic-net#699 from r12f/code-sync-202412
[202412] Code sync sonic-net/sonic-buildimage:202411 => 202412
2 parents c39edd9 + cb9d0a2 commit 29f3eac

File tree

10 files changed

+67
-30
lines changed

10 files changed

+67
-30
lines changed

device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/BALANCED/buffers_defaults_t0.j2

+11-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@
88
{%- endfor %}
99
{%- endmacro %}
1010

11+
{%- set ingress_lossless_pool_size = '32689152' %}
12+
{%- set egress_lossless_pool_size = '32340992' %}
13+
{%- if (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('subtype' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['subtype'] == 'DualToR') %}
14+
{%- set ingress_lossless_pool_size = '32441856' %}
15+
{%- set egress_lossless_pool_size = '32441856' %}
16+
{%- endif %}
17+
1118
{%- macro generate_buffer_pool_and_profiles() %}
1219
"BUFFER_POOL": {
1320
"ingress_lossless_pool": {
14-
"size": "32689152",
21+
"size": "{{ingress_lossless_pool_size }}",
1522
"type": "ingress",
1623
"mode": "dynamic",
1724
"xoff": "2058240"
@@ -22,7 +29,7 @@
2229
"mode": "dynamic"
2330
},
2431
"egress_lossless_pool": {
25-
"size": "32340992",
32+
"size": "{{egress_lossless_pool_size }}",
2633
"type": "egress",
2734
"mode": "static"
2835
}
@@ -31,12 +38,12 @@
3138
"ingress_lossy_profile": {
3239
"pool":"ingress_lossless_pool",
3340
"size":"0",
34-
"static_th":"32689152"
41+
"static_th":"{{ingress_lossless_pool_size }}"
3542
},
3643
"egress_lossless_profile": {
3744
"pool":"egress_lossless_pool",
3845
"size":"0",
39-
"static_th":"32340992"
46+
"static_th":"{{egress_lossless_pool_size }}"
4047
},
4148
"egress_lossy_profile": {
4249
"pool":"egress_lossy_pool",

dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2

+8-8
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ stderr_logfile=syslog
3030
dependent_startup=true
3131

3232
[program:mgmtd]
33-
command=/usr/lib/frr/mgmtd -A 127.0.0.1 -P 0
33+
command=/usr/lib/frr/mgmtd -A 127.0.0.1
3434
priority=4
3535
autostart=false
3636
autorestart=true
@@ -63,7 +63,7 @@ dependent_startup=true
6363
dependent_startup_wait_for=zebra:running
6464

6565
[program:staticd]
66-
command=/usr/lib/frr/staticd -A 127.0.0.1 -P 0
66+
command=/usr/lib/frr/staticd -A 127.0.0.1
6767
priority=4
6868
autostart=false
6969
autorestart=false
@@ -75,7 +75,7 @@ dependent_startup_wait_for=zsocket:exited
7575

7676
{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %}
7777
[program:bfdd]
78-
command=/usr/lib/frr/bfdd -A 127.0.0.1 -P 0
78+
command=/usr/lib/frr/bfdd -A 127.0.0.1
7979
priority=4
8080
stopsignal=KILL
8181
autostart=false
@@ -89,9 +89,9 @@ dependent_startup_wait_for=zebra:running
8989

9090
[program:bgpd]
9191
{% if FEATURE is defined and FEATURE.bmp is defined and FEATURE.bmp.state is defined and FEATURE.bmp.state == "enabled" %}
92-
command=/usr/lib/frr/bgpd -A 127.0.0.1 -P 0 -M snmp -M bmp
92+
command=/usr/lib/frr/bgpd -A 127.0.0.1 -M snmp -M bmp
9393
{% else %}
94-
command=/usr/lib/frr/bgpd -A 127.0.0.1 -P 0 -M snmp
94+
command=/usr/lib/frr/bgpd -A 127.0.0.1 -M snmp
9595
{% endif %}
9696
priority=5
9797
stopsignal=KILL
@@ -105,7 +105,7 @@ dependent_startup_wait_for=zsocket:exited
105105

106106
{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %}
107107
[program:ospfd]
108-
command=/usr/lib/frr/ospfd -A 127.0.0.1 -P 0 -M snmp
108+
command=/usr/lib/frr/ospfd -A 127.0.0.1 -M snmp
109109
priority=5
110110
stopsignal=KILL
111111
autostart=false
@@ -117,7 +117,7 @@ dependent_startup=true
117117
dependent_startup_wait_for=zebra:running
118118

119119
[program:pimd]
120-
command=/usr/lib/frr/pimd -A 127.0.0.1 -P 0
120+
command=/usr/lib/frr/pimd -A 127.0.0.1
121121
priority=5
122122
stopsignal=KILL
123123
autostart=false
@@ -211,7 +211,7 @@ dependent_startup_wait_for=bgpd:running
211211

212212
{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %}
213213
[program:pathd]
214-
command=/usr/lib/frr/pathd -A 127.0.0.1 -P 0
214+
command=/usr/lib/frr/pathd -A 127.0.0.1
215215
priority=5
216216
stopsignal=KILL
217217
autostart=false

dockers/docker-orchagent/tunnel_packet_handler.py

+34-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from datetime import datetime
1414
from ipaddress import ip_interface
1515
from queue import Queue
16+
from threading import Lock, Event, Thread
1617

1718
from swsscommon.swsscommon import ConfigDBConnector, SonicV2Connector, \
1819
DBConnector, Select, SubscriberStateTable
@@ -29,6 +30,9 @@
2930

3031
STATE_DB = 'STATE_DB'
3132
APPL_DB = 'APPL_DB'
33+
COUNTERS_DB = 'COUNTERS_DB'
34+
TUNNEL_PKT_COUNTER_TEMPLATE = 'COUNTERS{}IPINIP_TUNNEL_CPU_PKTS'
35+
COUNTER_KEY = 'RX_COUNT'
3236
PORTCHANNEL_INTERFACE_TABLE = 'PORTCHANNEL_INTERFACE'
3337
TUNNEL_TABLE = 'TUNNEL'
3438
PEER_SWITCH_TABLE = 'PEER_SWITCH'
@@ -69,13 +73,18 @@ def __init__(self):
6973
self.config_db.connect()
7074
self.state_db = SonicV2Connector()
7175
self.state_db.connect(STATE_DB)
76+
self.counters_db = SonicV2Connector()
77+
self.counters_db.connect(COUNTERS_DB)
78+
counters_db_separator = self.counters_db.get_db_separator(COUNTERS_DB)
79+
self.tunnel_counter_table = TUNNEL_PKT_COUNTER_TEMPLATE.format(counters_db_separator)
7280
self._portchannel_intfs = None
7381
self.up_portchannels = None
7482
self.netlink_api = IPRoute()
7583
self.sniffer = None
7684
self.self_ip = ''
7785
self.packet_filter = ''
7886
self.sniff_intfs = set()
87+
self.pending_cmds = Queue()
7988

8089
global portchannel_intfs
8190
portchannel_intfs = [name for name, _ in self.portchannel_intfs]
@@ -304,6 +313,27 @@ def start_sniffer(self):
304313
while not hasattr(self.sniffer, 'stop_cb'):
305314
time.sleep(0.1)
306315

316+
def write_count_to_db(self):
317+
while True:
318+
# use a set to automatically deduplicate destination IPs
319+
to_run = set()
320+
321+
to_run.add(tuple(self.pending_cmds.get()))
322+
pkt_count = 1
323+
while not self.pending_cmds.empty() and len(to_run) < 100:
324+
to_run.add(tuple(self.pending_cmds.get()))
325+
# we should always count each packet, but only ping for each unique IP
326+
pkt_count += 1
327+
328+
for cmds in to_run:
329+
logger.log_info("Running command '{}'".format(' '.join(cmds)))
330+
subprocess.run(cmds, stdout=subprocess.DEVNULL)
331+
try:
332+
curr_count = int(self.counters_db.get(COUNTERS_DB, self.tunnel_counter_table, COUNTER_KEY))
333+
except TypeError:
334+
curr_count = 0
335+
self.counters_db.set(COUNTERS_DB, self.tunnel_counter_table, COUNTER_KEY, str(curr_count + pkt_count))
336+
307337
def ping_inner_dst(self, packet):
308338
"""
309339
Pings the inner destination IP for an encapsulated packet
@@ -319,8 +349,7 @@ def ping_inner_dst(self, packet):
319349
cmds.append('-6')
320350
dst_ip = packet[IP].payload[inner_packet_type].dst
321351
cmds.append(dst_ip)
322-
logger.log_info("Running command '{}'".format(' '.join(cmds)))
323-
subprocess.run(cmds, stdout=subprocess.DEVNULL)
352+
self.pending_cmds.put(cmds)
324353

325354
def listen_for_tunnel_pkts(self):
326355
"""
@@ -339,7 +368,6 @@ def listen_for_tunnel_pkts(self):
339368
logger.log_notice('Starting tunnel packet handler for {}'
340369
.format(self.packet_filter))
341370

342-
343371
app_db = DBConnector(APPL_DB, 0)
344372
lag_table = SubscriberStateTable(app_db, LAG_TABLE)
345373
sel = Select()
@@ -355,7 +383,7 @@ def listen_for_tunnel_pkts(self):
355383
elif rc == Select.ERROR:
356384
raise Exception("Select() error")
357385
else:
358-
lag, op, fvs = lag_table.pop()
386+
lag, _, fvs = lag_table.pop()
359387
if self.sniffer_restart_required(lag, fvs):
360388
self.sniffer.stop()
361389
start = datetime.now()
@@ -374,6 +402,8 @@ def run(self):
374402
Entry point for the TunnelPacketHandler class
375403
"""
376404
self.wait_for_portchannels()
405+
db_thread = Thread(target=self.write_count_to_db, daemon=True)
406+
db_thread.start()
377407
self.listen_for_tunnel_pkts()
378408

379409

files/image_config/monit/container_checker

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def check_docker_image(image_name):
3535
DOCKER_CLIENT.images.get(image_name)
3636
return True
3737
except (docker.errors.ImageNotFound, docker.errors.APIError) as err:
38-
print("Failed to get image '{}'. Error: '{}'".format(image_name, err))
3938
return False
4039

4140
def get_expected_running_containers():
@@ -79,7 +78,7 @@ def get_expected_running_containers():
7978
# if gnmi container image is present, check gnmi container instead of telemetry
8079
ret = check_docker_image("docker-sonic-gnmi")
8180
if not ret:
82-
print("Ignoring telemetry container check on image which has no corresponding docker image")
81+
print("Ignoring telemetry container check on image which has no corresponding telemetry or gnmi docker image")
8382
else:
8483
container_list.append("gnmi")
8584
continue

platform/broadcom/docker-syncd-brcm-dnx-rpc/Dockerfile.j2

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ RUN apt-get update \
2020
wget \
2121
cmake \
2222
libnanomsg5 \
23-
libnanomsg-dev
23+
libnanomsg-dev \
24+
libthrift-0.17.0
2425

2526
{% if docker_syncd_brcm_dnx_rpc_debs.strip() -%}
2627
# Copy locally-built Debian package dependencies

platform/mellanox/mlnx-platform-api/sonic_platform/module.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def __init__(self, dpu_id):
267267
self.CONFIG_DB_NAME = "CONFIG_DB"
268268
self.DHCP_SERVER_HASH = f"DHCP_SERVER_IPV4_PORT|bridge-midplane|{self._name.lower()}"
269269
self.DHCP_IP_ADDRESS_KEY = "ips@"
270-
self.config_db = ConfigDBConnector(use_unix_socket_path=True)
270+
self.config_db = ConfigDBConnector(use_unix_socket_path=False)
271271
self.config_db.connect()
272272
self.midplane_ip = None
273273
self.midplane_interface = None

src/sonic-config-engine/tests/sample_output/py3/buffer-arista7050cx3-dualtor-remap-disabled.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
"BUFFER_POOL": {
6464
"ingress_lossless_pool": {
65-
"size": "32689152",
65+
"size": "32441856",
6666
"type": "ingress",
6767
"mode": "dynamic",
6868
"xoff": "2058240"
@@ -73,7 +73,7 @@
7373
"mode": "dynamic"
7474
},
7575
"egress_lossless_pool": {
76-
"size": "32340992",
76+
"size": "32441856",
7777
"type": "egress",
7878
"mode": "static"
7979
}
@@ -82,12 +82,12 @@
8282
"ingress_lossy_profile": {
8383
"pool":"ingress_lossless_pool",
8484
"size":"0",
85-
"static_th":"32689152"
85+
"static_th":"32441856"
8686
},
8787
"egress_lossless_profile": {
8888
"pool":"egress_lossless_pool",
8989
"size":"0",
90-
"static_th":"32340992"
90+
"static_th":"32441856"
9191
},
9292
"egress_lossy_profile": {
9393
"pool":"egress_lossy_pool",

src/sonic-config-engine/tests/sample_output/py3/buffer-arista7050cx3-dualtor.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
"BUFFER_POOL": {
6464
"ingress_lossless_pool": {
65-
"size": "32689152",
65+
"size": "32441856",
6666
"type": "ingress",
6767
"mode": "dynamic",
6868
"xoff": "2058240"
@@ -73,7 +73,7 @@
7373
"mode": "dynamic"
7474
},
7575
"egress_lossless_pool": {
76-
"size": "32340992",
76+
"size": "32441856",
7777
"type": "egress",
7878
"mode": "static"
7979
}
@@ -82,12 +82,12 @@
8282
"ingress_lossy_profile": {
8383
"pool":"ingress_lossless_pool",
8484
"size":"0",
85-
"static_th":"32689152"
85+
"static_th":"32441856"
8686
},
8787
"egress_lossless_profile": {
8888
"pool":"egress_lossless_pool",
8989
"size":"0",
90-
"static_th":"32340992"
90+
"static_th":"32441856"
9191
},
9292
"egress_lossy_profile": {
9393
"pool":"egress_lossy_pool",

0 commit comments

Comments
 (0)