Skip to content

Conversation

cscarpitta
Copy link
Contributor

PR #15604 introduces the SRv6 SID Manager, a zebra component responsible for SID allocation/management. The SRv6 SID Manager exposes a SID allocation/release APIs, allowing clients to request and release an SRv6 SID.

This PR extends the BGP daemon to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs.

@frrbot frrbot bot added the bgp label Apr 3, 2024
@ton31337 ton31337 self-assigned this Apr 5, 2024
@ton31337 ton31337 self-requested a review April 5, 2024 08:24
@ton31337 ton31337 removed their assignment Apr 5, 2024
@riw777 riw777 self-requested a review April 9, 2024 14:37
@cscarpitta cscarpitta force-pushed the bgp-srv6-sid-manager branch from 025a328 to 1426639 Compare May 3, 2024 14:58
Copy link

github-actions bot commented May 6, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@cscarpitta cscarpitta force-pushed the bgp-srv6-sid-manager branch from 1426639 to eea365a Compare May 6, 2024 09:36
@github-actions github-actions bot removed the conflicts label May 6, 2024
@cscarpitta cscarpitta force-pushed the bgp-srv6-sid-manager branch from eea365a to 8a0bf18 Compare May 8, 2024 16:10
@frrbot frrbot bot added the libfrr label May 8, 2024
@github-actions github-actions bot added size/XXL and removed size/XL labels May 8, 2024
@cscarpitta cscarpitta force-pushed the bgp-srv6-sid-manager branch from 8a0bf18 to a1d9830 Compare May 8, 2024 16:20
Copy link

github-actions bot commented May 9, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

1 similar comment
Copy link

github-actions bot commented May 9, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@cscarpitta cscarpitta force-pushed the bgp-srv6-sid-manager branch from a1d9830 to ad2698a Compare May 10, 2024 16:56
Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one really minor nit ... code looks okay to me, but it would be good to have @mjstapp at least look at the zebra bits as well

@cscarpitta cscarpitta force-pushed the bgp-srv6-sid-manager branch from ad2698a to 9b6ec7c Compare May 13, 2024 18:47
@cscarpitta cscarpitta force-pushed the bgp-srv6-sid-manager branch 2 times, most recently from 817303e to 403d544 Compare June 7, 2024 10:44
@cscarpitta cscarpitta force-pushed the bgp-srv6-sid-manager branch from c6de540 to 5415f9c Compare June 18, 2024 16:26
@github-actions github-actions bot added size/XL and removed size/XXL labels Jun 18, 2024
@cscarpitta
Copy link
Contributor Author

@riw777 Many thanks for the review. I rebased the PR based on the merged SID manager. Can you please take a look again?

@riw777
Copy link
Member

riw777 commented Aug 14, 2024

I'm kindof waiting on #15679 to pass before pushing this ...

@ahsalam
Copy link

ahsalam commented Aug 15, 2024

I'm kindof waiting on #15679 to pass before pushing this ...

PR #15679 depends on this one as it tests the code to be merged here.

Once this is merged, We will rebase PR #15679 and rerun the CI.

@cscarpitta
Copy link
Contributor Author

ci:retry CI failure is not related, rerunning

cscarpitta and others added 10 commits September 5, 2024 10:59
Add an API to request information from the SRv6 SID Manager (zebra)
regarding a specific SRv6 locator.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Currently, when SRv6 is enabled in BGP, BGP requests a locator chunk
from Zebra. Zebra assigns a locator chunk to BGP, and then BGP can
allocate SIDs from the locator chunk.

Recently, the implementation of SRv6 in Zebra has been improved, and a
new API has been introduced for obtaining/releasing the SIDs.

Now, the daemons no longer need to request a chunk.

Instead, the daemons interact with Zebra to obtain information about the
locator and subsequently to allocate/release the SIDs.

This commit extends BGP to use the new SRv6 API. In particular, it
removes the chunk throughout the BGP code and modifies BGP to
request/save/advertise the locator instead of the chunk.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit extends BGP to process locator information received from
SRv6 Manager (zebra) and save the locator info in the SRv6 database.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Add an API to get/release SRv6 SIDs through the SRv6 SID Manager.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
When SRv6 VPN is unconfigured in BGP, BGP needs to interact with SID Manager to
release the SID and make it available to other daemons

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Currently, BGP allocates SIDs without interacting with Zebra.

