summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-01-11 21:35:45 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-01-31 15:20:46 +0100
commit5ec5a7160a9e61ce6e84a65648c345cb10b160c4 (patch)
tree39b4a3680ab3e9833fff624e3eb512b2dc1591ac
parentzebra: Move lsp_process_q to zrouter (diff)
downloadfrr-5ec5a7160a9e61ce6e84a65648c345cb10b160c4.tar.xz
frr-5ec5a7160a9e61ce6e84a65648c345cb10b160c4.zip
zebra: Move packets_to_process to zrouter
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--zebra/main.c1
-rw-r--r--zebra/zebra_router.c1
-rw-r--r--zebra/zebra_router.h3
-rw-r--r--zebra/zebra_vty.c8
-rw-r--r--zebra/zserv.c4
-rw-r--r--zebra/zserv.h2
6 files changed, 10 insertions, 9 deletions
diff --git a/zebra/main.c b/zebra/main.c
index 811c4dd70..c9fc0f838 100644
--- a/zebra/main.c
+++ b/zebra/main.c
@@ -64,7 +64,6 @@
/* Zebra instance */
struct zebra_t zebrad = {
- .packets_to_process = ZEBRA_ZAPI_PACKETS_TO_PROCESS,
};
/* process id. */
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c
index 24dd2691c..c3b861c24 100644
--- a/zebra/zebra_router.c
+++ b/zebra/zebra_router.c
@@ -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();
diff --git a/zebra/zebra_router.h b/zebra/zebra_router.h
index 39a7c9f87..332a4c3f9 100644
--- a/zebra/zebra_router.h
+++ b/zebra/zebra_router.h
@@ -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;
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 874ab3eda..4e7bf33db 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -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();
diff --git a/zebra/zserv.c b/zebra/zserv.c
index e20c0daaa..c6b0d84a1 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -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);
diff --git a/zebra/zserv.h b/zebra/zserv.h
index 9a07adb21..4461ea5cd 100644
--- a/zebra/zserv.h
+++ b/zebra/zserv.h
@@ -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;