[Orchagent] Recursive nexthop group enhancement#3105
[Orchagent] Recursive nexthop group enhancement#3105srj102 merged 5 commits intosonic-net:masterfrom
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.
Can we use NHG_DELIMITER instead of ","
orchagent/nhgorch.cpp
Outdated
| if (nhgs.empty()) | ||
| nhgs = nhgm; | ||
| else | ||
| nhgs += ',' + nhgm; |
There was a problem hiding this comment.
Can we use NHG_DELIMITER instead of ","
| 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.
Instead of assert can we handle as exception?
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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.
Do we need to throw a warning if ipv.size() is non-zero when is_recursive is set?
| } | ||
| nhg_str += ipv[i] + NH_DELIMITER + alsv[i]; | ||
| } | ||
|
|
There was a problem hiding this comment.
Can we add a SWSS_LOG_DEBUG for nhg_str?
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.
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. * 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. * 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. * 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. * Addressed review comments
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