Skip to content

Commit 4a996f3

Browse files
[swss]: Run tunnel_pkt_handler on dualtor only (#11627)
At SWSS docker init time, check the device subtype and enable tunnel packet handler only if it is dualtor Signed-off-by: Lawrence Lee <[email protected]>
1 parent 889741c commit 4a996f3

4 files changed

Lines changed: 15 additions & 13 deletions

File tree

dockers/docker-orchagent/Dockerfile.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ RUN apt-get purge -y \
6868

6969
COPY ["files/arp_update", "/usr/bin"]
7070
COPY ["arp_update.conf", "files/arp_update_vars.j2", "/usr/share/sonic/templates/"]
71-
COPY ["ndppd.conf", "/usr/share/sonic/templates/"]
71+
COPY ["ndppd.conf", "tunnel_packet_handler.conf", "/usr/share/sonic/templates/"]
7272
COPY ["enable_counters.py", "tunnel_packet_handler.py", "/usr/bin/"]
7373
COPY ["orchagent.sh", "swssconfig.sh", "buffermgrd.sh", "/usr/bin/"]
7474
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]

dockers/docker-orchagent/docker-init.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ CFGGEN_PARAMS=" \
2121
-t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \
2222
"
2323
VLAN=$(sonic-cfggen $CFGGEN_PARAMS)
24+
SUBTYPE=$(sonic-cfggen -d -v "DEVICE_METADATA['localhost']['subtype']")
2425
SWITCH_TYPE=${SWITCH_TYPE:-`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['switch_type']"`}
2526
chmod +x /usr/bin/wait_for_link.sh
2627

@@ -43,6 +44,10 @@ if [ "$VLAN" != "" ]; then
4344
cp /usr/share/sonic/templates/ndppd.conf /etc/supervisor/conf.d/
4445
fi
4546

47+
if [ "$SUBTYPE" == "DualToR" ]; then
48+
cp /usr/share/sonic/templates/tunnel_packet_handler.conf /etc/supervisor/conf.d/
49+
fi
50+
4651
USE_PCI_ID_IN_CHASSIS_STATE_DB=/usr/share/sonic/platform/use_pci_id_chassis
4752
ASIC_ID="asic$NAMESPACE_ID"
4853
if [ -f "$USE_PCI_ID_IN_CHASSIS_STATE_DB" ]; then

dockers/docker-orchagent/supervisord.conf.j2

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,3 @@ dependent_startup_wait_for=swssconfig:exited
288288
environment=ASAN_OPTIONS="log_path=/var/log/asan/fdbsyncd-asan.log{{ asan_extra_options }}"
289289
{% endif %}
290290
{%- endif %}
291-
292-
{% if is_fabric_asic == 0 %}
293-
[program:tunnel_packet_handler]
294-
command=/usr/bin/tunnel_packet_handler.py
295-
priority=12
296-
autostart=false
297-
autorestart=unexpected
298-
stdout_logfile=syslog
299-
stderr_logfile=syslog
300-
dependent_startup=true
301-
dependent_startup_wait_for=swssconfig:exited
302-
{%- endif %}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[program:tunnel_packet_handler]
2+
command=/usr/bin/tunnel_packet_handler.py
3+
priority=12
4+
autostart=false
5+
autorestart=unexpected
6+
stdout_logfile=syslog
7+
stderr_logfile=syslog
8+
dependent_startup=true
9+
dependent_startup_wait_for=swssconfig:exited

0 commit comments

Comments
 (0)