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

[SRv6] Add support for SRv6 VPN #3293

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

shuaishang
Copy link

What I did
[HLD] SRv6 VPN HLD

Why I did it
This PR is to support SRv6 VPN functions

How I verified it

  1. sonic-mgmt phoenix wing ptf test plan
  2. orchagent UT (tests/test_srv6.py) in this PR

Details if related
Depends on sonic-swss-common#919

@shuaishang shuaishang requested a review from prsunny as a code owner September 20, 2024 03:56
@StormLiangMS
Copy link
Contributor

/azp run Azure.sonic-swss

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@shuaishang shuaishang force-pushed the project-phoenixwing-srv6-vpn branch from 87f3488 to f24fa65 Compare November 1, 2024 11:37
@shuaishang shuaishang force-pushed the project-phoenixwing-srv6-vpn branch from f24fa65 to 80b439d Compare November 4, 2024 01:28
@yuezhoujk
Copy link

/azp run Azure.sonic-swss

Copy link

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

@yuezhoujk
Copy link

/azp run Azure.sonic-swss

Copy link

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

@shuaishang shuaishang force-pushed the project-phoenixwing-srv6-vpn branch from afc1311 to 290102b Compare November 6, 2024 06:14
@prsunny
Copy link
Collaborator

prsunny commented Nov 7, 2024

How is this related to #3123? Is there any dependency which one to go first?

@prsunny prsunny requested a review from kperumalbfn November 7, 2024 00:14
@shuaishang
Copy link
Author

How is this related to #3123? Is there any dependency which one to go first?

No dependency with #3123.

@eddieruan-alibaba
Copy link

@prsunny @kperumalbfn @lguohan

Can you help to review and close this PR?

@shuaishang shuaishang force-pushed the project-phoenixwing-srv6-vpn branch from 15400fb to 1d02012 Compare November 19, 2024 12:15
@kperumalbfn
Copy link
Contributor

@shuaishang could you rebase with the latest master branch and check all VS test failures.

orchagent/nexthopgroupkey.h Outdated Show resolved Hide resolved
orchagent/nexthopkey.h Outdated Show resolved Hide resolved
}
else
{
srv6_nh = k.is_srv6_nexthop();
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 include VPN SID for the mismatch? I believe there shouldn't be any mix of NHs.

Copy link
Author

@shuaishang shuaishang Nov 20, 2024

Choose a reason for hiding this comment

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

There is no "vpn_sid" field in "APP_NEXTHOP_GROUP_TABLE_NAME" for nhgorch.
So don't need to check mismatch for VPN SID.

orchagent/routeorch.cpp Outdated Show resolved Hide resolved
@shuaishang shuaishang force-pushed the project-phoenixwing-srv6-vpn branch 4 times, most recently from 8c5b903 to 61fdcef Compare November 20, 2024 07:06
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -115,7 +117,8 @@ struct NextHopKey
{
if (srv6_nh)
{
return ip_address.to_string() + NH_DELIMITER + srv6_segment + NH_DELIMITER + srv6_source;
return ip_address.to_string() + NH_DELIMITER + srv6_segment + NH_DELIMITER + srv6_source + NH_DELIMITER
+ srv6_vpn_sid + NH_DELIMITER;
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @goomadao. But the key would be ending with the delimiter, is that ok?

else if (m_syncdNextHopGroups[it_nhg.first].ref_count == 0)
{
removeNextHopGroup(it_nhg.first);
}
}

/* Reduce reference for srv6 next hop group */
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you provide the reason to decouple 'removeSrv6Nexthops' from 'removeNextHoproup'? How about handling NH removals in addRoutePost?

Copy link

Choose a reason for hiding this comment

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

Because we need to remove srv6 related objects such as tunnels [maps [entries]], aggregate ids & references for sidlists besides the next hop [group] objects. NH removals are done in deleteSrv6Nexthop called by removeSrv6Nexthops.


/* Reduce reference for srv6 next hop group */
/* Later delete for increase refcnt early */
if (!m_bulkSrv6NhgReducedVec.empty())
Copy link
Contributor

Choose a reason for hiding this comment

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

Also for VPN NHs, should we also check context_index refcount to be zero?

Copy link

Choose a reason for hiding this comment

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

Context_index is always empty in this situation because vpn_sids(nexthopgroups) is owned by RouteOrch, not NhgOrch & Srv6Orch.

While deleting pic_context_id in doTaskPicContextTable, zero check will be done for the refcount.

Choose a reason for hiding this comment

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

@kperumalbfn can you review @goomadao 's response.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kperumalbfn
Copy link
Contributor

@abdosi please review and approve.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

10 participants