From a37ef435e9514a455931ddbac090e9bea0943bb5 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 25 Oct 2017 11:03:41 -0400 Subject: [PATCH] zebra: Store packets to process in `struct zebra_t` Store the number of packets we should process at one time in `struct zebra_t`. A future commit will allow the user to control this via a hidden cli. Signed-off-by: Donald Sharp --- zebra/main.c | 1 + zebra/zserv.c | 2 +- zebra/zserv.h | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/zebra/main.c b/zebra/main.c index 5a2979c86..cf677a775 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -53,6 +53,7 @@ /* Zebra instance */ struct zebra_t zebrad = { .rtm_table_default = 0, + .packets_to_process = ZEBRA_ZAPI_PACKETS_TO_PROCESS, }; /* process id. */ diff --git a/zebra/zserv.c b/zebra/zserv.c index fe8213702..cbd532339 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -2387,7 +2387,7 @@ static int zebra_client_read(struct thread *thread) uint8_t marker, version; vrf_id_t vrf_id; struct zebra_vrf *zvrf; - int packets = 10; + int packets = zebrad.packets_to_process; /* Get thread data. Reset reading thread because I'm running. */ sock = THREAD_FD(thread); diff --git a/zebra/zserv.h b/zebra/zserv.h index d847526f2..279b56ec3 100644 --- a/zebra/zserv.h +++ b/zebra/zserv.h @@ -138,6 +138,9 @@ struct zebra_t { /* LSP work queue */ struct work_queue *lsp_process_q; + + #define ZEBRA_ZAPI_PACKETS_TO_PROCESS 10 + u_int32_t packets_to_process; }; extern struct zebra_t zebrad; extern unsigned int multipath_num; -- 2.39.2