summaryrefslogtreecommitdiffstats
path: root/src/plugins/lacp/ptx_machine.h
diff options
context:
space:
mode:
authorSteven <sluong@cisco.com>2018-03-29 10:35:41 -0700
committerDamjan Marion <dmarion.lists@gmail.com>2018-03-30 20:44:56 +0000
commitdd4889e21cb15df541cf3b2c2d8bb971ce460359 (patch)
tree8725f6c47f27e754e9712816c7b15e4db596c421 /src/plugins/lacp/ptx_machine.h
parent70488ab7f87096534aaadd7eab30e8515ac3d60d (diff)
lacp: faster convergence for slow-rate config option
Do fast-rate if we are not yet synchronized with the partner. Stop sending LACP updates as a flash in the worker thread. Just expire the timer and let the lacp_process handle sending LACP PDU. Change-Id: I8b36fe74e752e7f45bd4a8d70512c0341cc197a1 Signed-off-by: Steven <sluong@cisco.com>
Diffstat (limited to 'src/plugins/lacp/ptx_machine.h')
-rw-r--r--src/plugins/lacp/ptx_machine.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/lacp/ptx_machine.h b/src/plugins/lacp/ptx_machine.h
index a9af4bb89d3..6183b633ae1 100644
--- a/src/plugins/lacp/ptx_machine.h
+++ b/src/plugins/lacp/ptx_machine.h
@@ -69,6 +69,21 @@ lacp_start_periodic_timer (vlib_main_t * vm, slave_if_t * sif, u8 expiration)
sif->periodic_timer = vlib_time_now (vm) + expiration;
}
+static inline void
+lacp_schedule_periodic_timer (vlib_main_t * vm, slave_if_t * sif)
+{
+ // do fast rate if we are not yet synchronized
+ if (((sif->actor.state & (LACP_STATE_SYNCHRONIZATION |
+ LACP_STATE_COLLECTING |
+ LACP_STATE_DISTRIBUTING)) !=
+ (LACP_STATE_SYNCHRONIZATION | LACP_STATE_COLLECTING |
+ LACP_STATE_DISTRIBUTING))
+ && (sif->partner.state & LACP_STATE_AGGREGATION))
+ lacp_start_periodic_timer (vm, sif, LACP_FAST_PERIODIC_TIMER);
+ else
+ lacp_start_periodic_timer (vm, sif, LACP_SLOW_PERIODIC_TIMER);
+}
+
#endif /* __LACP_PTX_MACHINE_H__ */
/*