-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
bgpcfgd: add support for software bfd sessions #20981
Conversation
table, | ||
) | ||
|
||
self.check_and_start_bfdd() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the return status and load_bfd_sessions only if the BFDD is running?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
|
||
ret_code, out, err = run_command(command) | ||
if ret_code != 0: | ||
log_err("Can't add bfd session: %s" % err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add BFD session key details in the error log?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if command != "": | ||
ret_code, out, err = run_command(command) | ||
if ret_code != 0: | ||
log_err("Can't update bfd session: %s" % err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, please add BFD session details in the log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
'multihop': False, | ||
'local': '', | ||
'detect-multiplier': self.MULTIPLIER, | ||
'receive-interval': self.RX_INTERVAL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are the RX/TX INTERVAL units? in micro or milliseconds? I believe FRR configs take interval in milliseconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are in ms
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the units in the variable or a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
'local': '', | ||
'detect-multiplier': self.MULTIPLIER, | ||
'receive-interval': self.RX_INTERVAL, | ||
'transmit-interval': self.TX_INTERVAL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the unit, could you update the variable name to reflect the units.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
'receive-interval': self.RX_INTERVAL, | ||
'transmit-interval': self.TX_INTERVAL, | ||
'passive-mode': True, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check the default DSCP value of BFD packets from FRR? If it is not 48, could we check if there is any FRR config to update this DSCP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is 48 by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dypet. Could you add a comment about the DSCP value in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
'passive-mode': False, | ||
'receive-interval': 300, | ||
'transmit-interval': 100 | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add BFD V6 sessions config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
hi @kperumalbfn , is there an ETA to close this one? We would want it complete before @r12f gets to HA_Mgr please :) |
src/sonic-bgpcfgd/bgpcfgd/main.py
Outdated
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") | ||
#TODO: use swsscommon.STATE_BFD_SOFTWARE_SESSION_TABLE_NAME onces definition is in master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dypet could you update this PR to use swsscommon table as sonic-common PR has been merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
@kperumalbfn changes have been made, not sure if sonic-net/sonic-swss#3406 needs to be merged first or if this one can be merged independently. |
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
Why I did it
As part of this HLD, need to monitor a new STATE_DB table called SOFTWARE_BFD_SESSION_TABLE and add/remove BFD sessions in FRR accordingly: https://github.com/kperumalbfn/SONiC/blob/kperumal/bfd/doc/smart-switch/BFD/SmartSwitchDpuLivenessUsingBfd.md
Work item tracking
How I did it
-Added a new manager managers_bfd.py which is used by bgpcfgd if switch_type is dpu. This manager receives notification any time there is a change on SOFTWARE_BFD_SESSION_TABLE entries, and it calls FRR config CLI to add/remove/update BFD sessions accordingly. Both active and passive sessions along with single-hop or multihop sessions are supported.
How to verify it
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)