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

[orchagent]: Extend the SRv6Orch to support the programming of the L3Adj #2902

Merged
merged 17 commits into from
Nov 22, 2023

Conversation

cscarpitta
Copy link
Contributor

@cscarpitta cscarpitta commented Sep 13, 2023

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

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]>
@ahsalam
Copy link

ahsalam commented Oct 14, 2023

@prsunny @kperumalbfn could you please help and review the code of this PR?
This feature is tracked for 202311 release and documented by this HLD sonic-net/SONiC#1472
@zhangyanzhao

@prsunny
Copy link
Collaborator

prsunny commented Oct 24, 2023

@prsunny @kperumalbfn could you please help and review the code of this PR? This feature is tracked for 202311 release and documented by this HLD sonic-net/SONiC#1472 @zhangyanzhao

@kperumalbfn to review/signoff

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()));
Copy link
Contributor

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.

Copy link
Contributor Author

@cscarpitta cscarpitta Oct 27, 2023

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);
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

@kperumalbfn kperumalbfn Oct 25, 2023

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.

Copy link
Contributor Author

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

* 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);
Copy link
Contributor

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.

Copy link
Contributor Author

@cscarpitta cscarpitta Oct 27, 2023

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.

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());

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?

Copy link
Contributor Author

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

cscarpitta and others added 7 commits October 27, 2023 01:43
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]>
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]>
@cscarpitta
Copy link
Contributor Author

@kperumalbfn @eddieruan-alibaba @shuaishang Many thanks for the review. All comments have been addressed.

Copy link
Contributor

@kperumalbfn kperumalbfn left a comment

Choose a reason for hiding this comment

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

LGTM

@ahsalam
Copy link

ahsalam commented Nov 13, 2023

Hi @prsunny, the PR has been approved by @kperumalbfn . It is ready for merge, could you please merge it ?
The HLD has been already merged.

@cscarpitta
Copy link
Contributor Author

Hi @prsunny This PR has been reviewed and approved. It is ready for merge. Could you please merge the PR?

@cscarpitta
Copy link
Contributor Author

/azp run

Copy link

Commenter does not have sufficient privileges for PR 2902 in repo sonic-net/sonic-swss

@cscarpitta
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prsunny prsunny merged commit b8841ec into sonic-net:master Nov 22, 2023
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.

7 participants