From ca3491262b13f700ee37e985f51447866f64a3b1 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 5 Oct 2020 12:24:10 -0400 Subject: [PATCH] zebra: Isolate mlag_rd_buf_offset to the actual using function Isolate the mlag_rd_buf_offset variable to the actual used function, instead of having it a global. Signed-off-by: Donald Sharp --- zebra/zebra_mlag.c | 1 - zebra/zebra_mlag.h | 2 -- zebra/zebra_mlag_private.c | 2 ++ 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/zebra/zebra_mlag.c b/zebra/zebra_mlag.c index fb8798ebd9..d8ed9b2a3a 100644 --- a/zebra/zebra_mlag.c +++ b/zebra/zebra_mlag.c @@ -49,7 +49,6 @@ DEFINE_HOOK(zebra_mlag_private_cleanup_data, (), ()) uint8_t mlag_wr_buffer[ZEBRA_MLAG_BUF_LIMIT]; uint8_t mlag_rd_buffer[ZEBRA_MLAG_BUF_LIMIT]; -uint32_t mlag_rd_buf_offset; static bool test_mlag_in_progress; diff --git a/zebra/zebra_mlag.h b/zebra/zebra_mlag.h index 85028d2774..b195c75ea3 100644 --- a/zebra/zebra_mlag.h +++ b/zebra/zebra_mlag.h @@ -42,12 +42,10 @@ DECLARE_HOOK(zebra_mlag_private_cleanup_data, (), ()) extern uint8_t mlag_wr_buffer[ZEBRA_MLAG_BUF_LIMIT]; extern uint8_t mlag_rd_buffer[ZEBRA_MLAG_BUF_LIMIT]; -extern uint32_t mlag_rd_buf_offset; static inline void zebra_mlag_reset_read_buffer(void) { memset(mlag_wr_buffer, 0, ZEBRA_MLAG_BUF_LIMIT); - mlag_rd_buf_offset = 0; } enum zebra_mlag_state { diff --git a/zebra/zebra_mlag_private.c b/zebra/zebra_mlag_private.c index d39b0c0aee..8a66d6de72 100644 --- a/zebra/zebra_mlag_private.c +++ b/zebra/zebra_mlag_private.c @@ -74,6 +74,7 @@ static void zebra_mlag_sched_read(void) static int zebra_mlag_read(struct thread *thread) { + static uint32_t mlag_rd_buf_offset; uint32_t *msglen; uint32_t h_msglen; uint32_t tot_len, curr_len = mlag_rd_buf_offset; @@ -159,6 +160,7 @@ static int zebra_mlag_read(struct thread *thread) /* Register read thread. */ zebra_mlag_reset_read_buffer(); + mlag_rd_buf_offset = 0; zebra_mlag_sched_read(); return 0; } -- 2.39.5