From 82c5dda455ce56ffaf8813b7fbee661e6dbb7cea Mon Sep 17 00:00:00 2001 From: Steven Luong Date: Tue, 5 Mar 2019 09:38:33 -0800 Subject: lacp: passive mode support [VPP-1551] By definition, passive mode means the node does not start sending lacp pdu until it first hears from the partner or remote. - Rename ptx machine's BEGIN state to NO_PERIODIC state. - Put periodic machine in NO_PERIDOIC state when the interface is enabled for lacp. ptx machine will transition out of NO_PERIODIC state when the local node hears from the remote or when the local node is configured for active mode. - Also add send and receive statistics for debugging. Change-Id: I747953b9595ed31328b2f4f3e7a8d15d01e04d7f Signed-off-by: Steven Luong --- src/plugins/lacp/ptx_machine.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/plugins/lacp/ptx_machine.h') diff --git a/src/plugins/lacp/ptx_machine.h b/src/plugins/lacp/ptx_machine.h index 9b4f2805ee4..4b4f4134254 100644 --- a/src/plugins/lacp/ptx_machine.h +++ b/src/plugins/lacp/ptx_machine.h @@ -20,7 +20,7 @@ #include #define foreach_lacp_ptx_event \ - _(0, BEGIN, "begin") \ + _(0, NO_PERIODIC, "no periodic") \ _(1, LONG_TIMEOUT, "long tiemout") \ _(2, TIMER_EXPIRED, "timer expired") \ _(3, SHORT_TIMEOUT, "short timeout") @@ -86,6 +86,16 @@ lacp_schedule_periodic_timer (vlib_main_t * vm, slave_if_t * sif) lacp_start_periodic_timer (vm, sif, LACP_SLOW_PERIODIC_TIMER); } +static inline void +lacp_ptx_post_short_timeout_event (vlib_main_t * vm, slave_if_t * sif) +{ + if (sif->lacp_enabled && sif->port_enabled && + ((sif->partner.state & LACP_STATE_LACP_ACTIVITY) || + (sif->actor.state & LACP_STATE_LACP_ACTIVITY))) + lacp_machine_dispatch (&lacp_ptx_machine, vm, sif, + LACP_PTX_EVENT_SHORT_TIMEOUT, &sif->ptx_state); +} + #endif /* __LACP_PTX_MACHINE_H__ */ /* -- cgit 1.2.3-korg