-
Notifications
You must be signed in to change notification settings - Fork 1.4k
bgpd: Add support for BGP to use SRv6 SID in an explicit way #18519
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
bgpd: Add support for BGP to use SRv6 SID in an explicit way #18519
Conversation
3b589de to
8e9ed78
Compare
|
there are a lot of code format issues - please run checkpatch and 'git-clang-format --diff' and take a look at the results, and fix the important things: alignment, extra whitespace, etc. clang will try to extend lines to 100, and that's not required, but there appear to be lines >100, and those must be fixed. clang also does some terrible things to some manual alignments, as we often do for flag definitions and enums; it's not necessary to make clang's changes, but anything you change should fit what is already present. |
zebra/zapi_msg.c
Outdated
| struct zserv *client; | ||
|
|
||
| frr_each (zserv_client_list, &zrouter.client_list, client) { | ||
| zsend_srv6_static_sid_update_internal(client); |
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.
no, we can't blindly send zapi messages to every daemon, when only one (?) is interested.
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.
The modifications here are implemented in line with the logic of sending notifications to various daemons after locator configuration:
void zebra_srv6_locator_add(struct srv6_locator *locator)
{
struct zebra_srv6 *srv6 = zebra_srv6_get_default();
struct srv6_locator *tmp;
struct zserv *client;
tmp = zebra_srv6_locator_lookup(locator->name);
if (!tmp)
listnode_add(srv6->locators, locator);
/*
* Notify new locator info to zclients.
*
* The srv6 locators and their prefixes are managed by zserv(zebra).
* And an actual configuration the srv6 sid in the srv6 locator is done
* by zclient(bgpd, isisd, etc). The configuration of each locator
* allocation and specify it by zserv and zclient should be
* asynchronous. For that, zclient should be received the event via
* ZAPI when a srv6 locator is added on zebra.
* Basically, in SRv6, adding/removing SRv6 locators is performed less
* frequently than adding rib entries, so a broad to all zclients will
* not degrade the overall performance of FRRouting.
*/
frr_each (zserv_client_list, &zrouter.client_list, client) {
zsend_zebra_srv6_locator_add(client, locator);
}
}
Currently, there is no subscription-like record variable or operation in the srv6_locator and srv6_sid data structures for the daemons which use the msg, and the configuration frequency of srv6 static sids is similarly low as that of srv6 locators. From my current perspective, it might be considered a better choice to send the msg to daemons in a loop, rather than hard-coding it to send to the BGP.
Hi @cscarpitta, I'm not sure if my understanding is correct. If it's not, could you please help explain a bit?
8ede9e4 to
7abcdd8
Compare
@mjstapp Thanks. I have fixed all format errors in my modifications that can be changed. I did not apply the fixing patch to the codes that were already merged previously. Additionally, some of the format suggestions are viewed as errors by "checkout code" part in CI, so I did not change those either. If there are further code updates, I will promptly make adjustments based on the results from frrbot and checkout code. |
1a915ef to
5362b3a
Compare
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
5362b3a to
18a05ba
Compare
68df460 to
8701761
Compare
8701761 to
123a83d
Compare
Add support for bgp to use explicit SRv6 SID. Use configuration "sid vpn per-vrf export explicit X:X::X:X" in vrf context to request the explicit SID from Zebra. If SRv6 SID manager allocates the explicit SID successfully, then BGP will advertise it. Signed-off-by: Yuqing Zhao <[email protected]>
Signed-off-by: Yuqing Zhao <[email protected]>
937b6e9 to
bd013ed
Compare
ahsalam
left a comment
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. Many thanks for updating the design. The new design is good and solve the issue of the notification from Zebra to the daemons.
zice312963205
left a comment
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
Add BGP explicit SID configuration in bgp.rst. Signed-off-by: Yuqing Zhao <[email protected]>
bd013ed to
a9c8e72
Compare
|
ci:rerun |
cscarpitta
left a comment
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
…n tests (#19206) Summary: Update sid_vpn_per_vrf_export_explicit config for srv6 tests according to the latest modification in FRR. FRR adds "explicit" option for configuration "sid vpn per-vrf export <(1..1048575)|auto|explicit X:X::X:X>" to use SRv6 SIDs in an explicit way. Frrcfgd has been updated to support new config way. FRR PR: FRRouting/frr#18519 frrcfgd PR: sonic-net/sonic-buildimage#23107 Signed-off-by: 红蔻 <[email protected]>
…n tests (sonic-net#19206) Summary: Update sid_vpn_per_vrf_export_explicit config for srv6 tests according to the latest modification in FRR. FRR adds "explicit" option for configuration "sid vpn per-vrf export <(1..1048575)|auto|explicit X:X::X:X>" to use SRv6 SIDs in an explicit way. Frrcfgd has been updated to support new config way. FRR PR: FRRouting/frr#18519 frrcfgd PR: sonic-net/sonic-buildimage#23107 Signed-off-by: 红蔻 <[email protected]>
…n tests (sonic-net#19206) Summary: Update sid_vpn_per_vrf_export_explicit config for srv6 tests according to the latest modification in FRR. FRR adds "explicit" option for configuration "sid vpn per-vrf export <(1..1048575)|auto|explicit X:X::X:X>" to use SRv6 SIDs in an explicit way. Frrcfgd has been updated to support new config way. FRR PR: FRRouting/frr#18519 frrcfgd PR: sonic-net/sonic-buildimage#23107 Signed-off-by: 红蔻 <[email protected]>
Port the following fixes from FRR mainline: - zebra: Add CLI to display SRv6 SIDs allocated (FRRouting/frr#16836) - bgpd: add usid behavior for bgp srv6 instructions (FRRouting/frr#18611) - bgpd: Implement Link-Local Next Hop capability (FRRouting/frr#17871) - Add BGP redistribution in SRv6 BGP (FRRouting/frr#18396) - bgpd: Add support for BGP to use SRv6 SID in an explicit way (FRRouting/frr#18519) - lib, staticd, isisd: add B6.ENCAPS codepoint extensions (FRRouting/frr#18597) - zebra: Provide SID value when sending SRv6 SID release notify message (FRRouting/frr#18971) - zebra: Cleanup SRv6 output of show running-config (FRRouting/frr#18970) - zebra: Free up tt when failure mode happens (FRRouting/frr@0521673) - SRv6: Add support for multiple SRv6 locators (FRRouting/frr#18806) Signed-off-by: Carmine Scarpitta <[email protected]>
Port the following fixes from FRR mainline: - zebra: Add CLI to display SRv6 SIDs allocated (FRRouting/frr#16836) - bgpd: add usid behavior for bgp srv6 instructions (FRRouting/frr#18611) - bgpd: Implement Link-Local Next Hop capability (FRRouting/frr#17871) - Add BGP redistribution in SRv6 BGP (FRRouting/frr#18396) - bgpd: Add support for BGP to use SRv6 SID in an explicit way (FRRouting/frr#18519) - lib, staticd, isisd: add B6.ENCAPS codepoint extensions (FRRouting/frr#18597) - zebra: Provide SID value when sending SRv6 SID release notify message (FRRouting/frr#18971) - zebra: Cleanup SRv6 output of show running-config (FRRouting/frr#18970) - zebra: Free up tt when failure mode happens (FRRouting/frr@0521673) - SRv6: Add support for multiple SRv6 locators (FRRouting/frr#18806) Signed-off-by: Carmine Scarpitta <[email protected]>
…n tests (sonic-net#19206) Summary: Update sid_vpn_per_vrf_export_explicit config for srv6 tests according to the latest modification in FRR. FRR adds "explicit" option for configuration "sid vpn per-vrf export <(1..1048575)|auto|explicit X:X::X:X>" to use SRv6 SIDs in an explicit way. Frrcfgd has been updated to support new config way. FRR PR: FRRouting/frr#18519 frrcfgd PR: sonic-net/sonic-buildimage#23107 Signed-off-by: 红蔻 <[email protected]>
Port the following fixes from FRR mainline: - zebra: Add CLI to display SRv6 SIDs allocated (FRRouting/frr#16836) - bgpd: add usid behavior for bgp srv6 instructions (FRRouting/frr#18611) - bgpd: Implement Link-Local Next Hop capability (FRRouting/frr#17871) - Add BGP redistribution in SRv6 BGP (FRRouting/frr#18396) - bgpd: Add support for BGP to use SRv6 SID in an explicit way (FRRouting/frr#18519) - lib, staticd, isisd: add B6.ENCAPS codepoint extensions (FRRouting/frr#18597) - zebra: Provide SID value when sending SRv6 SID release notify message (FRRouting/frr#18971) - zebra: Cleanup SRv6 output of show running-config (FRRouting/frr#18970) - zebra: Free up tt when failure mode happens (FRRouting/frr@0521673) - SRv6: Add support for multiple SRv6 locators (FRRouting/frr#18806) - zebra: Fix SRv6 explicit SID allocation to use the provided locator (FRRouting/frr@a9044d2) Signed-off-by: Carmine Scarpitta <[email protected]>
…n tests (sonic-net#19206) Summary: Update sid_vpn_per_vrf_export_explicit config for srv6 tests according to the latest modification in FRR. FRR adds "explicit" option for configuration "sid vpn per-vrf export <(1..1048575)|auto|explicit X:X::X:X>" to use SRv6 SIDs in an explicit way. Frrcfgd has been updated to support new config way. FRR PR: FRRouting/frr#18519 frrcfgd PR: sonic-net/sonic-buildimage#23107 Signed-off-by: 红蔻 <[email protected]>
…n tests (sonic-net#19206) Summary: Update sid_vpn_per_vrf_export_explicit config for srv6 tests according to the latest modification in FRR. FRR adds "explicit" option for configuration "sid vpn per-vrf export <(1..1048575)|auto|explicit X:X::X:X>" to use SRv6 SIDs in an explicit way. Frrcfgd has been updated to support new config way. FRR PR: FRRouting/frr#18519 frrcfgd PR: sonic-net/sonic-buildimage#23107 Signed-off-by: 红蔻 <[email protected]> Signed-off-by: Guy Shemesh <[email protected]>
…n tests (sonic-net#19206) Summary: Update sid_vpn_per_vrf_export_explicit config for srv6 tests according to the latest modification in FRR. FRR adds "explicit" option for configuration "sid vpn per-vrf export <(1..1048575)|auto|explicit X:X::X:X>" to use SRv6 SIDs in an explicit way. Frrcfgd has been updated to support new config way. FRR PR: FRRouting/frr#18519 frrcfgd PR: sonic-net/sonic-buildimage#23107 Signed-off-by: 红蔻 <[email protected]> Signed-off-by: Aharon Malkin <[email protected]>
…n tests (sonic-net#19206) Summary: Update sid_vpn_per_vrf_export_explicit config for srv6 tests according to the latest modification in FRR. FRR adds "explicit" option for configuration "sid vpn per-vrf export <(1..1048575)|auto|explicit X:X::X:X>" to use SRv6 SIDs in an explicit way. Frrcfgd has been updated to support new config way. FRR PR: FRRouting/frr#18519 frrcfgd PR: sonic-net/sonic-buildimage#23107 Signed-off-by: 红蔻 <[email protected]> Signed-off-by: Guy Shemesh <[email protected]>
…n tests (sonic-net#19206) Summary: Update sid_vpn_per_vrf_export_explicit config for srv6 tests according to the latest modification in FRR. FRR adds "explicit" option for configuration "sid vpn per-vrf export <(1..1048575)|auto|explicit X:X::X:X>" to use SRv6 SIDs in an explicit way. Frrcfgd has been updated to support new config way. FRR PR: FRRouting/frr#18519 frrcfgd PR: sonic-net/sonic-buildimage#23107 Signed-off-by: 红蔻 <[email protected]>
The current implementation supports BGP using SIDs allocated in two modes, including index-mode and auto-mode.
This PR adds support for BGP to use SRv6 SIDs in an explicit way.
Add "explicit" option for configuration "sid vpn per-vrf export <(1..1048575)|auto|explicit X:X::X:X>".
By configuring
sid vpn per-vrf export explicit X:X::X:Xin the context of a Vrf (where X:X::X:X is the explicit SID value), BGP will request the explicit SID from Zebra and advertise it if the allocation in Zebra is successful.