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

[fpmsyncd] Add VNET routes support #772

Merged
merged 8 commits into from
Feb 14, 2019
Merged

[fpmsyncd] Add VNET routes support #772

merged 8 commits into from
Feb 14, 2019

Conversation

baiwei0427
Copy link
Contributor

@baiwei0427 baiwei0427 commented Jan 30, 2019

fpmsyncd: Handle VNET routes

Pending items:

  • Parse VRF routes.
  • Identify VXLAN routes using a more general approach
  • Support warm reboot for VNET and VRF routes

Signed-off-by: Wei Bai baiwei0427@gmail.com

Copy link
Collaborator

@prsunny prsunny left a 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.


using namespace std;
using namespace swss;

#define APP_VNET_ROUTE_TABLE_NAME "VNET_ROUTE_TABLE"
Copy link
Collaborator

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]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 45f273e

unsigned int table_index = rtnl_route_get_table(route_obj);

/* Default routing table. This line may have problems. */
if (table_index == RT_TABLE_UNSPEC) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use new line for {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in cdb3d96

onRouteMsg(nlmsg_type, obj);

/* VNET route */
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above


vector<FieldValueTuple> fvVector;
FieldValueTuple nh("nexthop", nexthops);
FieldValueTuple idx("ifname", ifnames);
FieldValueTuple nh("nexthop", gw_ips);
Copy link
Collaborator

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!

Copy link
Contributor Author

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))
Copy link
Collaborator

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.

Copy link
Contributor Author

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?

Copy link
Collaborator

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.

Copy link
Contributor Author

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)
Copy link
Collaborator

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

Copy link
Contributor Author

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

@baiwei0427
Copy link
Contributor Author

retest this please

@baiwei0427 baiwei0427 changed the title [fpmsyncd] Add VNET/VXLAN support [fpmsyncd] Add VNET routes support Feb 12, 2019
@lguohan
Copy link
Contributor

lguohan commented Feb 14, 2019

retest this please

@lguohan
Copy link
Contributor

lguohan commented Feb 14, 2019

retest this please

@lguohan lguohan merged commit 52de963 into sonic-net:master Feb 14, 2019
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
…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>
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.

3 participants