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

BFD Tx, Rx interval support for Vnet Monitored routes. #3335

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

siqbal1986
Copy link
Contributor

What I did
This change add support for
rx_monitor_timer
tx_monitor_timer
check_directly_connected

Why I did it
This change is beneficial because it adds support for BFD Tx, Rx interval for Vnet Monitored routes as required by DASH project.
How I verified it
Added a unit test to verify the functionality.
Details if related
The Tx and Rx values are added on per-route basis. Therefore the same values are used for each nexthop. if the user needs to se different values for each next hop then they can add the values and nexthops incrementally.
e.g.

Add route with nexthop 10.0.0.1(1s,1s) -> BFD(10.0.0.1) with Tx =1s Rx= 1s
Update same route and add another nexthop 10.0.0.2(2s,2s) -> BFD(10.0.0.1) with Tx =1s Rx= 1s |  BFD(10.0.0.2) with Tx =2s Rx= 2s

The user can also update these values by selectively removing and readding a nexthop with different Tx and Rx values.

Copy link

Commenter does not have sufficient privileges for PR 3335 in repo sonic-net/sonic-swss

@siqbal1986
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -1857,6 +1859,13 @@ void VNetRouteOrch::createBfdSession(const string& vnet, const NextHopKey& endpo
// when the device goes into TSA. The following parameter ensures that these session are
// brought down while transitioning to TSA and brought back up when transitioning to TSB.
data.emplace_back("shutdown_bfd_during_tsa", "true");
if (has_monitor_interval)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a note that without tx/rx interval in the DB, BFD session will use the default timers BFD_SESSION_DEFAULT_TX_INTERVAL and BFD_SESSION_DEFAULT_RX_INTERVAL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill add it.

@@ -1080,6 +1080,7 @@ bool VNetRouteOrch::doRouteTask<VNetVrfObject>(const string& vnet, IpPrefix& ipP
NextHopGroupKey& nexthops, string& op, string& profile,
const string& monitoring, NextHopGroupKey& nexthops_secondary,
const IpPrefix& adv_prefix,
bool check_directly_connected,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check will be added later, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@@ -1857,6 +1859,13 @@ void VNetRouteOrch::createBfdSession(const string& vnet, const NextHopKey& endpo
// when the device goes into TSA. The following parameter ensures that these session are
// brought down while transitioning to TSA and brought back up when transitioning to TSB.
data.emplace_back("shutdown_bfd_during_tsa", "true");
if (has_monitor_interval)
{
FieldValueTuple fvTuple1("tx_interval", to_string(tx_monitor_interval));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include sonic-mgmt tests with Rx/Tx timer to check if these are supported by vendor SAI for BFD hardware offload.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ill add those tests after I have made the changes for directly connected nexthops.

intervals.tx_monitor_timer = tx_monitor_timer;
prefix_to_monitor_intervals_[ip_pfx] = intervals;
}
if ( op == DEL_COMMAND)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space

@@ -2620,6 +2641,10 @@ bool VNetRouteOrch::handleTunnel(const Request& request)
swss::IpPrefix adv_prefix;
bool has_priority_ep = false;
bool has_adv_pfx = false;
bool has_monitor_intervals = false;
uint64_t rx_monitor_timer = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these must be initialized to defaults instead of 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants