mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-10 20:18:03 +00:00
fpm: reset/walk data structures on connection
Don't attempt to walk data structures while not connected so we can save some CPU usage when FPM server is offline. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
1f9193c1f0
commit
f584de526d
@ -536,6 +536,13 @@ static int fpm_write(struct thread *t)
|
|||||||
|
|
||||||
fnc->connecting = false;
|
fnc->connecting = false;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Starting with LSPs walk all FPM objects, marking them
|
||||||
|
* as unsent and then replaying them.
|
||||||
|
*/
|
||||||
|
thread_add_timer(zrouter.master, fpm_lsp_reset, fnc, 0,
|
||||||
|
&fnc->t_lspreset);
|
||||||
|
|
||||||
/* Permit receiving messages now. */
|
/* Permit receiving messages now. */
|
||||||
thread_add_read(fnc->fthread->master, fpm_read, fnc,
|
thread_add_read(fnc->fthread->master, fpm_read, fnc,
|
||||||
fnc->socket, &fnc->t_read);
|
fnc->socket, &fnc->t_read);
|
||||||
@ -658,7 +665,10 @@ static int fpm_connect(struct thread *t)
|
|||||||
/*
|
/*
|
||||||
* Starting with LSPs walk all FPM objects, marking them
|
* Starting with LSPs walk all FPM objects, marking them
|
||||||
* as unsent and then replaying them.
|
* as unsent and then replaying them.
|
||||||
|
*
|
||||||
|
* If we are not connected, then delay the objects reset/send.
|
||||||
*/
|
*/
|
||||||
|
if (!fnc->connecting)
|
||||||
thread_add_timer(zrouter.master, fpm_lsp_reset, fnc, 0,
|
thread_add_timer(zrouter.master, fpm_lsp_reset, fnc, 0,
|
||||||
&fnc->t_lspreset);
|
&fnc->t_lspreset);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user