-
Notifications
You must be signed in to change notification settings - Fork 630
[fpmsyncd]: Fix SRv6 SID List sharing among prefixes #3860
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
base: master
Are you sure you want to change the base?
[fpmsyncd]: Fix SRv6 SID List sharing among prefixes #3860
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
a76f716
to
679c865
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
679c865
to
795980b
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Currently, there is a one-to-one mapping between prefixes and SRv6 SID List. When fpmsyncd receives a new route, it creates a SID List and associates it with the route. The key for the SID List is the Prefix of route. If fpmsyncd receives a second route pointing to the same SRv6 SID List, fpmsyncd creates another copy of the SID List for the second route. This approach results in unnecessary duplication of SID Lists for routes that could share the same SID List, and lead to significant scale issues. The number of SID Lists = the number of routes. This commit fixes the issue in fpmsyncd by enabling it to reuse existing SID Lists. Signed-off-by: Carmine Scarpitta <[email protected]>
The previous commit modified the SRv6 SID List to use the SIDs as the key. This commit updates the fpmsyncd mock test cases to align with this change, ensuring the test cases now expect the SIDs to serve as the key for the SID List. Signed-off-by: Carmine Scarpitta <[email protected]>
The previous commit modified the SRv6 SID List to use the SIDs as the key. This commit updates the SONiC VS test cases to align with this change, ensuring the test cases now expect the SIDs to serve as the key for the SID List. Signed-off-by: Carmine Scarpitta <[email protected]>
Signed-off-by: Carmine Scarpitta <[email protected]>
795980b
to
93e1856
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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 is a key feature for scaling as the number of SID List is typically way smaller compared to the number of prefixes.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
{ | ||
string routeTableKeyStr = string(routeTableKey); | ||
string srv6SidListTableKey = routeTableKeyStr; | ||
string srv6SidListTableKey = vpn_sid_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.
With this new approach, should we maintain some reference count so that we don't delete the table when there are references?
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.
@dgsudharsan Thanks for the review.
I added the refcount for the SID lists.
/* Write SID list to SRV6_SID_LIST_TABLE */ | ||
|
||
string srv6SidListTableKey = routeTableKeyStr; | ||
string srv6SidListTableKey = vpn_sid_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.
Hi Carmine,
I'm a bit confused about the SID field in this table.Does it represent the policy's SID(sid list) or the VPN's SID? Also, does the current code support only one 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.
This is the SID list.
The current implementation can handle only one SID, but this is a different problem. I'm already working on another PR to fix this issue and allow fpmsyncd to properly handle SID lists with multiple SID. I will open a separate PR once this PR gets merged.
Signed-off-by: Carmine Scarpitta <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Currently, there is a one-to-one mapping between prefixes and SRv6 SID List. When fpmsyncd receives a new route, it creates a SID List and associates it with the route. The key for the SID List is the Prefix of route. If fpmsyncd receives a second route pointing to the same SRv6 SID List, fpmsyncd creates another copy of the SID List for the second route.
This approach results in unnecessary duplication of SID Lists for routes that could share the same SID List, and lead to significant scale issues. The number of SID Lists = the number of routes.
This commit fixes the issue in fpmsyncd by enabling it to reuse existing SID Lists.