summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-11-16 12:55:34 -0500
committerDonald Sharp <sharpd@nvidia.com>2023-11-21 12:41:18 -0500
commita1c1b9d9c5065d95eec7a860e067c2c9a6ca6937 (patch)
tree2091c701da0452bde1a0fb0c79202cd7b204fef8 /zebra/zebra_rib.c
parent7bf3c2fb195f34382e1bf00ed2c91310a1dc9f86 (diff)
zebra: On shutdown, ensure ctx's in rib_dplane_q are freed
a) Rename rib_init to zebra_rib_init() to better follow how things are named b) on shutdown cycle through the rib_dplane_q and free up any contexts sitting in it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 45a75ba24b..bd82d6caf8 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -4926,7 +4926,7 @@ static void check_route_info(void)
}
/* Routing information base initialize. */
-void rib_init(void)
+void zebra_rib_init(void)
{
check_route_info();
@@ -4938,6 +4938,20 @@ void rib_init(void)
zebra_dplane_init(rib_dplane_results);
}
+void zebra_rib_terminate(void)
+{
+ struct zebra_dplane_ctx *ctx;
+
+ EVENT_OFF(t_dplane);
+
+ ctx = dplane_ctx_dequeue(&rib_dplane_q);
+ while (ctx) {
+ dplane_ctx_fini(&ctx);
+
+ ctx = dplane_ctx_dequeue(&rib_dplane_q);
+ }
+}
+
/*
* vrf_id_get_next
*