summaryrefslogtreecommitdiffstats
path: root/src/plugins/lacp/mux_machine.c
diff options
context:
space:
mode:
authorElias Rudberg <elias.rudberg@bahnhof.net>2020-05-07 14:29:21 +0200
committerElias Rudberg <elias.rudberg@bahnhof.net>2020-05-07 14:29:21 +0200
commit92e1b83a39458f98ff649883334b153f03af603b (patch)
treefe7a6accac254a3151081b5fccc27c7933d9e273 /src/plugins/lacp/mux_machine.c
parenta1e03d4da71a2452c1e5da399d96c51f1b487cad (diff)
lacp: fix regarding vm arg for vlib_time_now calls
Use thread-specific vlib_main_t *vm pointers to avoid problems with different threads accessing the same vlib_main_t data structure. This avoids assertion failure when vlib_time_now() is called with a vm corresponding to a different thread. Type: fix Signed-off-by: Elias Rudberg <elias.rudberg@bahnhof.net> Change-Id: I359596ecff86e03d57aa8d2330f77bf9a913485f
Diffstat (limited to 'src/plugins/lacp/mux_machine.c')
-rw-r--r--src/plugins/lacp/mux_machine.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/plugins/lacp/mux_machine.c b/src/plugins/lacp/mux_machine.c
index bbe452da454..6a5549077a2 100644
--- a/src/plugins/lacp/mux_machine.c
+++ b/src/plugins/lacp/mux_machine.c
@@ -98,14 +98,13 @@ lacp_mux_action_detached (void *p1, void *p2)
{
vlib_main_t *vm = p1;
slave_if_t *sif = p2;
- lacp_main_t *lm = &lacp_main;
lacp_detach_mux_from_aggregator (vm, sif);
sif->actor.state &= ~LACP_STATE_COLLECTING;
bond_disable_collecting_distributing (vm, sif);
sif->actor.state &= ~LACP_STATE_DISTRIBUTING;
sif->ntt = 1;
- lacp_start_periodic_timer (lm->vlib_main, sif, 0);
+ lacp_start_periodic_timer (vm, sif, 0);
if (sif->selected == LACP_PORT_SELECTED)
lacp_machine_dispatch (&lacp_mux_machine, vm, sif,
@@ -123,14 +122,13 @@ lacp_mux_action_attached (void *p1, void *p2)
{
vlib_main_t *vm = p1;
slave_if_t *sif = p2;
- lacp_main_t *lm = &lacp_main;
lacp_attach_mux_to_aggregator (vm, sif);
sif->actor.state &= ~LACP_STATE_COLLECTING;
bond_disable_collecting_distributing (vm, sif);
sif->actor.state &= ~LACP_STATE_DISTRIBUTING;
sif->ntt = 1;
- lacp_start_periodic_timer (lm->vlib_main, sif, 0);
+ lacp_start_periodic_timer (vm, sif, 0);
if ((sif->selected == LACP_PORT_UNSELECTED) ||
(sif->selected == LACP_PORT_STANDBY))
@@ -149,11 +147,9 @@ lacp_mux_action_waiting (void *p1, void *p2)
{
vlib_main_t *vm = p1;
slave_if_t *sif = p2;
- lacp_main_t *lm = &lacp_main;
if (!lacp_timer_is_running (sif->wait_while_timer))
- lacp_start_wait_while_timer (lm->vlib_main, sif,
- LACP_AGGREGATE_WAIT_TIME);
+ lacp_start_wait_while_timer (vm, sif, LACP_AGGREGATE_WAIT_TIME);
if ((sif->selected == LACP_PORT_SELECTED) && sif->ready)
lacp_machine_dispatch (&lacp_mux_machine, vm, sif,
@@ -171,13 +167,12 @@ lacp_mux_action_collecting_distributing (void *p1, void *p2)
{
vlib_main_t *vm = p1;
slave_if_t *sif = p2;
- lacp_main_t *lm = &lacp_main;
sif->actor.state |= LACP_STATE_SYNCHRONIZATION | LACP_STATE_COLLECTING |
LACP_STATE_DISTRIBUTING;
bond_enable_collecting_distributing (vm, sif);
sif->ntt = 1;
- lacp_start_periodic_timer (lm->vlib_main, sif, 0);
+ lacp_start_periodic_timer (vm, sif, 0);
if ((sif->selected == LACP_PORT_UNSELECTED) ||
(sif->selected == LACP_PORT_STANDBY) ||
!(sif->partner.state & LACP_STATE_SYNCHRONIZATION))