From: Donald Sharp Date: Fri, 11 Jan 2019 20:33:20 +0000 (-0500) Subject: zebra: Move lsp_process_q to zrouter X-Git-Tag: 7.1_pulled~282^2~6 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=e2353ec26533caf938a24422cd20dc687731d9c8;p=matthieu%2Ffrr.git zebra: Move lsp_process_q to zrouter Signed-off-by: Donald Sharp --- diff --git a/zebra/main.c b/zebra/main.c index 6b58f4a137..811c4dd70b 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -167,8 +167,8 @@ static void sigint(void) if (zvrf) SET_FLAG(zvrf->flags, ZEBRA_VRF_RETAIN); } - if (zebrad.lsp_process_q) - work_queue_free_and_null(&zebrad.lsp_process_q); + if (zrouter.lsp_process_q) + work_queue_free_and_null(&zrouter.lsp_process_q); vrf_terminate(); ns_walk_func(zebra_ns_early_shutdown); diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 45280d5cc8..6ce60c4641 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -1075,13 +1075,13 @@ static int lsp_processq_add(zebra_lsp_t *lsp) if (CHECK_FLAG(lsp->flags, LSP_FLAG_SCHEDULED)) return 0; - if (zebrad.lsp_process_q == NULL) { + if (zrouter.lsp_process_q == NULL) { flog_err(EC_ZEBRA_WQ_NONEXISTENT, "%s: work_queue does not exist!", __func__); return -1; } - work_queue_add(zebrad.lsp_process_q, lsp); + work_queue_add(zrouter.lsp_process_q, lsp); SET_FLAG(lsp->flags, LSP_FLAG_SCHEDULED); return 0; } @@ -1717,19 +1717,19 @@ static char *snhlfe2str(zebra_snhlfe_t *snhlfe, char *buf, int size) */ static int mpls_processq_init(struct zebra_t *zebra) { - zebra->lsp_process_q = work_queue_new(zrouter.master, "LSP processing"); - if (!zebra->lsp_process_q) { + zrouter.lsp_process_q = work_queue_new(zrouter.master, "LSP processing"); + if (!zrouter.lsp_process_q) { flog_err(EC_ZEBRA_WQ_NONEXISTENT, "%s: could not initialise work queue!", __func__); return -1; } - zebra->lsp_process_q->spec.workfunc = &lsp_process; - zebra->lsp_process_q->spec.del_item_data = &lsp_processq_del; - zebra->lsp_process_q->spec.errorfunc = NULL; - zebra->lsp_process_q->spec.completion_func = &lsp_processq_complete; - zebra->lsp_process_q->spec.max_retries = 0; - zebra->lsp_process_q->spec.hold = 10; + zrouter.lsp_process_q->spec.workfunc = &lsp_process; + zrouter.lsp_process_q->spec.del_item_data = &lsp_processq_del; + zrouter.lsp_process_q->spec.errorfunc = NULL; + zrouter.lsp_process_q->spec.completion_func = &lsp_processq_complete; + zrouter.lsp_process_q->spec.max_retries = 0; + zrouter.lsp_process_q->spec.hold = 10; return 0; } diff --git a/zebra/zebra_router.h b/zebra/zebra_router.h index b4daeea245..39a7c9f875 100644 --- a/zebra/zebra_router.h +++ b/zebra/zebra_router.h @@ -81,6 +81,9 @@ struct zebra_router { /* Meta Queue Information */ struct meta_queue *mq; + + /* LSP work queue */ + struct work_queue *lsp_process_q; }; extern struct zebra_router zrouter; diff --git a/zebra/zserv.h b/zebra/zserv.h index 5cad68d5d0..9a07adb216 100644 --- a/zebra/zserv.h +++ b/zebra/zserv.h @@ -175,9 +175,6 @@ DECLARE_KOOH(zserv_client_close, (struct zserv *client), (client)); /* Zebra instance */ struct zebra_t { - /* LSP work queue */ - struct work_queue *lsp_process_q; - #define ZEBRA_ZAPI_PACKETS_TO_PROCESS 1000 _Atomic uint32_t packets_to_process; };