zebra: Move lsp_process_q to zrouter

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2019-01-11 15:33:20 -05:00
parent ea45a4e7db
commit e2353ec265
4 changed files with 15 additions and 15 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
};