Skip to content

Commit 8c83dc8

Browse files
stepanblyschakdgsudharsanliat-grozovik
authored andcommitted
[FRR]Fixing the advertisement of static ipv6 route (#15688)
Co-authored-by: dgsudharsan <[email protected]> Co-authored-by: Liat Grozovik <[email protected]>
1 parent 7ef866b commit 8c83dc8

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From cb89515f7751c23368bc8dcaf0bcf768a42a0c11 Mon Sep 17 00:00:00 2001
2+
From: dgsudharsan <[email protected]>
3+
Date: Wed, 28 Jun 2023 19:42:16 +0000
4+
Subject: [PATCH] zebra: Static routes async notification do not need this test
5+
When using asic_offload with an asynchronous notification the
6+
rib_route_match_ctx function is testing for distance and tag being correct
7+
against the re. This is no longer necessary.
8+
9+
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
10+
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.
11+
e) Zebra master receives this and checks the distance and tag are correct for static routes and accepts the route and marks it installed.
12+
13+
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.
14+
15+
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.
16+
17+
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.
18+
19+
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
20+
index a8dbe4470..e021ed142 100644
21+
--- a/zebra/zebra_rib.c
22+
+++ b/zebra/zebra_rib.c
23+
@@ -1385,15 +1385,12 @@ static bool rib_route_match_ctx(const struct route_entry *re,
24+
(re->instance == dplane_ctx_get_instance(ctx))) {
25+
result = true;
26+
27+
- /* We use an extra test for statics, and another for
28+
- * kernel routes.
29+
+ /*
30+
+ * We use different tests for kernel and for
31+
+ * connected routes.
32+
*/
33+
- if (re->type == ZEBRA_ROUTE_STATIC &&
34+
- (re->distance != dplane_ctx_get_distance(ctx) ||
35+
- re->tag != dplane_ctx_get_tag(ctx))) {
36+
- result = false;
37+
- } else if (re->type == ZEBRA_ROUTE_KERNEL &&
38+
- re->metric != dplane_ctx_get_metric(ctx)) {
39+
+ if (re->type == ZEBRA_ROUTE_KERNEL &&
40+
+ re->metric != dplane_ctx_get_metric(ctx)) {
41+
result = false;
42+
} else if (re->type == ZEBRA_ROUTE_CONNECT) {
43+
result = nexthop_group_equal_no_recurse(
44+
--
45+
2.17.1
46+

src/sonic-frr/patch/series

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ cross-compile-changes.patch
2828
0027-bgpd-Ensure-FRR-has-enough-data-to-read-in-peek_for_as4_capability-and-bgp_open_option_parse.patch
2929
0028-bgpd-Ensure-that-bgp-open-message-stream-has-enough-data-to-read.patch
3030
0029-bgpd-Change-log-level-for-graceful-restart-events.patch
31-
31+
0030-zebra-Static-routes-async-notification-do-not-need-t.patch

0 commit comments

Comments
 (0)