diff options
author | Donald Sharp <sharpd@nvidia.com> | 2023-11-20 18:46:36 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2023-11-21 18:41:18 +0100 |
commit | 82463eb1a927bcbc398765e29f76cd4d5f0c005d (patch) | |
tree | 27ea8bcd23ce7399937af8657fe590720d666e55 /zebra | |
parent | zebra: On shutdown, ensure ctx's in rib_dplane_q are freed (diff) | |
download | frr-82463eb1a927bcbc398765e29f76cd4d5f0c005d.tar.xz frr-82463eb1a927bcbc398765e29f76cd4d5f0c005d.zip |
zebra: On shutdown, ensure dg_update_list is emptied
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/zebra_dplane.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index e1d1e8417..afe421679 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -7360,6 +7360,7 @@ static void dplane_thread_loop(struct event *event) void zebra_dplane_shutdown(void) { struct zebra_dplane_provider *dp; + struct zebra_dplane_ctx *ctx; if (IS_ZEBRA_DEBUG_DPLANE) zlog_debug("Zebra dataplane shutdown called"); @@ -7396,6 +7397,16 @@ void zebra_dplane_shutdown(void) } /* TODO -- Clean queue(s), free memory */ + DPLANE_LOCK(); + { + ctx = dplane_ctx_list_pop(&zdplane_info.dg_update_list); + while (ctx) { + dplane_ctx_free(&ctx); + + ctx = dplane_ctx_list_pop(&zdplane_info.dg_update_list); + } + } + DPLANE_UNLOCK(); } /* |