-
Notifications
You must be signed in to change notification settings - Fork 543
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]: SRv6 VPN SID #2793
[SRv6]: SRv6 VPN SID #2793
Conversation
added more reviewers |
Reviewed in Routing WG weekly meeting 06082023: |
@@ -634,6 +635,13 @@ void RouteOrch::doTask(Consumer& consumer) | |||
if (fvField(i) == "seg_src") | |||
srv6_source = fvValue(i); | |||
|
|||
if (fvField(i) == "vpn_sid" && fvValue(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.
Could you update these new fields in doc/swss-schema.md
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.
fixed
@@ -634,6 +635,13 @@ void RouteOrch::doTask(Consumer& consumer) | |||
if (fvField(i) == "seg_src") | |||
srv6_source = fvValue(i); | |||
|
|||
if (fvField(i) == "vpn_sid" && fvValue(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.
Does this code change handle SRV6 policy referenced in HLD? There is no reference to SRv6_POLICY_TABLE table?
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 PR only includes SRv6 VPN feature, no SRv6 Policy.
orchagent/nexthopkey.h
Outdated
NextHopKey(const std::string &str) : | ||
vni(0), mac_address() | ||
vni(0), mac_address(), | ||
srv6_vpn_sid(""), |
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 the vpn_sid to the end of NH key without affecting the non-VPN NH key?
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.
It will not affect non-VPN NH key, however I moved srv6_vpn_sid to end of NH key.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
orchagent/srv6orch.cpp
Outdated
uint32_t Srv6Orch::getAggId(const NextHopGroupKey &nhg) | ||
{ | ||
SWSS_LOG_ENTER(); | ||
static uint32_t g_agg_id = 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 having static g_agg_id inside a member function, can we move this to srv6Orch object?
It will be better to use some sort of index allocator instead of looping over the indices to determine the free index. Index allocator will be better for performance.
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.
Fixed, changed to member "m_srv6_agg_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.
Since there is no "index allocator" library in orch and we don't want to introduce dependency by new library, we write this simple function to get the id. And in our system level test, there is no performance issue. Is it ok to keep this function?
{ | ||
if (!deleteSrv6Vpn(sr_nh, getAggId(it_nhg))) | ||
{ | ||
SWSS_LOG_ERROR("Failed to delete SRV6 vpn %s", sr_nh.to_string(false, true).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.
We can also include prefix aggId in the error log for better debugging
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.
Fixed, add it in "createSrv6Vpn/deleteSrv6Vpn" error log.
orchagent/srv6orch.cpp
Outdated
void Srv6Orch::increasePrefixAggIdRefCount(const NextHopGroupKey &nhg) | ||
{ | ||
SWSS_LOG_ENTER(); | ||
string k = nhg.get_srv6_vpn_key(); |
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.
When the set of NHs are same, but the order of NHs in NHG key are different, does it have a different key? If so, we will use different prefix_agg_id. Could you please clarify this case?
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.
It should be treated as same key, I fixed it.
Appreciated for your review comments~
@prsunny @kperumalbfn |
tunnel_map_entry_attr.value.u32 = prefix_agg_id; | ||
tunnel_map_entry_attrs.push_back(tunnel_map_entry_attr); | ||
|
||
IpAddress vpn_sid(nh.srv6_vpn_sid); |
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 have any sonic-utility CLI to dump these map entries? We have VLAN-->VNI, VRF-->VNI map entries under 'show vxlan'. We could have one more for SRV6 tunnel map entries.
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.
sure, I can add the CLI in sonic-utility after this PR merged.
@shuaishang Please check the sanity failures and update the branch. Added one comment, pls check. |
/azp run |
Commenter does not have sufficient privileges for PR 2793 in repo sonic-net/sonic-swss |
there isn't any unit test code for such pr? @prsunny , what is our guidance for the unit test coverage for such pr? |
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.
please add unit test coverage to be 90%
sonic-swss tests are in a separate PR - #2766 @shuaishang It will be better to merge these two PRs. |
Agree, the test and PR must be together and in same PR. |
@kperumalbfn @prsunny |
@kperumalbfn @prsunny could you please help to check? any more comments? |
@kperumalbfn Any more comments? |
@shuaishang Any plan for SRV6 sonic-mgmt tests? If so, please add those PRs. |
@kperumalbfn No plan yet since the SONiC VS (linux) can't support SRv6 VPN packet yet.. |
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
What I did
HLD: SRv6 VPN HLD for 202305 release
Why I did it
This PR is to support SRv6 VPN functions
It depends on SAI 1.12. opencomputeproject/SAI #1744
How I verified it
pytest test_srv6.py
PS: to reduce the PR size, i created another PR #2766 for vs test.
Details if related