-
Notifications
You must be signed in to change notification settings - Fork 529
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
[fpmsyncd] Add VNET routes support #772
Conversation
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 find my initial review comments.
fpmsyncd/routesync.cpp
Outdated
|
||
using namespace std; | ||
using namespace swss; | ||
|
||
#define APP_VNET_ROUTE_TABLE_NAME "VNET_ROUTE_TABLE" |
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 are defined in schema.h
. Please use those. It is already included here as part of "producerstatetable.h"
[APP_VNET_RT_TABLE_NAME, APP_VNET_RT_TUNNEL_TABLE_NAME
]
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.
Fixed in 45f273e
fpmsyncd/routesync.cpp
Outdated
unsigned int table_index = rtnl_route_get_table(route_obj); | ||
|
||
/* Default routing table. This line may have problems. */ | ||
if (table_index == RT_TABLE_UNSPEC) { |
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.
Use new line 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.
Fixed in cdb3d96
fpmsyncd/routesync.cpp
Outdated
onRouteMsg(nlmsg_type, obj); | ||
|
||
/* VNET route */ | ||
} 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.
Same as above
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 as above
fpmsyncd/routesync.cpp
Outdated
|
||
vector<FieldValueTuple> fvVector; | ||
FieldValueTuple nh("nexthop", nexthops); | ||
FieldValueTuple idx("ifname", ifnames); | ||
FieldValueTuple nh("nexthop", gw_ips); |
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 don't we use the same names which is almost same as new? Less diffs to review!
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.
Fixed in 149b954
char vrf_name[IFNAMSIZ] = {0}; | ||
|
||
/* If we cannot get the VRF name */ | ||
if (!getIfName(vrf_index, vrf_name, IFNAMSIZ)) |
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.
Not sure if we want to proceed if vrf_name
is unknown. Orchagent checks for the VRF state and if not found, it just keeps retrying. I would think this is an exceptional 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.
@prsunny Do you mean the function should immediately return if it cannot get the VRF name?
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.
Yes, my point is, we got a route update on a VRF but the VRF device is not found/deleted. In this case, I would suggest to log error and return.
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.
Fixed in d865382
unsigned int table_index = rtnl_route_get_table(route_obj); | ||
|
||
/* Default routing table. This line may have problems. */ | ||
if (table_index == RT_TABLE_UNSPEC) |
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.
This could be unsafe to classify every other routes to be VNET. As we discussed, it would be safe if we can use the id range check for table index
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.
Will address this in the future
retest this please |
retest this please |
retest this please |
…ts (sonic-net#772) * [fwutil]: initial version. Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com> * [fwutil]: Fix UI: enable progressbar render finalizer. Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com> * [fwutil]: integrate utility with SONiC CLI. Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com> * [fwutil]: update CLI command reference documentation. Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com> * [fwutil]: Revisit CLI architecture: avoid direct imports. Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com> * [fwutil]: Fix review comments: refactor CLI command reference. Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com> * [fwutil]: Fix review comments: update CLI documentation. Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
fpmsyncd: Handle VNET routes
Pending items:
Signed-off-by: Wei Bai baiwei0427@gmail.com