Recently, the SRv6 implementation has been improved. Now, the daemons
need to interact with Zebra through ZAPI to obtain and release SIDs.

This commit extends BGP to request SIDs from Zebra instead of allocating
the SIDs on its own.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Make the `sid_register()` function non-static to allow other BGP modules
(e.g. bgp_zebra.c) to register SIDs.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Zebra sends a `SRV6_SID_NOTIFY` notification to inform clients about the
result of a SID alloc/release operation.  This commit adds a handler to
process a `SRV6_SID_NOTIFY` notification received from zebra.

If the notification indicates that a SID allocation operation was
successful, then it stores the allocated SID in the SRv6 database,
installs the SID into the RIB, and advertises the SID to the other BGP
routers.

If the notification indicates that an operation has failed, it logs the
error.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Remove unused SRv6 code.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
In the near future, some daemons may only register SIDs. This may be
the case for the pathd daemon when creating SRv6 binding SIDs.

When a locator is getting deleted at ZEBRA level, the daemon may have
an easy way to find out the SIds to unregister to.

This commit proposes to add the locator name to the SID_SRV6_NOTIFY
message whenever possible. Only case when an allocation failure happens,
the locator will not be present. In all other places, the notify API
at procol levels has the locator name extra-parameter.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
@cscarpitta
Copy link
Contributor Author

ci:retry

@riw777 riw777 merged commit 5d9ddcc into FRRouting:master Sep 5, 2024
11 checks passed
cscarpitta added a commit to cscarpitta/sonic-buildimage that referenced this pull request Dec 16, 2024
This commit brings PR FRRouting/frr#15676 from FRR mainline to SONiC

bgpd: Extend BGP to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs
FRRouting/frr#15676

Signed-off-by: cscarpitta <cscarpit@cisco.com>
cscarpitta added a commit to cscarpitta/sonic-buildimage that referenced this pull request Dec 16, 2024
This commit brings PR FRRouting/frr#15676 from FRR mainline to SONiC

bgpd: Extend BGP to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs
FRRouting/frr#15676

Signed-off-by: cscarpitta <cscarpit@cisco.com>
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Jan 2, 2025
This commit brings PR FRRouting/frr#15676 from FRR mainline to SONiC

bgpd: Extend BGP to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs
FRRouting/frr#15676

Signed-off-by: cscarpitta <cscarpit@cisco.com>
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Jan 2, 2025
This commit brings PR FRRouting/frr#15676 from FRR mainline to SONiC

bgpd: Extend BGP to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs
FRRouting/frr#15676

Signed-off-by: cscarpitta <cscarpit@cisco.com>
github-actions bot pushed a commit to bradh352/sonic-buildimage that referenced this pull request Jan 2, 2025
This commit brings PR FRRouting/frr#15676 from FRR mainline to SONiC

bgpd: Extend BGP to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs
FRRouting/frr#15676

Signed-off-by: cscarpitta <cscarpit@cisco.com>
mssonicbld added a commit to mssonicbld/sonic-buildimage-msft that referenced this pull request Jan 7, 2025
#### Why I did it

Bring the below PRs from FRR mainline to SONiC in order to support SRv6 SID Manager in SONiC.

#### New patches that were added

| Patch             | FRR Pull Request |
| ------------- | ----------------- |
| 0064-SRv6-BGP-SID-reachability.patch | FRRouting/frr#14810 |
| 0065-zebra-display-srv6-encapsulation-source-address-when-configured.patch | FRRouting/frr#16151 |
| 0066-lib-fix-srv6-locator-flags-propagated-to-isis.patch | FRRouting/frr#15673 |
| 0067-Add-support-for-SRv6-SID-Manager.patch | FRRouting/frr#15604 |
| 0068-bgpd-Extend-BGP-to-communicate-with-the-SRv6-SID-Manager-to-allocate-release-SRv6-SIDs.patch | FRRouting/frr#15676 |
VladimirKuk pushed a commit to Marvell-switching/sonic-buildimage that referenced this pull request Jan 21, 2025
This commit brings PR FRRouting/frr#15676 from FRR mainline to SONiC

