Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use software_bfd instead of switch_type. #21794

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ dependent_startup_wait_for=bgpd:running

{% endif %}

{% if DEVICE_METADATA.localhost.switch_type is defined and DEVICE_METADATA.localhost.switch_type == "dpu" %}
{% if FEATURE is defined and FEATURE.software_bfd is defined and FEATURE.software_bfd.state is defined and FEATURE.software_bfd.state == "enabled" %}
[program:bfdmon]
command=/usr/local/bin/bfdmon
priority=6
Expand Down
9 changes: 6 additions & 3 deletions src/sonic-bgpcfgd/bgpcfgd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import threading
import traceback

from swsscommon.swsscommon import ConfigDBConnector
from swsscommon import swsscommon
from sonic_py_common import device_info

Expand Down Expand Up @@ -85,9 +86,11 @@ def do_work():
if device_info.is_chassis():
managers.append(ChassisAppDbMgr(common_objs, "CHASSIS_APP_DB", "BGP_DEVICE_GLOBAL"))

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

runner = Runner(common_objs['cfg_mgr'])
Expand Down
Loading