Skip to content

Conversation

cscarpitta
Copy link
Contributor

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.

@cscarpitta cscarpitta requested a review from prsunny as a code owner September 3, 2025 17:47
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@cscarpitta cscarpitta force-pushed the fix/fix_srv6_sidlist_sharing_v3 branch from a76f716 to 679c865 Compare September 3, 2025 17:48
@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).

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]>
@cscarpitta cscarpitta force-pushed the fix/fix_srv6_sidlist_sharing_v3 branch from 795980b to 93e1856 Compare September 11, 2025 19:56
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

@ahsalam ahsalam left a 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.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

dgsudharsan
dgsudharsan previously approved these changes Sep 15, 2025
{
string routeTableKeyStr = string(routeTableKey);
string srv6SidListTableKey = routeTableKeyStr;
string srv6SidListTableKey = vpn_sid_str;
Copy link
Collaborator

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?

Copy link
Contributor Author

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;

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?

Copy link
Contributor Author

@cscarpitta cscarpitta Sep 22, 2025

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.

@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).

@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.

5 participants