X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Flacp%2Fptx_machine.h;h=9b4f2805ee4d18740785065bb5f9304d8762a83a;hb=6cfd414e4ce1705ad67923c00b48682a474941cb;hp=a9af4bb89d3a91230af8f3f03dd45f1ef607410d;hpb=9cd2d7a5a4fafadb65d772c48109d55d1e19d425;p=vpp.git diff --git a/src/plugins/lacp/ptx_machine.h b/src/plugins/lacp/ptx_machine.h index a9af4bb89d3..9b4f2805ee4 100644 --- a/src/plugins/lacp/ptx_machine.h +++ b/src/plugins/lacp/ptx_machine.h @@ -69,6 +69,23 @@ 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 partner is in short timeout or + // we are not yet synchronized + if ((sif->partner.state & LACP_STATE_LACP_TIMEOUT) || + (((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__ */ /*