summaryrefslogtreecommitdiffstats
path: root/src/plugins/lacp/ptx_machine.h
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-03-05 09:38:33 -0800
committerDamjan Marion <dmarion@me.com>2019-04-03 16:32:37 +0000
commit82c5dda455ce56ffaf8813b7fbee661e6dbb7cea (patch)
tree0a4b607e46396ac28fe7f573b6b237de4ed8c16d /src/plugins/lacp/ptx_machine.h
parent5ae793ac4e5b3fa288ed5838d8d92ce15eb950bd (diff)
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 <sluong@cisco.com>
Diffstat (limited to 'src/plugins/lacp/ptx_machine.h')
-rw-r--r--src/plugins/lacp/ptx_machine.h12
1 files changed, 11 insertions, 1 deletions
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 <lacp/machine.h>
#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__ */
/*