diff --git a/src/sonic-frr/patch/0030-zebra-Static-routes-async-notification-do-not-need-t.patch b/src/sonic-frr/patch/0030-zebra-Static-routes-async-notification-do-not-need-t.patch new file mode 100644 index 000000000000..aab240f018ab --- /dev/null +++ b/src/sonic-frr/patch/0030-zebra-Static-routes-async-notification-do-not-need-t.patch @@ -0,0 +1,46 @@ +From cb89515f7751c23368bc8dcaf0bcf768a42a0c11 Mon Sep 17 00:00:00 2001 +From: dgsudharsan +Date: Wed, 28 Jun 2023 19:42:16 +0000 +Subject: [PATCH] zebra: Static routes async notification do not need this test + When using asic_offload with an asynchronous notification the + rib_route_match_ctx function is testing for distance and tag being correct + against the re. This is no longer necessary. + +Normal route notification for static routes is this(well really all routes): a) zebra dplane generates a ctx to send to the dplane for route install b) dplane installs it in the kernel +c) if the dplane_fpm_nl.c module is being used it installs it. d) The context's success code is set to it worked and passes the context back up to zebra for processing. +e) Zebra master receives this and checks the distance and tag are correct for static routes and accepts the route and marks it installed. + +If the operator is using a wait for install mechansim where the dplane is asynchronously sending the result back up at a future time and it is using the dplane_fpm_nl.c code where it uses the rt_netlink.c route parsing code, then there is no way to set distance as that we do not pass distance to the kernel. + +As such static routes were never being properly handled since the re and context would not match and the route would still be marked as queued. + +This code is historical in nature and is no longer necessary. rib_route_match_ctx is only ever used with dplane notifications. Additionally static routes are now handled more intelligently from staticd and the distance changes are held in staticd not zebra, thus it can be removed. + +diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c +index a8dbe4470..e021ed142 100644 +--- a/zebra/zebra_rib.c ++++ b/zebra/zebra_rib.c +@@ -1385,15 +1385,12 @@ static bool rib_route_match_ctx(const struct route_entry *re, + (re->instance == dplane_ctx_get_instance(ctx))) { + result = true; + +- /* We use an extra test for statics, and another for +- * kernel routes. ++ /* ++ * We use different tests for kernel and for ++ * connected routes. + */ +- if (re->type == ZEBRA_ROUTE_STATIC && +- (re->distance != dplane_ctx_get_distance(ctx) || +- re->tag != dplane_ctx_get_tag(ctx))) { +- result = false; +- } else if (re->type == ZEBRA_ROUTE_KERNEL && +- re->metric != dplane_ctx_get_metric(ctx)) { ++ if (re->type == ZEBRA_ROUTE_KERNEL && ++ re->metric != dplane_ctx_get_metric(ctx)) { + result = false; + } else if (re->type == ZEBRA_ROUTE_CONNECT) { + result = nexthop_group_equal_no_recurse( +-- +2.17.1 + diff --git a/src/sonic-frr/patch/series b/src/sonic-frr/patch/series index db97b2ea823f..0de573f3a596 100644 --- a/src/sonic-frr/patch/series +++ b/src/sonic-frr/patch/series @@ -28,4 +28,4 @@ cross-compile-changes.patch 0027-bgpd-Ensure-FRR-has-enough-data-to-read-in-peek_for_as4_capability-and-bgp_open_option_parse.patch 0028-bgpd-Ensure-that-bgp-open-message-stream-has-enough-data-to-read.patch 0029-bgpd-Change-log-level-for-graceful-restart-events.patch - +0030-zebra-Static-routes-async-notification-do-not-need-t.patch