bgpd: Extend BGP to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs
FRRouting/frr#15676

Signed-off-by: cscarpitta <cscarpit@cisco.com>
prabhataravind pushed a commit to prabhataravind/sonic-buildimage that referenced this pull request Mar 5, 2025
This commit brings PR FRRouting/frr#15676 from FRR mainline to SONiC

bgpd: Extend BGP to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs
FRRouting/frr#15676

Signed-off-by: cscarpitta <cscarpit@cisco.com>
yanjundeng pushed a commit to yanjundeng/sonic-buildimage that referenced this pull request Apr 23, 2025
This commit brings PR FRRouting/frr#15676 from FRR mainline to SONiC

bgpd: Extend BGP to communicate with the SRv6 SID Manager to allocate/release SRv6 SIDs
FRRouting/frr#15676

Signed-off-by: cscarpitta <cscarpit@cisco.com>
lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this pull request May 8, 2025
New patches that were added:
Patch	FRR Pull request
0086-isisd-lib-add-some-codepoints-usually-shared-with-other-vendors.patch	FRRouting/frr#17957
0087-staticd-Add-support-for-SRv6-uA-behavior.patch	FRRouting/frr#18198

Removed patches:
Patch	FRR commit / Pull request
0025-bgp-community-memory-leak-fix.patch	FRRouting/frr@e613e12
0028-zebra-fix-parse-attr-problems-for-encap.patch	FRRouting/frr@ba5a353 FRRouting/frr@569f9e4 FRRouting/frr@bd4fca1
0030-zebra-backpressure-Zebra-push-back-on-Buffer-Stream-.patch	FRRouting/frr@a8efa99
0031-bgpd-backpressure-Add-a-typesafe-list-for-Zebra-Anno.patch	FRRouting/frr@705fed7
0033-bgpd-backpressure-cleanup-bgp_zebra_XX-func-args.patch	FRRouting/frr@5f379be
0034-gpd-backpressure-Handle-BGP-Zebra-Install-evt-Creat.patch	FRRouting/frr@ccfe452
0035-bgpd-backpressure-Handle-BGP-Zebra-EPVN-Install-evt-.patch	FRRouting/frr@a07df6f
0036-zebra-backpressure-Fix-Null-ptr-access-Coverity-Issu.patch	FRRouting/frr@ed7005d
0037-bgpd-Increase-install-uninstall-speed-of-evpn-vpn-vn.patch	FRRouting/frr@9edf45b
0038-zebra-Actually-display-I-O-buffer-sizes.patch	FRRouting/frr@8d8f12b
0039-zebra-Actually-display-I-O-buffer-sizes-part-2.patch	FRRouting/frr@33dccbe
0040-bgpd-backpressure-Fix-to-withdraw-evpn-type-5-routes.patch	FRRouting/frr@f4ba472
0041-bgpd-backpressure-Fix-to-avoid-CPU-hog.patch	FRRouting/frr@920bf45
0042-zebra-Use-built-in-data-structure-counter.patch	FRRouting/frr@a23a938
0043-zebra-Use-the-ctx-queue-counters.patch	FRRouting/frr@34670c4
0044-zebra-Modify-dplane-loop-to-allow-backpressure-to-fi.patch	FRRouting/frr@3af381b
0045-zebra-Limit-queue-depth-in-dplane_fpm_nl.patch	FRRouting/frr@8926ac1
0046-zebra-Modify-show-zebra-dplane-providers-to-give-mor.patch	FRRouting/frr@98b11de
0047-bgpd-backpressure-fix-evpn-route-sync-to-zebra.patch	FRRouting/frr@b47a92e
0048-bgpd-backpressure-fix-to-properly-remove-dest-for-bg.patch	FRRouting/frr@4395fcd
0049-bgpd-backpressure-Improve-debuggability.patch	FRRouting/frr@186db96
0050-bgpd-backpressure-Avoid-use-after-free.patch	FRRouting/frr@40965e5
0051-bgpd-backpressure-fix-ret-value-evpn_route_select_in.patch	FRRouting/frr@c4bbb5b
0052-bgpd-backpressure-log-error-for-evpn-when-route-inst.patch	FRRouting/frr@6cf5b79
0055-bgpd-lib-Include-SID-structure-in-seg6local-nexthop.patch	FRRouting/frr@0402551
0059-Fix-BGP-reset-on-suppress-fib-pending-configuration.patch	FRRouting/frr#17487
0060-bgpd-Validate-both-nexthop-information-NEXTHOP-and-N.patch	FRRouting/frr@a0d2734
0061-dont-print-warning-if-not-a-daemon.patch	FRRouting/frr@cecf571
0062-zebra-lib-use-internal-rbtree-per-ns.patch	FRRouting/frr#17297
0064-SRv6-BGP-SID-reachability.patch	FRRouting/frr#14810
0065-zebra-display-srv6-encapsulation-source-address-when-configured.patch	FRRouting/frr@890b67d
0066-lib-fix-srv6-locator-flags-propagated-to-isis.patch	FRRouting/frr@03d2ad0
0067-Add-support-for-SRv6-SID-Manager.patch	FRRouting/frr#15604
0068-bgpd-Extend-BGP-to-communicate-with-the-SRv6-SID-Manager-to-allocate-release-SRv6-SIDs.patch	FRRouting/frr#15676
0069-lib-nexthop-code-should-use-uint16_t-for-nexthop-cou.patch	FRRouting/frr@0bc79f5
0070-Allow-16-bit-size-for-nexthops.patch	FRRouting/frr@9f8968f
0071-zebra-Only-notify-dplane-work-pthread-when-needed.patch	FRRouting/frr#17062
0072-Fix-up-improper-handling-of-nexthops-for-nexthop-tra.patch	FRRouting/frr#17076
0073-remove-in6addr-cmp.patch	FRRouting/frr#17312
0074-bgp-best-port-reordering.patch	FRRouting/frr#15572
0075-bgp-mp-info-changes.patch	FRRouting/frr#16961
0076-Optimizations-and-problem-fixing-for-large-scale-ecmp-from-bgp.patch	FRRouting/frr#17229
0077-frr-vtysh-dependencies-for-srv6-static-patches.patch	FRRouting/frr@fd8edc3
0078-vtysh-de-conditionalize-and-reorder-install-node.patch	FRRouting/frr@e26c580
0079-staticd-add-support-for-srv6.patch	FRRouting/frr#16894
0081-bgpd-Optimize-evaluate-paths-for-a-peer-going-down.patch	FRRouting/frr@9f55368

