summaryrefslogtreecommitdiffstats
path: root/src/plugins/lacp/ptx_machine.h
diff options
context:
space:
mode:
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__ */
/*