From: Donald Sharp Date: Wed, 25 Oct 2017 15:03:41 +0000 (-0400) Subject: zebra: Store packets to process in `struct zebra_t` X-Git-Tag: frr-4.0-dev~175^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=a37ef435e9514a455931ddbac090e9bea0943bb5;p=mirror%2Ffrr.git 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 --- diff --git a/zebra/main.c b/zebra/main.c index 5a2979c866..cf677a7753 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 fe8213702b..cbd532339d 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 d847526f2e..279b56ec3c 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;