diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2020-10-05 12:24:10 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2020-10-13 16:02:05 -0400 |
| commit | ca3491262b13f700ee37e985f51447866f64a3b1 (patch) | |
| tree | 9d280172c11dd1515f5d7f78f25187f18f0c1e59 | |
| parent | ded3e3e39c08996343aa00cf2775933e4ef176c3 (diff) | |
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 <sharpd@nvidia.com>
| -rw-r--r-- | zebra/zebra_mlag.c | 1 | ||||
| -rw-r--r-- | zebra/zebra_mlag.h | 2 | ||||
| -rw-r--r-- | 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; } |
