summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-11-14 08:28:45 -0500
committerDonald Sharp <sharpd@nvidia.com>2022-11-14 08:31:18 -0500
commit551fa8c3549e24020dfce33d06ade4a14f72abfe (patch)
tree38e3dd45d9073eca76e32c82e29fb2e029b8bd56
parentdc31de93e1a79b4a138b474d3c4fdb44cdfee6f3 (diff)
zebra: Fix dplane_fpm_nl to allow for fast configuration
If you have this order in your configuration file: no fpm use-next-hop-groups fpm address 127.0.0.1 the dplane code was using the same event thread t_event and the second add event in the code was going, you already have an event scheduled and as such the second event does not overwrite it. Leaving no code to actually start the whole processing. There are probably other cli iterations that will cause this fun as well, but I'm not going to spend the time sussing them out at the moment. Fixes: #12314 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
-rw-r--r--zebra/dplane_fpm_nl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/zebra/dplane_fpm_nl.c b/zebra/dplane_fpm_nl.c
index 7383c982ba..c5e1c113cb 100644
--- a/zebra/dplane_fpm_nl.c
+++ b/zebra/dplane_fpm_nl.c
@@ -98,6 +98,7 @@ struct fpm_nl_ctx {
struct thread *t_read;
struct thread *t_write;
struct thread *t_event;
+ struct thread *t_nhg;
struct thread *t_dequeue;
/* zebra events. */
@@ -271,7 +272,7 @@ DEFUN(fpm_use_nhg, fpm_use_nhg_cmd,
return CMD_SUCCESS;
thread_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
- FNE_TOGGLE_NHG, &gfnc->t_event);
+ FNE_TOGGLE_NHG, &gfnc->t_nhg);
return CMD_SUCCESS;
}
@@ -287,7 +288,7 @@ DEFUN(no_fpm_use_nhg, no_fpm_use_nhg_cmd,
return CMD_SUCCESS;
thread_add_event(gfnc->fthread->master, fpm_process_event, gfnc,
- FNE_TOGGLE_NHG, &gfnc->t_event);
+ FNE_TOGGLE_NHG, &gfnc->t_nhg);
return CMD_SUCCESS;
}
@@ -1367,6 +1368,8 @@ static int fpm_nl_finish_early(struct fpm_nl_ctx *fnc)
THREAD_OFF(fnc->t_ribwalk);
THREAD_OFF(fnc->t_rmacreset);
THREAD_OFF(fnc->t_rmacwalk);
+ THREAD_OFF(fnc->t_event);
+ THREAD_OFF(fnc->t_nhg);
thread_cancel_async(fnc->fthread->master, &fnc->t_read, NULL);
thread_cancel_async(fnc->fthread->master, &fnc->t_write, NULL);
thread_cancel_async(fnc->fthread->master, &fnc->t_connect, NULL);