]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Store packets to process in `struct zebra_t`
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 25 Oct 2017 15:03:41 +0000 (11:03 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 25 Oct 2017 15:03:41 +0000 (11:03 -0400)
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 <sharpd@cumulusnetworks.com>
zebra/main.c
zebra/zserv.c
zebra/zserv.h

index 5a2979c866af00e5fc2b2a233d6924bc5fff2f74..cf677a775350e7469759fec75cb44942f57fd7fc 100644 (file)
@@ -53,6 +53,7 @@
 /* Zebra instance */
 struct zebra_t zebrad = {
        .rtm_table_default = 0,
+       .packets_to_process = ZEBRA_ZAPI_PACKETS_TO_PROCESS,
 };
 
 /* process id. */
index fe8213702bf89ffe052a5292b710b311970ec455..cbd532339d1b9a1c9e3ced17638ec94ba6660c26 100644 (file)
@@ -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);
index d847526f2e59501abce21cce7103288436431b36..279b56ec3c4ad93e16e7886cf96b6df2e24611a0 100644 (file)
@@ -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;