-
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
Changes to read route tag value from Netlink Message and take appropriate action #3353
base: master
Are you sure you want to change the base?
Conversation
routesync.cpp. In routesyncd we read tag from constants.yml and take action of not to send route to appdb and also fallback to default route. Signed-off-by: Abhishek Dosi <[email protected]>
@prsunny : can you help review this. |
fpmsyncd/routesync.cpp
Outdated
catch (const exception &e) | ||
{ | ||
cout << "Exception \"" << e.what() << "\" had been thrown in daemon in loading constants.yml" << endl; | ||
route_tag_not_to_appdb = 0; |
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.
Non T2 devices might always print the exception log?
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.
only if fails to reads constants.yml which should not happen. this attribute are define in constants.yml (irrespective of the role)
https://github.com/sonic-net/sonic-buildimage/pull/20224/files#diff-e6f2fe13a6c276dc2f3b27a5bef79886f9c103194be4fcb28ce57375edf2c23c
@@ -693,6 +710,13 @@ void RouteSync::onRouteMsg(int nlmsg_type, struct nl_object *obj, char *vrf) | |||
destipprefix[strlen(vrf)] = ':'; | |||
} | |||
|
|||
tag = rtnl_route_get_priority(route_obj); | |||
|
|||
if (tag == route_tag_not_to_appdb) |
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.
As I understand on pizza box, route_tag_not_to_appdb
is zero. If for any route the priority is zero then route will not be added to app_db. So the route will always has non-zero priority?
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 should not be zero. It always reads from constants.yml. Only time this will be zero in case of fail condition of loading/reading the file.
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 should not be zero. It always reads from constants.yml. Updated the fail case to be non-zero as
0xffffffff
fpmsyncd/routesync.cpp
Outdated
if (tag == route_tag_not_to_appdb) | ||
return; | ||
else if (tag == route_tag_fallback_to_default_route) | ||
route_eligible_for_fallback_to_default_route = 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.
nit: indentation is wrong
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.
Signed-off-by: Abhishek Dosi <[email protected]>
Signed-off-by: Abhishek Dosi <[email protected]>
* Added package to compile and link yaml parser in C++ * Update Dockerfile.j2 To compile and link changes done in PR: sonic-net/sonic-swss#3353 --------- Signed-off-by: Abhishek Dosi <[email protected]>
Signed-off-by: Abhishek Dosi <[email protected]>
/debs/libsaivs_1.0.0_amd64.deb \ | ||
/debs/syncd-vs_1.0.0_amd64.deb \ | ||
/debs/swss_1.0.0_amd64.deb | ||
RUN apt-get update |
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 you please explain motivation for this change?
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.
@dgsudharsan : To resolve lyaml-cpp
dependency of swss debian package. As apt install
take care of resolve all dependency
@@ -1714,6 +1738,12 @@ void RouteSync::onRouteMsg(int nlmsg_type, struct nl_object *obj, char *vrf) | |||
fvVector.push_back(wt); | |||
} | |||
|
|||
if (route_eligible_for_fallback_to_default_route) | |||
{ | |||
FieldValueTuple tag("fallback_to_default_route", "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.
Where is this field processed?
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.
@dgsudharsan : Here #3389
What I did:
Added support to compile and load code to read yaml file in
routesync.cpp. In routesyncd we read tag from constants.yml and take action
of not to send route to appdb and also fallback to default route.
Why I did:
Corresponding PR on FRR : sonic-net/sonic-buildimage#20692 to send route tag to fpmsyncd.
PR to specify constants.yml tag value: sonic-net/sonic-buildimage#20224
PR for installing libyaml package: sonic-net/sonic-buildimage#20698