-
Notifications
You must be signed in to change notification settings - Fork 1.4k
staticd: Add support for SRv6 uA behavior #18198
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
Conversation
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.
Tested with both Linux Kernel and SONiC dataplanes.
@@ -321,6 +321,7 @@ struct srv6_sid_ctx { | |||
struct in_addr nh4; | |||
struct in6_addr nh6; | |||
vrf_id_t vrf_id; | |||
ifindex_t ifindex; |
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.
so nexthops have a ifindex already. I don't understand enough about SRv6 to say if that would be ok or not to use?
For SRv6 what is the actual definition of a nexthop? Does it possibly include a ifindex already? What if they disagree?
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.
Hi Donald, many thanks for the review.
nh4
and nh6
are not nexthop objects. It is the IP address of the next hop.
This is how it is also defined in the IETF SRv6 YANG model https://datatracker.ietf.org/doc/html/draft-ietf-spring-srv6-yang-04
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.
I updated the commit message to clarify this.
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.
would removing nh4 / nh6 vrf_id and ifindex, replacing with struct nexthop
make anything clearer or easier to do? I wonder why we have this specialized structure here, when we something generic like struct nexthop could work?
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.
Hi Donald,
Many thanks for your comments.
I’m already working on revisiting all the SRv6 data structures that have been added in the last years. I will open a refactoring PR for this.
I will definitely include your feedback in my refactoring PR.
I’m also doing some performance improvements. As part of the refactoring, I will also include these enhancements.
ca78bad
to
b20ea35
Compare
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.
looks good ... I think it's okay to leave the structure refactoring to another pr?
Hi @riw777 Many thanks for the review. |
The uA behavior is associated with an interface and the IP address of the nexthop. However, the current SID context data structure only includes the IP address. It lacks the interface. This commit extends the SID context data structure by adding the ifindex. This extension allows daemons to allocate uA SIDs with the required interface and IP address. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
The SRv6 uA behavior is associated with a L3 adjacency. This commit extends the staticd YANG model by adding two leafs `interface` and `next-hop` under the `static-sids` container. This extension allows us to associate an interface and a nexthop when configuring an SRv6 uA SID. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
An SRv6 uA SID is associated with the interface and (optionally) the IPv6 address of the nexthop. This commit adds the modify and destroy nortbound callbacks required to set the interface. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
An SRv6 uA SID is associated with the interface and (optionally) the IPv6 address of the nexthop. This commit adds the modify and destroy nortbound callbacks required to set the nexthop. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
In order to configure an SRv6 uA SID in staticd, staticd should request SRv6 SID Manager to allocate a SID bound to the uA behavior. Currently, `static_zebra_request_srv6_sid` does not support requesting SIDs bound to the uA behavior. This commit extends the `static_zebra_request_srv6_sid` function to enable staticd to request SIDs bound to the uA behavior. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
When removing an SRv6 uA SID, staticd should ask SRv6 SID Manager to release the SID. Currently, `static_zebra_release_srv6_sid` does not allow to release uA SIDs. This commit extends `static_zebra_release_srv6_sid` to allow staticd to release SRv6 uA SIDs. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit extends the `static_zebra_srv6_sid_install` function to allow staticd to install SRv6 uA SIDs into the zebra RIB. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
…A SIDs This commit extends the `static_zebra_srv6_sid_uninstall` function to allow staticd to remove SRv6 uA SIDs from the zebra RIB. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit extends the STATIC CLI to support the configuration of uA SIDs. ``` router(config)# sid fcbb:bbbb:1:fe00::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2 ``` Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit extends the STATIC CLI to support the deletion of uA SIDs. ``` router(config)# no sid fcbb:bbbb:1:fe00::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2 ``` Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit extends the SRv6 SIDs show CLI to display the configured SRv6 uA SIDs. ``` segment-routing srv6 static-sids sid fcbb:bbbb:1:fe40::/64 locator MAIN behavior uA interface sr0 nexthop 2001::2 ! ! ! ``` Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit adds a test case to ensure staticd correctly programs SRv6 uA SIDs in the RIB. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
This commit adds detailed explanation on configuring SRv6 uA SIDs. Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
b20ea35
to
35b40cc
Compare
Rebased on latest master to fix conflicts |
Hey @cscarpitta, Let's discuss GIB vs LIB allocation with static uA. |
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>
The SRv6 support in staticd was introduced in PR #16894. The currently supported behaviors are uN, uDT4, uDT6, uDT46.
This PR extends the SRv6 uSID support in staticd to add support for the uA behavior.