sonic-swss
sonic-swss copied to clipboard
[fpmsyncd] Add support for SRv6
The dplane_fpm_nl
module in FRR allows SONiC to learn the forwarding information computed by FRR. FRR already supports many SRv6 functionalities. There is an open PR (FRRouting/frr/pull/12301) to extend the dplane_fpm_nl
module of FRR to export the required SRv6 information to SONiC.
OrchAgent (specifically, RouteOrch and SRv6Orch) in SONiC SWSS can already extract the SRv6 information from the APP_DB and push it towards the ASIC_DB (sonic-net/sonic-swss/pull/1964).
However, the fpmsyncd
in SONiC SWSS does not process the SRv6 information received from FRR. This PR extends fpmsyncd
to parse the SRv6 information received from FRR and push it toward the APP_DB.
What I did
I added support for SRv6 to fpmsyncd
:
- I added a handler
onSrv6RouteMsg()
which is able to parse Netlink messages containing an SRv6 Steering Route and create an entry in theROUTE_TABLE
ofAPP_DB
. - I added a handler
onSrv6LocalSidMsg()
which is able to parse Netlink messages containing an SRv6 Local SID and create an entry in theSRV6_MY_SID_TABLE
ofAPP_DB
. - I changed
onMsgRaw()
to pass the Netlink messages to the appropriate handler depending on the encapsulation type. - I added the unit tests to verify that
fpmsyncd
processes the Netlink messages and updates theAPP_DB
correctly.
Why I did it
FRR supports many SRv6 functionalities. There is an open PR (FRRouting/frr/pull/12301) to extend the dplane_fpm_nl
module of FRR to export the required SRv6 information to SONiC.
However, the fpmsyncd
in SONiC SWSS did not process the SRv6 information received from FRR.
How I verified it
I added new unit tests in tests/mock_tests/fpmsyncd/receive_srv6_localsids_ut.cpp
and tests/mock_tests/fpmsyncd/receive_srv6_steer_routes_ut.cpp
.
Details if related SRv6 HLD: https://github.com/sonic-net/SONiC/blob/master/doc/srv6/srv6_hld.md SRv6 uSID HLD: https://github.com/sonic-net/SONiC/blob/master/doc/srv6/SRv6_uSID.md
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: cscarpitta / name: Carmine Scarpitta (5ad6686952b699f677fb41a9d694b5ff9174d9ca, 5081801b868bfb2f23385d7bc39a21000cc2a8ad, f50814ed1b69758bf0a392d65b1558499a95ac91, f9a7cdff312d855c16c1e646c5cde3f2330b9fa8, 3dfa88dd65902d3b250db36c5c60c245c1047b33, cab3b30f17ad80883b98a366441f1c38899cb1cc)
@svshah-intel Hi Shitanshu, could you please help review this PR. Thanks.
@svshah-intel Many thanks for your review! I addressed all your comments. Could you please take another look?