[fpmsyncd]: Fix uA SID programming for link-local adjacencies#3958
[fpmsyncd]: Fix uA SID programming for link-local adjacencies#3958prsunny merged 16 commits intosonic-net:masterfrom
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
A uA SID performs a shift and cross-connect to a direct neighbor over a specific interface. It is defined by two parameters: an interface and a nexthop IPv6 address. When FRR sends a uA SID to SONiC's fpmsyncd, it includes both of these parameters. However, fpmsyncd currently only extracts the nexthop IPv6 address. It then creates an entry in the SRV6_MY_SID_TABLE of ApplDB with action=ua and adj=<nexthop_ipv6_address>. Subsequently, OrchAgent retrieves this entry and attempts to resolve the adjacency to program the SID in the ASIC. The issue is that fpmsyncd extracts the nexthop IPv6 address from the message but does not extract the interface. In cases where the nexthop IPv6 address is a link-local address, the interface is essential for successful nexthop resolution. Without it, the resolution fails, and the SID is not programmed in the ASIC. For example, the following syslog messages show OrchAgent failing to resolve a link-local nexthop because the interface is missing: ``` Oct 27 08:31:19.345821 1cdc490d8ce2 INFO #orchagent: :- doTask: table name : SRV6_MY_SID_TABLE Oct 27 08:31:19.345895 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: MY SID STRING fcbb:bbbb:1:fe10:: Oct 27 08:31:19.345912 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: MySid: sid fcbb:bbbb:1:fe10::, action ua, vrf , block 32, node 16, func 16, arg 0 dt_vrf , adj fe80::e822:daff:feab:3ee9 Oct 27 08:31:19.345946 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: Adjacency fe80::e822:daff:feab:3ee9 Oct 27 08:31:19.345965 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: Nexthop for adjacency fe80::e822:daff:feab:3ee9 doesn't exist in DB yet Oct 27 08:31:19.345983 1cdc490d8ce2 ERR #orchagent: :- doTaskMySidTable: Failed to create/update my_sid entry for sid 32:16:16:0:fcbb:bbbb:1:fe10:: ``` This commit fixes the issue by extending fpmsyncd to: - Extract the interface from the Netlink message received from FRR. - Include the interface in the adj field of the SRV6_MY_SID_TABLE entry, using the format: adj=<ipv6_address>@<interface>. This ensures that OrchAgent receives the necessary interface information along with the nexthop address, allowing it to successfully resolve nexthops in all scenarios, including when the nexthop is a link-local IPv6 address. Signed-off-by: Carmine Scarpitta <[email protected]>
This commit introduces a new mock test for fpmsyncd to validate the handling of SRv6 uA SIDs. The test simulates a scenario where FRR sends a Netlink message to fpmsyncd containing a uA SID defined with both a nexthop IPv6 address and an associated interface. It verifies that fpmsyncd correctly: 1. Parses both the nexthop IPv6 address and the interface from the incoming message. 2. Constructs an adjacency key in the expected format: <ipv6_address>@<interface>. 3. Writes the correct entry to the `SRV6_MY_SID_TABLE` in ApplDB. This test ensures that the logic for handling link-local nexthops is working as intended and protects against future regressions. Signed-off-by: Carmine Scarpitta <[email protected]>
325dd21 to
cab1cbf
Compare
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
|
/azpw run |
|
/AzurePipelines 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). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR fixes uA SID programming for link-local adjacencies by enabling fpmsyncd to extract and forward interface information from FRR to OrchAgent. Previously, when a uA SID was configured with a link-local nexthop, fpmsyncd only extracted the IPv6 address but not the associated interface, causing nexthop resolution to fail in OrchAgent.
Key Changes:
- Adds interface extraction from Netlink messages for SRv6 uA behaviors
- Formats adjacencies with interface using the pattern
<ipv6_address>@<interface>when an interface is provided - Includes comprehensive test coverage for the new functionality
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/mock_tests/fpmsyncd/ut_helpers_fpmsyncd.h | Adds SRV6_LOCALSID_IFNAME enum constant and updates create_srv6_mysid_nlmsg() signature to include interface parameter |
| tests/mock_tests/fpmsyncd/ut_helpers_fpmsyncd.cpp | Implements interface handling in mock Netlink message creation for UA and END_X actions |
| tests/mock_tests/fpmsyncd/receive_srv6_mysids_ut.cpp | Adds new test case validating uA behavior with interface, updates existing test calls for new function signature |
| fpmsyncd/routesync.h | Updates parseSrv6MySid() signature to include interface output parameter |
| fpmsyncd/routesync.cpp | Implements interface extraction from Netlink messages, formats adjacency with interface suffix when present, adds validation for uA adjacency, updates logging |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Co-authored-by: Copilot <[email protected]>
|
/azp run |
Co-authored-by: Copilot <[email protected]>
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
|
||
| /* Create a Netlink object containing an SRv6 My SID with invalid SID value prefix length */ | ||
| nl_obj = create_srv6_mysid_nlmsg(RTM_NEWSRV6LOCALSID, &_mysid, 32, 16, 16, 0, SRV6_LOCALSID_ACTION_END, NULL, NULL, 10, 200, AF_INET6); | ||
| nl_obj = create_srv6_mysid_nlmsg(RTM_NEWSRV6LOCALSID, &_mysid, 32, 16, 16, 0, SRV6_LOCALSID_ACTION_END, NULL, NULL, NULL, 10, 200, AF_INET6); |
There was a problem hiding this comment.
How can the prefixlen be 200? I think this is also a legacy bug. Same as the other two places below.
|
@dgsudharsan , @abdosi , please review/signoff |
|
Merging since i see Changrong approved |
…net#3958) * [fpmsyncd]: Fix uA SID programming for link-local adjacencies A uA SID performs a shift and cross-connect to a direct neighbor over a specific interface. It is defined by two parameters: an interface and a nexthop IPv6 address. When FRR sends a uA SID to SONiC's fpmsyncd, it includes both of these parameters. However, fpmsyncd currently only extracts the nexthop IPv6 address. It then creates an entry in the SRV6_MY_SID_TABLE of ApplDB with action=ua and adj=<nexthop_ipv6_address>. Subsequently, OrchAgent retrieves this entry and attempts to resolve the adjacency to program the SID in the ASIC. The issue is that fpmsyncd extracts the nexthop IPv6 address from the message but does not extract the interface. In cases where the nexthop IPv6 address is a link-local address, the interface is essential for successful nexthop resolution. Without it, the resolution fails, and the SID is not programmed in the ASIC. For example, the following syslog messages show OrchAgent failing to resolve a link-local nexthop because the interface is missing: ``` Oct 27 08:31:19.345821 1cdc490d8ce2 INFO #orchagent: :- doTask: table name : SRV6_MY_SID_TABLE Oct 27 08:31:19.345895 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: MY SID STRING fcbb:bbbb:1:fe10:: Oct 27 08:31:19.345912 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: MySid: sid fcbb:bbbb:1:fe10::, action ua, vrf , block 32, node 16, func 16, arg 0 dt_vrf , adj fe80::e822:daff:feab:3ee9 Oct 27 08:31:19.345946 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: Adjacency fe80::e822:daff:feab:3ee9 Oct 27 08:31:19.345965 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: Nexthop for adjacency fe80::e822:daff:feab:3ee9 doesn't exist in DB yet Oct 27 08:31:19.345983 1cdc490d8ce2 ERR #orchagent: :- doTaskMySidTable: Failed to create/update my_sid entry for sid 32:16:16:0:fcbb:bbbb:1:fe10:: ``` Signed-off-by: Kalash Nainwal <[email protected]>
…net#3958) * [fpmsyncd]: Fix uA SID programming for link-local adjacencies A uA SID performs a shift and cross-connect to a direct neighbor over a specific interface. It is defined by two parameters: an interface and a nexthop IPv6 address. When FRR sends a uA SID to SONiC's fpmsyncd, it includes both of these parameters. However, fpmsyncd currently only extracts the nexthop IPv6 address. It then creates an entry in the SRV6_MY_SID_TABLE of ApplDB with action=ua and adj=<nexthop_ipv6_address>. Subsequently, OrchAgent retrieves this entry and attempts to resolve the adjacency to program the SID in the ASIC. The issue is that fpmsyncd extracts the nexthop IPv6 address from the message but does not extract the interface. In cases where the nexthop IPv6 address is a link-local address, the interface is essential for successful nexthop resolution. Without it, the resolution fails, and the SID is not programmed in the ASIC. For example, the following syslog messages show OrchAgent failing to resolve a link-local nexthop because the interface is missing: ``` Oct 27 08:31:19.345821 1cdc490d8ce2 INFO #orchagent: :- doTask: table name : SRV6_MY_SID_TABLE Oct 27 08:31:19.345895 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: MY SID STRING fcbb:bbbb:1:fe10:: Oct 27 08:31:19.345912 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: MySid: sid fcbb:bbbb:1:fe10::, action ua, vrf , block 32, node 16, func 16, arg 0 dt_vrf , adj fe80::e822:daff:feab:3ee9 Oct 27 08:31:19.345946 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: Adjacency fe80::e822:daff:feab:3ee9 Oct 27 08:31:19.345965 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: Nexthop for adjacency fe80::e822:daff:feab:3ee9 doesn't exist in DB yet Oct 27 08:31:19.345983 1cdc490d8ce2 ERR #orchagent: :- doTaskMySidTable: Failed to create/update my_sid entry for sid 32:16:16:0:fcbb:bbbb:1:fe10:: ```
…net#3958) * [fpmsyncd]: Fix uA SID programming for link-local adjacencies A uA SID performs a shift and cross-connect to a direct neighbor over a specific interface. It is defined by two parameters: an interface and a nexthop IPv6 address. When FRR sends a uA SID to SONiC's fpmsyncd, it includes both of these parameters. However, fpmsyncd currently only extracts the nexthop IPv6 address. It then creates an entry in the SRV6_MY_SID_TABLE of ApplDB with action=ua and adj=<nexthop_ipv6_address>. Subsequently, OrchAgent retrieves this entry and attempts to resolve the adjacency to program the SID in the ASIC. The issue is that fpmsyncd extracts the nexthop IPv6 address from the message but does not extract the interface. In cases where the nexthop IPv6 address is a link-local address, the interface is essential for successful nexthop resolution. Without it, the resolution fails, and the SID is not programmed in the ASIC. For example, the following syslog messages show OrchAgent failing to resolve a link-local nexthop because the interface is missing: ``` Oct 27 08:31:19.345821 1cdc490d8ce2 INFO #orchagent: :- doTask: table name : SRV6_MY_SID_TABLE Oct 27 08:31:19.345895 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: MY SID STRING fcbb:bbbb:1:fe10:: Oct 27 08:31:19.345912 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: MySid: sid fcbb:bbbb:1:fe10::, action ua, vrf , block 32, node 16, func 16, arg 0 dt_vrf , adj fe80::e822:daff:feab:3ee9 Oct 27 08:31:19.345946 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: Adjacency fe80::e822:daff:feab:3ee9 Oct 27 08:31:19.345965 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: Nexthop for adjacency fe80::e822:daff:feab:3ee9 doesn't exist in DB yet Oct 27 08:31:19.345983 1cdc490d8ce2 ERR #orchagent: :- doTaskMySidTable: Failed to create/update my_sid entry for sid 32:16:16:0:fcbb:bbbb:1:fe10:: ```
…net#3958) * [fpmsyncd]: Fix uA SID programming for link-local adjacencies A uA SID performs a shift and cross-connect to a direct neighbor over a specific interface. It is defined by two parameters: an interface and a nexthop IPv6 address. When FRR sends a uA SID to SONiC's fpmsyncd, it includes both of these parameters. However, fpmsyncd currently only extracts the nexthop IPv6 address. It then creates an entry in the SRV6_MY_SID_TABLE of ApplDB with action=ua and adj=<nexthop_ipv6_address>. Subsequently, OrchAgent retrieves this entry and attempts to resolve the adjacency to program the SID in the ASIC. The issue is that fpmsyncd extracts the nexthop IPv6 address from the message but does not extract the interface. In cases where the nexthop IPv6 address is a link-local address, the interface is essential for successful nexthop resolution. Without it, the resolution fails, and the SID is not programmed in the ASIC. For example, the following syslog messages show OrchAgent failing to resolve a link-local nexthop because the interface is missing: ``` Oct 27 08:31:19.345821 1cdc490d8ce2 INFO #orchagent: :- doTask: table name : SRV6_MY_SID_TABLE Oct 27 08:31:19.345895 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: MY SID STRING fcbb:bbbb:1:fe10:: Oct 27 08:31:19.345912 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: MySid: sid fcbb:bbbb:1:fe10::, action ua, vrf , block 32, node 16, func 16, arg 0 dt_vrf , adj fe80::e822:daff:feab:3ee9 Oct 27 08:31:19.345946 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: Adjacency fe80::e822:daff:feab:3ee9 Oct 27 08:31:19.345965 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: Nexthop for adjacency fe80::e822:daff:feab:3ee9 doesn't exist in DB yet Oct 27 08:31:19.345983 1cdc490d8ce2 ERR #orchagent: :- doTaskMySidTable: Failed to create/update my_sid entry for sid 32:16:16:0:fcbb:bbbb:1:fe10:: ``` Signed-off-by: Lawrence Lee <[email protected]>
…net#3958) * [fpmsyncd]: Fix uA SID programming for link-local adjacencies A uA SID performs a shift and cross-connect to a direct neighbor over a specific interface. It is defined by two parameters: an interface and a nexthop IPv6 address. When FRR sends a uA SID to SONiC's fpmsyncd, it includes both of these parameters. However, fpmsyncd currently only extracts the nexthop IPv6 address. It then creates an entry in the SRV6_MY_SID_TABLE of ApplDB with action=ua and adj=<nexthop_ipv6_address>. Subsequently, OrchAgent retrieves this entry and attempts to resolve the adjacency to program the SID in the ASIC. The issue is that fpmsyncd extracts the nexthop IPv6 address from the message but does not extract the interface. In cases where the nexthop IPv6 address is a link-local address, the interface is essential for successful nexthop resolution. Without it, the resolution fails, and the SID is not programmed in the ASIC. For example, the following syslog messages show OrchAgent failing to resolve a link-local nexthop because the interface is missing: ``` Oct 27 08:31:19.345821 1cdc490d8ce2 INFO #orchagent: :- doTask: table name : SRV6_MY_SID_TABLE Oct 27 08:31:19.345895 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: MY SID STRING fcbb:bbbb:1:fe10:: Oct 27 08:31:19.345912 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: MySid: sid fcbb:bbbb:1:fe10::, action ua, vrf , block 32, node 16, func 16, arg 0 dt_vrf , adj fe80::e822:daff:feab:3ee9 Oct 27 08:31:19.345946 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: Adjacency fe80::e822:daff:feab:3ee9 Oct 27 08:31:19.345965 1cdc490d8ce2 INFO #orchagent: :- createUpdateMysidEntry: Nexthop for adjacency fe80::e822:daff:feab:3ee9 doesn't exist in DB yet Oct 27 08:31:19.345983 1cdc490d8ce2 ERR #orchagent: :- doTaskMySidTable: Failed to create/update my_sid entry for sid 32:16:16:0:fcbb:bbbb:1:fe10:: ``` Signed-off-by: Baorong Liu <[email protected]>
What I did
A uA SID performs a shift and cross-connect to a direct neighbor over a specific interface. It is defined by two parameters: an interface and a nexthop IPv6 address.
When FRR sends a uA SID to SONiC's fpmsyncd, it includes both of these parameters. However, fpmsyncd currently only extracts the nexthop IPv6 address. It then creates an entry in the SRV6_MY_SID_TABLE of ApplDB with
action=uaandadj=<nexthop_ipv6_address>. Subsequently, OrchAgent retrieves this entry and attempts to resolve the adjacency to program the SID in the ASIC.The issue is that fpmsyncd extracts the nexthop IPv6 address from the message but does not extract the interface. In cases where the nexthop IPv6 address is a link-local address, the interface is essential for successful nexthop resolution. Without it, the resolution fails, and the SID is not programmed in the ASIC.
For example, the following syslog messages show OrchAgent failing to resolve a link-local nexthop because the interface is missing:
This commit fixes the issue by extending fpmsyncd to:
adj=<ipv6_address>@<interface>.This ensures that OrchAgent receives the necessary interface information along with the nexthop address, allowing it to
successfully resolve nexthops in all scenarios, including when the nexthop is a link-local IPv6 address.
Why I did it
OrchAgent is unable to resolve the nexthop for uA SIDs when the nexthop IPv6 address is a link-local address.
How I verified it
A new mock test for fpmsyncd has been introduced to validate the handling of SRv6 uA SIDs.
The test simulates a scenario where FRR sends a Netlink message to fpmsyncd containing a uA SID defined with both a nexthop IPv6 address and an associated interface.
It verifies that fpmsyncd correctly:
<ipv6_address>@<interface>.SRV6_MY_SID_TABLEin ApplDB.This test ensures that the logic for handling link-local nexthops is working as intended and protects against future regressions.