-
Notifications
You must be signed in to change notification settings - Fork 537
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
[Orchagent] Recursive nexthop group enhancement #3105
Conversation
f5d145d
to
69c204f
Compare
/azpw run Azure.sonic-swss |
/AzurePipelines run Azure.sonic-swss |
Azure Pipelines successfully started running 1 pipeline(s). |
d54cd50
to
11379cf
Compare
orchagent/nhgorch.cpp
Outdated
} | ||
|
||
/* Form nexthopgroup key with the nexthopgroup keys of available members */ | ||
nhgv = tokenize(nhgs, ','); |
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 we use NHG_DELIMITER instead of ","
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
orchagent/nhgorch.cpp
Outdated
if (nhgs.empty()) | ||
nhgs = nhgm; | ||
else | ||
nhgs += ',' + nhgm; |
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 we use NHG_DELIMITER instead of ","
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
@@ -687,6 +807,9 @@ bool NextHopGroup::syncMembers(const std::set<NextHopKey>& nh_keys) | |||
{ | |||
SWSS_LOG_ENTER(); | |||
|
|||
/* This method should not be called for single-membered non-recursive nexthop groups */ | |||
assert(isRecursive() || (m_members.size() > 1)); |
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.
Instead of assert can we handle as exception?
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 is in-line with similar error handling elsewhere in the code. We do not have a way to gracefully handle once we end up here for a non-recursive singleton nhg. There are necessary checks in caller fn.
*/ | ||
if (m_is_temp) | ||
/* If the group is non-recursive with single member, the group ID will be the only member's NH ID */ | ||
if (!isRecursive() && (m_members.size() == 1)) |
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.
Do we need m_is_temp check?
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.
That'll be redundant as the current check will be true for "temp" nhgs as well.
orchagent/nhgorch.cpp
Outdated
{ | ||
nh_id = gIntfsOrch->getRouterIntfsId(m_key.alias); | ||
|
||
if ((nh_id == SAI_NULL_OBJECT_ID) && |
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.
We don't consider loopback as nexthop and trap packet to CPU during route add https://github.com/sonic-net/sonic-swss/blob/master/orchagent/routeorch.cpp#L1789, so do we need to add this CPU port for NHG?
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 make the NhgOrch behavior in-line with RouteOrch handling.
But I see an issue where if we receive such a msg, we'll end up holding the msgs in the corres. m_toSync queue(s) till the route is withdrawn.
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.
We install IP2ME for loopback IPs, right? I think, we can safely ignore the message with error log if we get a NHG with loopback interface.
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 the NHG is not created, the route msg will be retained waiting for the NHG. This may require creating a dummy NHG with just the key so that route msg can also be ignored.
This should be addressed in both the NhgOrch and RouteOrch as a defect fix.
for (uint32_t i = 0; i < ipv.size(); i++) | ||
/* Keeps track of any non-existing member of a recursive nexthop group */ | ||
bool non_existent_member = 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.
Do we need to throw a warning if ipv.size() is non-zero when is_recursive is set?
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
} | ||
nhg_str += ipv[i] + NH_DELIMITER + alsv[i]; | ||
} | ||
|
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 we add a SWSS_LOG_DEBUG for nhg_str?
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
4f972b0
to
166785d
Compare
@venkatmahalingam @Gokulnath-Raja pls signoff if you have no further comments |
Implemented recursive nexthop group enhancement in Orchagent (NhgOrch). They have been proposed in: sonic-net/SONiC#1636 Why I did it: These changes are required to handle a new field - "nexthop_group" in the App DB NEXT_HOP_GROUP_TABLE. Such nexthop groups are called recursive nexthop groups. This field contains the list of member (singleton) nexthop groups. Such recursive nexthop groups are represented by NEXT_HOP_GROUP objects.
Implemented recursive nexthop group enhancement in Orchagent (NhgOrch). They have been proposed in: sonic-net/SONiC#1636 Why I did it: These changes are required to handle a new field - "nexthop_group" in the App DB NEXT_HOP_GROUP_TABLE. Such nexthop groups are called recursive nexthop groups. This field contains the list of member (singleton) nexthop groups. Such recursive nexthop groups are represented by NEXT_HOP_GROUP objects.
Implemented recursive nexthop group enhancement in Orchagent (NhgOrch). They have been proposed in: sonic-net/SONiC#1636 Why I did it: These changes are required to handle a new field - "nexthop_group" in the App DB NEXT_HOP_GROUP_TABLE. Such nexthop groups are called recursive nexthop groups. This field contains the list of member (singleton) nexthop groups. Such recursive nexthop groups are represented by NEXT_HOP_GROUP objects.
Implemented recursive nexthop group enhancement in Orchagent (NhgOrch). They have been proposed in: sonic-net/SONiC#1636 Why I did it: These changes are required to handle a new field - "nexthop_group" in the App DB NEXT_HOP_GROUP_TABLE. Such nexthop groups are called recursive nexthop groups. This field contains the list of member (singleton) nexthop groups. Such recursive nexthop groups are represented by NEXT_HOP_GROUP objects.
166785d
to
0788fc1
Compare
/* A NHG should not have both regular(ip/alias) and recursive fields */ | ||
if (is_recursive && (!ips.empty() || !aliases.empty())) | ||
{ | ||
SWSS_LOG_ERROR("Nexthop group %s has both regular(ip/alias) and recursive fields", index.c_str()); |
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 we move this to info 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.
Since the nexthop-group is not created due to this check, it's better to log this as error.
Besides, there might be two issues that:
|
Hi @goomadao Thanks for the comments. Please find below my response:
|
@utpalkantpintoo Thanks for your explanation. You're right, I missed that there is an upper application where the update could be triggered. Could you please take a look at the pending review I raised before? I still can't figure out any situation to get into those two conditions. |
What I did
Implemented recursive nexthop group enhancement in Orchagent (NhgOrch). They have been proposed in:
sonic-net/SONiC#1636
Why I did it
These changes are required to handle a new field - "nexthop_group" in the App DB NEXT_HOP_GROUP_TABLE. Such nexthop groups are called recursive nexthop groups. This field contains the list of member (singleton) nexthop groups. Such recursive nexthop groups are represented by NEXT_HOP_GROUP objects.
How I verified it
Details if related