]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Move packets_to_process to zrouter
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 11 Jan 2019 20:35:45 +0000 (15:35 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 31 Jan 2019 14:20:46 +0000 (09:20 -0500)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/main.c
zebra/zebra_router.c
zebra/zebra_router.h
zebra/zebra_vty.c
zebra/zserv.c
zebra/zserv.h

index 811c4dd70b4ca8731016edb888deceb5e812e7bb..c9fc0f8381436fddd7072ac2b06691b43d1aed98 100644 (file)
@@ -64,7 +64,6 @@
 
 /* Zebra instance */
 struct zebra_t zebrad = {
-       .packets_to_process = ZEBRA_ZAPI_PACKETS_TO_PROCESS,
 };
 
 /* process id. */
index 24dd2691c7d8709cf1561a3d78ab5cb8038f2b64..c3b861c2424b0f16a93c9f90f15bb12bb31ce4ae 100644 (file)
@@ -210,6 +210,7 @@ void zebra_router_init(void)
        zrouter.sequence_num = 0;
 
        zrouter.rtm_table_default = 0;
+       zrouter.packets_to_process = ZEBRA_ZAPI_PACKETS_TO_PROCESS;
 
        zebra_vxlan_init();
        zebra_mlag_init();
index 39a7c9f8750c70ffe856629f3672770d73fece62..332a4c3f95595b1be7905aecc27fe1df298bc537 100644 (file)
@@ -84,6 +84,9 @@ struct zebra_router {
 
        /* LSP work queue */
        struct work_queue *lsp_process_q;
+
+#define ZEBRA_ZAPI_PACKETS_TO_PROCESS 1000
+       _Atomic uint32_t packets_to_process;
 };
 
 extern struct zebra_router zrouter;
index 874ab3edac5f564e5713f4cebb1faeb876dc9d3f..4e7bf33db2698b51c3ecae4335a48468dcfd4eb1 100644 (file)
@@ -2456,7 +2456,7 @@ DEFUN_HIDDEN (zebra_packet_process,
 {
        uint32_t packets = strtoul(argv[2]->arg, NULL, 10);
 
-       atomic_store_explicit(&zebrad.packets_to_process, packets,
+       atomic_store_explicit(&zrouter.packets_to_process, packets,
                              memory_order_relaxed);
 
        return CMD_SUCCESS;
@@ -2470,7 +2470,7 @@ DEFUN_HIDDEN (no_zebra_packet_process,
              "Zapi Protocol\n"
              "Number of packets to process before relinquishing thread\n")
 {
-       atomic_store_explicit(&zebrad.packets_to_process,
+       atomic_store_explicit(&zrouter.packets_to_process,
                              ZEBRA_ZAPI_PACKETS_TO_PROCESS,
                              memory_order_relaxed);
 
@@ -2551,9 +2551,9 @@ static int config_write_protocol(struct vty *vty)
        if (zrouter.ribq->spec.hold != ZEBRA_RIB_PROCESS_HOLD_TIME)
                vty_out(vty, "zebra work-queue %u\n", zrouter.ribq->spec.hold);
 
-       if (zebrad.packets_to_process != ZEBRA_ZAPI_PACKETS_TO_PROCESS)
+       if (zrouter.packets_to_process != ZEBRA_ZAPI_PACKETS_TO_PROCESS)
                vty_out(vty, "zebra zapi-packets %u\n",
-                       zebrad.packets_to_process);
+                       zrouter.packets_to_process);
 
        enum multicast_mode ipv4_multicast_mode = multicast_mode_ipv4_get();
 
index e20c0daaa69f56eeb3c7ebd7a9988c6cf2680cbd..c6b0d84a1562601e84c922c31286732abad8f879 100644 (file)
@@ -316,7 +316,7 @@ static int zserv_read(struct thread *thread)
        uint32_t p2p;
        struct zmsghdr hdr;
 
-       p2p_orig = atomic_load_explicit(&zebrad.packets_to_process,
+       p2p_orig = atomic_load_explicit(&zrouter.packets_to_process,
                                        memory_order_relaxed);
        cache = stream_fifo_new();
        p2p = p2p_orig;
@@ -496,7 +496,7 @@ static int zserv_process_messages(struct thread *thread)
        struct zserv *client = THREAD_ARG(thread);
        struct stream *msg;
        struct stream_fifo *cache = stream_fifo_new();
-       uint32_t p2p = zebrad.packets_to_process;
+       uint32_t p2p = zrouter.packets_to_process;
        bool need_resched = false;
 
        pthread_mutex_lock(&client->ibuf_mtx);
index 9a07adb2168bb51ad389763ac22bf93bac939495..4461ea5cd520f628f457227f5ebbb736a9bd91d0 100644 (file)
@@ -175,8 +175,6 @@ DECLARE_KOOH(zserv_client_close, (struct zserv *client), (client));
 
 /* Zebra instance */
 struct zebra_t {
-#define ZEBRA_ZAPI_PACKETS_TO_PROCESS 1000
-       _Atomic uint32_t packets_to_process;
 };
 extern struct zebra_t zebrad;
 extern unsigned int multipath_num;