Skip to content

Commit 0af7918

Browse files
authored
Use software_bfd instead of switch_type. (#21794)
Use software_bfd instead of switch_type
1 parent ed82e02 commit 0af7918

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ dependent_startup_wait_for=bgpd:running
206206

207207
{% endif %}
208208

209-
{% if DEVICE_METADATA.localhost.switch_type is defined and DEVICE_METADATA.localhost.switch_type == "dpu" %}
209+
{% if FEATURE is defined and FEATURE.software_bfd is defined and FEATURE.software_bfd.state is defined and FEATURE.software_bfd.state == "enabled" %}
210210
[program:bfdmon]
211211
command=/usr/local/bin/bfdmon
212212
priority=6

src/sonic-bgpcfgd/bgpcfgd/main.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import threading
66
import traceback
77

8+
from swsscommon.swsscommon import ConfigDBConnector
89
from swsscommon import swsscommon
910
from sonic_py_common import device_info
1011

@@ -88,9 +89,11 @@ def do_work():
8889
if device_info.is_chassis():
8990
managers.append(ChassisAppDbMgr(common_objs, "CHASSIS_APP_DB", "BGP_DEVICE_GLOBAL"))
9091

91-
switch_type = device_info.get_localhost_info("switch_type")
92-
if switch_type and switch_type == "dpu":
93-
log_notice("switch type is dpu, starting bfd manager")
92+
config_db = ConfigDBConnector()
93+
config_db.connect()
94+
features = config_db.get_table('FEATURE')
95+
if 'software_bfd' in features and 'state' in features['software_bfd'] and features['software_bfd']['state'] == 'enabled':
96+
log_notice("software_bfd feature is enabled, starting bfd manager")
9497
managers.append(BfdMgr(common_objs, "STATE_DB", swsscommon.STATE_BFD_SOFTWARE_SESSION_TABLE_NAME))
9598

9699
runner = Runner(common_objs['cfg_mgr'])

0 commit comments

Comments
 (0)