-
Notifications
You must be signed in to change notification settings - Fork 531
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
[vnetorch] Add ECMP support for vnet tunnel routes #1960
Conversation
orchagent/vnetorch.cpp
Outdated
@@ -1066,18 +1346,48 @@ bool VNetRouteOrch::handleTunnel(const Request& request) | |||
} | |||
} | |||
|
|||
if (!vni_list.empty() && vni_list.size() != ip_list.size()) |
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.
These conditions need not be true. There could be empty comma separated list as VNI and MAC are optional fields
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.
I thought these conditions are required. The field should be either empty or the match in length. Otherwise, it would be impossible to match the fields with endpoints. For example, if the endpoint had three addresses, the vni field should be one of the choices: empty; 0,0,0
(three valid values); 0,,
(comma separated empty values). The field should not be something like 0,1
since it would be impossible to figure which endpoint it corresponds to.
I also noticed that the current implementation of request parser cannot handle the case of comma-separated empty values. Therefore, I updated the value type of mac and vni such to string so that we can tokenize the values and handle them in vnetorch.
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 support for multiple endpoints to share the same vni in the latest commit.
orchagent/vnetorch.cpp
Outdated
uint32_t vni = 0; | ||
vector<IpAddress> ip_list; | ||
vector<MacAddress> mac_list; | ||
vector<uint64_t> vni_list; |
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 this be uint32?
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 the vni field type and made it to uint32.
orchagent/vnetorch.cpp
Outdated
} | ||
else | ||
{ | ||
vrf_obj->removeRoute(ipPrefix); | ||
SWSS_LOG_ERROR("Unknown operation"); |
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 remove this and have the DEL as else part. We don't get any other operations in this flow
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.
Agree, removed this part.
orchagent/vnetorch.cpp
Outdated
{ | ||
if (op == SET_COMMAND && !add_route(vr_id, pfx, nh_id)) | ||
sai_object_id_t nh_id; | ||
/* The route in pointing to one single endpoint */ |
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.
is -> typo
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 for pointing it out. Fixed.
orchagent/vnetorch.cpp
Outdated
next_hop_group_entry.active_members[nexthop] = SAI_NULL_OBJECT_ID; | ||
syncd_nexthop_groups_[vnet][nexthops] = next_hop_group_entry; | ||
} | ||
else { |
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.
{ -> new line
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 as suggested.
|
||
if (op == SET_COMMAND) | ||
if (it_route != syncd_tunnel_routes_[vnet].end()) |
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 some comments for this if case
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 comments for this part.
orchagent/vnetorch.h
Outdated
@@ -12,6 +12,8 @@ | |||
#include "ipaddresses.h" | |||
#include "producerstatetable.h" | |||
#include "observer.h" | |||
#include "intfsorch.h" |
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 if not used
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.
Removed.
vnet_obj.fetch_exist_entries(dvs) | ||
assert nhg1_1 not in vnet_obj.nhgs | ||
|
||
# Create another tunnel route to the same set of endpoints |
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.
add one case for IPv4 prefix over IPv6 endpoints in this same test 8
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 a test case as suggested.
{ "endpoint", REQ_T_IP_LIST }, | ||
{ "ifname", REQ_T_STRING }, | ||
{ "nexthop", REQ_T_STRING }, | ||
{ "vni", REQ_T_STRING }, |
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.
Just thinking, if this has any backward compatibility issue?
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.
I do not think it would, since we will convert it to the right format. I think the only difference is to process the values in the request parser or vnetorch.
@@ -790,7 +902,7 @@ def test_vnet_orch_1(self, dvs, testlog): | |||
vnet_obj.check_del_vnet_routes(dvs, 'Vnet_2001') | |||
|
|||
delete_vnet_routes(dvs, "100.100.1.1/32", 'Vnet_2000') | |||
vnet_obj.check_del_vnet_routes(dvs, 'Vnet_2001') | |||
vnet_obj.check_del_vnet_routes(dvs, 'Vnet_2000') |
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.
Why is this changed?
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.
I still believe this seems more like a typo, though I do not recall how I noticed this (maybe I added some more checks in the function and the test case failed). As we just removed a route from Vnet_2000
, why do we want to check deleted route in Vnet_2001
? I checked other calls of the same function and nowhere else use it in this way. I think it passed previously only because check_del_vnet_routes
did not really check anything.
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.
ok
@dgsudharsan , got to know that you were reviewing the PR. Please feel free to provide comments and we can address in a separate PR |
What I did Add functions to create/remove next hop groups for vnet tunnel routes. Count the reference count of next hop groups to create and remove as needed. Share the counter of next hop groups with routeorch. Add vs test Why I did it To add support for overlay ECMP. How I verified it Verify ECMP groups are properly created and removed with the functions. Verify vs test passes
What I did Add functions to create/remove next hop groups for vnet tunnel routes. Count the reference count of next hop groups to create and remove as needed. Share the counter of next hop groups with routeorch. Add vs test Why I did it To add support for overlay ECMP. How I verified it Verify ECMP groups are properly created and removed with the functions. Verify vs test passes
What I did Add functions to create/remove next hop groups for vnet tunnel routes. Count the reference count of next hop groups to create and remove as needed. Share the counter of next hop groups with routeorch. Add vs test Why I did it To add support for overlay ECMP. How I verified it Verify ECMP groups are properly created and removed with the functions. Verify vs test passes
@prsunny Cisco requested this PR for 202012 branch, could you review and recommend next steps/add the necessary labels? |
…oint health monitoring (#2104) What I did Cherry-pick changes in #1960, #1883, #1955, #2058 Changes in #1960: Add functions to create/remove next hop groups for vnet tunnel routes. Count the reference count of next hop groups to create and remove as needed. Share the counter of next hop groups with routeorch. Add vs test Changes in #1883: Implement bfdorch to program hardware BFD sessions via bfd SAI. Add vs test for bfd sessions. Changes in #1955: Add functions to create/remove next hop groups for vnet tunnel routes. Count the reference count of next hop groups to create and remove as needed. Share the counter of next hop groups with routeorch. Adapt route endpoint according to the BFD state of endpoints. Changes in #2058: Advertise active vnet tunnel routes. Why I did it To add support for overlay ECMP with endpoint health monitoring.
What I did
Add functions to create/remove next hop groups for vnet tunnel routes.
Count the reference count of next hop groups to create and remove as needed.
Share the counter of next hop groups with routeorch.
Add vs test
Why I did it
To add support for overlay ECMP.
How I verified it
Verify ECMP groups are properly created and removed with the functions.
Verify vs test passes
Details if related