mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 13:21:22 +00:00
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>
This commit is contained in:
parent
ded3e3e39c
commit
ca3491262b
@ -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;
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user