From: Donald Sharp Date: Mon, 5 Oct 2020 16:24:10 +0000 (-0400) Subject: zebra: Isolate mlag_rd_buf_offset to the actual using function X-Git-Tag: base_7.6~416^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F7244%2Fhead;p=mirror%2Ffrr.git 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 --- 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; }