summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-01-11 21:33:20 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-01-31 15:20:46 +0100
commite2353ec26533caf938a24422cd20dc687731d9c8 (patch)
tree1b88e38b1231f672a797d4d4f9c268f224174fc5
parentzebra: Move the mq data structure to zrouter (diff)
downloadfrr-e2353ec26533caf938a24422cd20dc687731d9c8.tar.xz
frr-e2353ec26533caf938a24422cd20dc687731d9c8.zip
zebra: Move lsp_process_q to zrouter
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--zebra/main.c4
-rw-r--r--zebra/zebra_mpls.c20
-rw-r--r--zebra/zebra_router.h3
-rw-r--r--zebra/zserv.h3
4 files changed, 15 insertions, 15 deletions
diff --git a/zebra/main.c b/zebra/main.c
index 6b58f4a13..811c4dd70 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 45280d5cc..6ce60c464 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 b4daeea24..39a7c9f87 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 5cad68d5d..9a07adb21 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;
};