-
Notifications
You must be signed in to change notification settings - Fork 554
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]: Extend the SRv6Orch to support the programming of the L3Adj #2902
Conversation
Extend the SRv6Orch to support the programming of the L3Adj associated with SRv6 uA, End.X, uDX4, uDX6, End.DX4, and End.DX6 behaviors. Signed-off-by: Carmine Scarpitta <[email protected]>
Add unit tests for several SRv6 behaviors: uA, uDX4, uDX6, End.X, End.DX4, End.DX6 Signed-off-by: Carmine Scarpitta <[email protected]>
dd936e5
to
81eb9ef
Compare
Signed-off-by: Carmine Scarpitta <[email protected]>
Signed-off-by: Carmine Scarpitta <[email protected]>
@prsunny @kperumalbfn could you please help and review the code of this PR? |
@kperumalbfn to review/signoff |
orchagent/srv6orch.cpp
Outdated
SWSS_LOG_INFO("Neighbor ADD event: %s, installing pending SRv6 SIDs", | ||
update.entry.ip_address.to_string().c_str()); | ||
|
||
auto it = m_pendingSRv6MySIDEntries.find(NextHopKey(update.entry.ip_address.to_string())); |
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.
The update.entry should contains ip_address + alias,you can't lookup m_pendingSRv6MySIDEntries with only ip_address.
Two neighbors may has same ip_address and different alias.
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.
@shuaishang I changed the code to use ip_address + alias as key when performing the lookup in m_pendingSRv6MySIDEntries
.
if (mySidNextHopRequired(end_behavior)) | ||
{ | ||
sai_object_id_t next_hop_id; | ||
nexthop = NextHopKey(adj); |
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.
should we return error if this adj is ECMP as this is not yet supported?
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.
@kperumalbfn I added a check to return an error if the adj is ECMP: 6bb9fe2
elif fv[0] == "SAI_MY_SID_ENTRY_ATTR_ENDPOINT_BEHAVIOR_FLAVOR": | ||
assert fv[1] == "SAI_MY_SID_ENTRY_ENDPOINT_BEHAVIOR_FLAVOR_PSP_AND_USD" | ||
|
||
# create MySID END.DX6 |
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 add a testcase that tests neighbor add/delete/update after adding mysid entry that covers m_pendingSRv6MySIDEntries update and delete and iterate over all the mysid entries for the neighbor 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.
@kperumalbfn I added the test case as requested: 2e9485c
orchagent/srv6orch.cpp
Outdated
* when the neighbor comes back | ||
*/ | ||
auto pending_mysid_entry = make_tuple(my_sid_string, dt_vrf, adj, end_action); | ||
m_pendingSRv6MySIDEntries[NextHopKey(update.entry.ip_address.to_string())].insert(pending_mysid_entry); |
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.
NextHopKey with ip_address and interface?? Check all the other places where m_pendingSRv6MySIDEntries dictionary is accessed.
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.
@kperumalbfn Fixed. I changed the code to use ip_address + alias as key when performing the lookup in m_pendingSRv6MySIDEntries.
orchagent/srv6orch.cpp
Outdated
next_hop_id = m_neighOrch->getNextHopId(nexthop); | ||
if(next_hop_id == SAI_NULL_OBJECT_ID) | ||
{ | ||
SWSS_LOG_ERROR("Failed to get nexthop for adjacency %s", adj.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.
What's the reason that you don't add it to pending list?
Would it be better to let it retry?
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.
@eddieruan-alibaba Agree. I changed the code to add the SID to the pending list: b4c557f
When installing a SID associated with a L3Adj, check if the L3Adj is ECMP. If the L3Adj is ECMP, returns an error, because ECMP is not yet supported. Signed-off-by: Carmine Scarpitta <[email protected]>
Signed-off-by: Carmine Scarpitta <[email protected]>
Signed-off-by: Carmine Scarpitta <[email protected]>
If SID installation fails due to nexthop not available, add the SID to the pending SIDs list and retry when the nexthop becomes available Signed-off-by: Carmine Scarpitta <[email protected]>
Signed-off-by: Carmine Scarpitta <[email protected]>
Verify that the MySID is installed as soon as the associated neighbor (L3 Adjacency) is ready. Signed-off-by: Carmine Scarpitta <[email protected]>
@kperumalbfn @eddieruan-alibaba @shuaishang Many thanks for the review. All comments have been addressed. |
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.
LGTM
Hi @prsunny, the PR has been approved by @kperumalbfn . It is ready for merge, could you please merge it ? |
Hi @prsunny This PR has been reviewed and approved. It is ready for merge. Could you please merge the PR? |
/azp run |
Commenter does not have sufficient privileges for PR 2902 in repo sonic-net/sonic-swss |
/azpw run |
/AzurePipelines run |
Azure Pipelines successfully started running 1 pipeline(s). |
What I did
Extended the SRv6Orch to support the programming of the L3Adj associated with SRv6 uA, End.X, uDX4, uDX6, End.DX4, and End.DX6 behaviors.
HLD: sonic-net/SONiC#1472
Why I did it
The current implementation of SRv6Orch does not process the L3Adj.
How I verified it
Added new test cases to test_srv6.py