aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lacp/lacp.c
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-06-05 10:52:35 -0700
committerDamjan Marion <dmarion@me.com>2019-06-07 11:21:28 +0000
commit4168c4d914c36f76c45cd8c6dde207b9f1c688e2 (patch)
treefc52a8e694168b67c1d7b8ff395addcac2266fb5 /src/plugins/lacp/lacp.c
parentf2922422d972644e67d1ca989e40cd0100ecb06d (diff)
lacp: create lacp-process on demand
Create lacp-process when the very first slave interface is added to the bond. Log an event message when lacp-process starts/stops. Be mindful when lacp-process is signalled to stop. Type: refactor Change-Id: I79e10e0a2a385a21a52ae5b8735f24631fdba293 Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src/plugins/lacp/lacp.c')
-rw-r--r--src/plugins/lacp/lacp.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/plugins/lacp/lacp.c b/src/plugins/lacp/lacp.c
index 1a588376d9a..4bb50aea32a 100644
--- a/src/plugins/lacp/lacp.c
+++ b/src/plugins/lacp/lacp.c
@@ -180,6 +180,7 @@ lacp_interface_enable_disable (vlib_main_t * vm, bond_if_t * bif,
if (enable)
{
+ lacp_create_periodic_process ();
port_number = clib_bitmap_first_clear (bif->port_number_bitmap);
bif->port_number_bitmap = clib_bitmap_set (bif->port_number_bitmap,
port_number, 1);
@@ -195,11 +196,23 @@ lacp_interface_enable_disable (vlib_main_t * vm, bond_if_t * bif,
}
else
{
- lm->lacp_int--;
+ ASSERT (lm->lacp_int >= 1);
if (lm->lacp_int == 0)
{
- vlib_process_signal_event (vm, lm->lacp_process_node_index,
- LACP_PROCESS_EVENT_STOP, 0);
+ /* *INDENT-OFF* */
+ ELOG_TYPE_DECLARE (e) =
+ {
+ .format = "lacp-int-en-dis: BUG lacp_int == 0",
+ };
+ /* *INDENT-ON* */
+ ELOG_DATA (&vlib_global_main.elog_main, e);
+ }
+ else
+ {
+ lm->lacp_int--;
+ if (lm->lacp_int == 0)
+ vlib_process_signal_event (vm, lm->lacp_process_node_index,
+ LACP_PROCESS_EVENT_STOP, 0);
}
}
}