-
Notifications
You must be signed in to change notification settings - Fork 539
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
Added Change for given Route ECMP to fallback on Default Route ECMP #3389
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Abhishek Dosi <[email protected]>
Signed-off-by: Abhishek Dosi <[email protected]>
Signed-off-by: Abhishek Dosi <[email protected]>
orchagent/routeorch.cpp
Outdated
|
||
if (default_nhg_key.getSize() == 1) | ||
{ | ||
current_default_route_nhops.insert(*default_nhg_key.getNextHops().begin()); |
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.
nit: indentation #Closed
|
||
if (nhopgroup->second.nh_member_install_count == 0 && nhopgroup->second.eligible_for_default_route_nh_swap && !nhopgroup->second.is_default_route_nh_swap) | ||
{ | ||
if(nexthop.ip_address.isV4()) |
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.
if at this time the default route from bgp is not present. will the v4_active_default_route_nhops
have the drop port?
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.
@arlakshm : if no default route than existing behavior will happen where nexthop group will not have any members which will cause drop as expected.
{ | ||
if (ip_prefix.isV4()) |
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.
nit: indentation #Resolved
orchagent/routeorch.cpp
Outdated
@@ -673,6 +761,10 @@ void RouteOrch::doTask(Consumer& consumer) | |||
{ | |||
ctx.protocol = fvValue(i); | |||
} | |||
if (fvField(i) == "fallback_to_default_route") | |||
{ |
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.
fix indentation. mix of tabs and spaces #Closed
orchagent/routeorch.cpp
Outdated
if (fvField(i) == "fallback_to_default_route") | ||
{ | ||
fallback_to_default_route = fvValue(i) == "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.
fix indentation. mix of tabs and spaces #Closed
orchagent/routeorch.cpp
Outdated
@@ -1067,9 +1174,19 @@ void RouteOrch::doTask(Consumer& consumer) | |||
} | |||
else if (m_syncdNextHopGroups[it_nhg.first].ref_count == 0) | |||
{ | |||
removeNextHopGroup(it_nhg.first); | |||
// Pass the flag to indicate if the NextHop Group as Default Route NH Members as swapped. | |||
removeNextHopGroup(it_nhg.first, m_syncdNextHopGroups[it_nhg.first].is_default_route_nh_swap); |
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.
fix indentation #Resolved
orchagent/routeorch.cpp
Outdated
updateDefaultRouteSwapSet(v4_default_nhg_key, v4_active_default_route_nhops); | ||
|
||
if (v6_default_nhg_key.getSize()) | ||
updateDefaultRouteSwapSet(v6_default_nhg_key, v6_active_default_route_nhops); |
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.
fix indentation #Resolved
orchagent/routeorch.h
Outdated
|
||
std::string key; // Key in database table | ||
std::string protocol; // Protocol string | ||
bool is_set; // True if set operation | ||
|
||
RouteBulkContext(const std::string& key, bool is_set) | ||
: key(key), excp_intfs_flag(false), using_temp_nhg(false), is_set(is_set) | ||
: key(key), excp_intfs_flag(false), using_temp_nhg(false), is_set(is_set), | ||
fallback_to_default_route(false) |
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.
mix of tabs and spaces #Closed
orchagent/routeorch.h
Outdated
@@ -146,6 +152,7 @@ struct RouteBulkContext | |||
using_temp_nhg = false; | |||
key.clear(); | |||
protocol.clear(); | |||
fallback_to_default_route = false; |
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.
remove tabs #Closed
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.
/Azp run Azure.sonic-swss
Signed-off-by: Abhishek Dosi <[email protected]>
Signed-off-by: Abhishek Dosi <[email protected]>
Signed-off-by: Abhishek Dosi <[email protected]>
Signed-off-by: Abhishek Dosi <[email protected]>
/Azp run Azure.sonic-swss |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
lgtm
This reverts commit 8d2d008.
Signed-off-by: Abhishek Dosi <[email protected]>
Signed-off-by: Abhishek Dosi <[email protected]>
…into default-route
@@ -188,7 +204,7 @@ | |||
ntf.send("bfd_session_state_change", ntf_data, fvp) | |||
# BFD utilities for static route BFD and ecmp acceleration -- end | |||
|
|||
def init_test(self, dvs, num_intfs): | |||
def init_test(self, dvs, num_intfs, is_ipv6_needed=False): |
Check notice
Code scanning / CodeQL
Mismatch between signature and use of an overridden method Note test
call
method TestNhgExhaustBase.init_test
Overridden method signature does not match
call
method TestNhgExhaustBase.init_test
Overridden method signature does not match
call
method TestNhgOrchNhgExhaust.init_test
Overridden method signature does not match
call
method TestNhgOrchNhgExhaust.init_test
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.
Few questions on approach:
- Why don't we simply delete the route if NHGroup is empty for a route and this option is set?
- Why not reuse the default route NHgroup instead of creating a new one?
} | ||
} | ||
|
||
if (!(v4_default_nhg_key.getSize()) && !(v6_default_nhg_key.getSize())) |
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 {
for if checks
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
@@ -2506,6 +2645,11 @@ bool RouteOrch::removeRoutePost(const RouteBulkContext& ctx) | |||
updateDefRouteState(ipPrefix.to_string()); | |||
|
|||
SWSS_LOG_INFO("Set route %s next hop ID to NULL", ipPrefix.to_string().c_str()); | |||
|
|||
if (ipPrefix.isV4()) |
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 for {
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 (default_nhg_key.getSize() == 1) | ||
{ | ||
current_default_route_nhops.insert(*default_nhg_key.getNextHops().begin()); |
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.
fix indentation
@@ -673,6 +761,10 @@ void RouteOrch::doTask(Consumer& consumer) | |||
{ | |||
ctx.protocol = fvValue(i); | |||
} | |||
if (fvField(i) == "fallback_to_default_route") |
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.
who sets this attribute?
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 being done here: #3353
Signed-off-by: Abhishek Dosi <[email protected]>
Signed-off-by: Abhishek Dosi <[email protected]>
/azp run Azure.sonic-swss |
Azure Pipelines successfully started running 1 pipeline(s). |
What I did:
Added Change for given Route ECMP to fallback on Default Route ECMP. When all the Members of Route are Link Down and if route is eligible for fallback to default route the ECMP Member in SAI Nexthop Goup are updated to the Default Route Nexthop/Nexthop's Members.
This change does not take care of this scenarios:
When the Route which is fallback on Default Route Nexthops if the original nexthop become active [link comes up] it does not move back to original path. Reason is we except this should transient case as the Route which is fallback should get deleted once all the links are down
If Default Routes gets updated [BGP Updates] or if default Route nexthops become link down we do not update ECMP members of Routes that are already fallback to default. Again Reason being Route which is fallback should get deleted once all the links are down and is during this short window getting default routes update is very corner case. We can optimize if needed.
Why I did:
For Faster of Traffic Convergence for Routes where it is ok to send traffic over default route when most specific prefix/route do not have any valid nexthops for transient time before more specific route gets deleted.
How I verified:
UT updated
Ixia based Traffic Convergance.