From: Stephen Worley Date: Fri, 4 Oct 2019 18:32:26 +0000 (-0400) Subject: zebra: Remove cleanup and nhg workqueue boilerplate X-Git-Tag: base_7.3~219^2~10 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=fefa080e3c6667db48a749015b4590951ef17e10;p=mirror%2Ffrr.git zebra: Remove cleanup and nhg workqueue boilerplate This code was from a strategies we elected not to use and can safely be removed. Signed-off-by: Stephen Worley --- diff --git a/zebra/main.c b/zebra/main.c index e57b84c8f6..334354eaae 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -166,7 +166,6 @@ static void sigint(void) if (zrouter.lsp_process_q) work_queue_free_and_null(&zrouter.lsp_process_q); - zebra_router_cleanup(); vrf_terminate(); ns_walk_func(zebra_ns_early_shutdown); diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index f4fc06efc9..44524ec507 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -1834,25 +1834,6 @@ void zebra_nhg_uninstall_kernel(struct nhg_hash_entry *nhe) zebra_nhg_handle_uninstall(nhe); } -static void zebra_nhg_uninstall_created(struct hash_bucket *bucket, void *arg) -{ - struct nhg_hash_entry *nhe = NULL; - - nhe = (struct nhg_hash_entry *)bucket->data; - - if (ZEBRA_NHG_CREATED(nhe)) - zebra_nhg_uninstall_kernel(nhe); -} - -void zebra_nhg_cleanup_tables(struct hash *hash) -{ - /* - * TODO: These should only be uninstalled via route cleanup path? - */ - return; - hash_iterate(hash, zebra_nhg_uninstall_created, NULL); -} - void zebra_nhg_dplane_result(struct zebra_dplane_ctx *ctx) { enum dplane_op_e op; diff --git a/zebra/zebra_nhg.h b/zebra/zebra_nhg.h index d3c63cff30..e5eb518628 100644 --- a/zebra/zebra_nhg.h +++ b/zebra/zebra_nhg.h @@ -169,9 +169,6 @@ struct nhg_ctx { }; -void zebra_nhg_init(void); -void zebra_nhg_terminate(void); - extern void nhg_connected_free(struct nhg_connected *dep); extern struct nhg_connected *nhg_connected_new(struct nhg_hash_entry *nhe); @@ -263,8 +260,6 @@ extern uint8_t zebra_nhg_nhe2grp(struct nh_grp *grp, struct nhg_hash_entry *nhe, void zebra_nhg_install_kernel(struct nhg_hash_entry *nhe); void zebra_nhg_uninstall_kernel(struct nhg_hash_entry *nhe); -void zebra_nhg_cleanup_tables(struct hash *hash); - /* Forward ref of dplane update context type */ struct zebra_dplane_ctx; void zebra_nhg_dplane_result(struct zebra_dplane_ctx *ctx); diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index d6ec6ac165..f52249ad8b 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -271,14 +271,3 @@ void zebra_router_init(void) hash_create_size(8, zebra_nhg_id_key, zebra_nhg_hash_id_equal, "Zebra Router Nexthop Groups ID index"); } - -/** - * zebra_router_cleanup() - Perform any cleanup actions before termination - * - * Right now this is just being used to clear the nexthops we installed in - * the kernel on shutdown before the routes are cleaned via vrf_terminated(). - */ -void zebra_router_cleanup(void) -{ - zebra_nhg_cleanup_tables(zrouter.nhgs_id); -}