Realigned patches:
Patch
0001-Reduce-severity-of-Vty-connected-from-message.patch
0002-Allow-BGP-attr-NEXT_HOP-to-be-0.0.0.0-due-to-allevia.patch
0003-nexthops-compare-vrf-only-if-ip-type.patch
0004-frr-remove-frr-log-outchannel-to-var-log-frr.log.patch
0005-Add-support-of-bgp-l3vni-evpn.patch
0006-Link-local-scope-was-not-set-while-binding-socket-for-bgp-ipv6-link-local-neighbors.patch
0007-ignore-route-from-default-table.patch
0008-Use-vrf_id-for-vrf-not-tabled_id.patch
0010-bgpd-Change-log-level-for-graceful-restart-events.patch
0021-Disable-ipv6-src-address-test-in-pceplib.patch
0022-cross-compile-changes.patch
0054-build-dplane-fpm-sonic-module.patch
0056-zebra-do-not-send-local-routes-to-fpm.patch
0057-Adding-changes-to-write-ip-nht-resolve-via-default-c.patch
0058-When-the-file-is-config-replayed-we-cannot-handle-th.patch
0061-Set-multipath-to-514-and-disable-bgp-vnc-for-optimiz.patch
0063-Patch-to-send-tag-value-associated-with-route-via-ne.patch
0080-SRv6-vpn-route-and-sidlist-install.patch
0082-Revert-bgpd-upon-if-event-evaluate-bnc-with-matching.patch
0083-staticd-add-cli-to-support-steering-of-ipv4-traffic-over-srv6-sid-list.patch
0084-lib-Return-duplicate-prefix-list-entry-test.patch
0085-This-error-happens-when-we-try-to-write-to-a-socket.patch

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants