summaryrefslogtreecommitdiffstats
path: root/src/plugins/lacp/selection.c
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2020-07-15 08:44:54 -0700
committerDave Barach <openvpp@barachs.net>2020-07-28 12:13:49 +0000
commit4c4223edfd46841062340fe449cd97a93dccc498 (patch)
tree8daedd7264e235e273a4e23d209a2baca80781d0 /src/plugins/lacp/selection.c
parent4d1423c5ace249f6609a41fadec9e4b9c4b323de (diff)
bonding lacp: replace slave string with member
- Replace textual string slave with member except APIs. - For APIs, mark the existing APIs as deprecated and introduce new APIs - While introducing sw_bond_interface_dump, add the optional filter by sw_if_index and enhance the testcases to make use of it. Type: improvement Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ib6626c514e45350308aeeda0decb70f3aba2f63e
Diffstat (limited to 'src/plugins/lacp/selection.c')
-rw-r--r--src/plugins/lacp/selection.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/plugins/lacp/selection.c b/src/plugins/lacp/selection.c
index 898b6a95023..f3fb6b9faa4 100644
--- a/src/plugins/lacp/selection.c
+++ b/src/plugins/lacp/selection.c
@@ -20,27 +20,27 @@
#include <lacp/node.h>
static void
-lacp_set_port_selected (vlib_main_t * vm, slave_if_t * sif)
+lacp_set_port_selected (vlib_main_t * vm, member_if_t * mif)
{
/* Handle loopback port */
- if (!memcmp (sif->partner.system, sif->actor.system, 6) &&
- (sif->partner.key == sif->actor.key))
+ if (!memcmp (mif->partner.system, mif->actor.system, 6) &&
+ (mif->partner.key == mif->actor.key))
{
- sif->loopback_port = 1;
- sif->actor.state &= ~LACP_STATE_AGGREGATION;
+ mif->loopback_port = 1;
+ mif->actor.state &= ~LACP_STATE_AGGREGATION;
}
- sif->selected = LACP_PORT_SELECTED;
+ mif->selected = LACP_PORT_SELECTED;
- switch (sif->mux_state)
+ switch (mif->mux_state)
{
case LACP_MUX_STATE_DETACHED:
break;
case LACP_MUX_STATE_WAITING:
- if (!sif->ready)
+ if (!mif->ready)
return;
break;
case LACP_MUX_STATE_ATTACHED:
- if (!(sif->partner.state & LACP_STATE_SYNCHRONIZATION))
+ if (!(mif->partner.state & LACP_STATE_SYNCHRONIZATION))
return;
break;
case LACP_MUX_STATE_COLLECTING_DISTRIBUTING:
@@ -48,39 +48,39 @@ lacp_set_port_selected (vlib_main_t * vm, slave_if_t * sif)
default:
break;
}
- lacp_machine_dispatch (&lacp_mux_machine, vm, sif, LACP_MUX_EVENT_SELECTED,
- &sif->mux_state);
+ lacp_machine_dispatch (&lacp_mux_machine, vm, mif, LACP_MUX_EVENT_SELECTED,
+ &mif->mux_state);
}
void
-lacp_selection_logic (vlib_main_t * vm, slave_if_t * sif)
+lacp_selection_logic (vlib_main_t * vm, member_if_t * mif)
{
- slave_if_t *sif2;
+ member_if_t *mif2;
bond_if_t *bif;
u32 *sw_if_index;
- bif = bond_get_master_by_dev_instance (sif->bif_dev_instance);
- vec_foreach (sw_if_index, bif->slaves)
+ bif = bond_get_bond_if_by_dev_instance (mif->bif_dev_instance);
+ vec_foreach (sw_if_index, bif->members)
{
- sif2 = bond_get_slave_by_sw_if_index (*sw_if_index);
- if (sif2 && (sif2->actor.state & LACP_STATE_SYNCHRONIZATION) &&
- (sif2->ready_n == 0))
+ mif2 = bond_get_member_by_sw_if_index (*sw_if_index);
+ if (mif2 && (mif2->actor.state & LACP_STATE_SYNCHRONIZATION) &&
+ (mif2->ready_n == 0))
goto out;
}
- vec_foreach (sw_if_index, bif->slaves)
+ vec_foreach (sw_if_index, bif->members)
{
- sif2 = bond_get_slave_by_sw_if_index (*sw_if_index);
- if (sif2)
+ mif2 = bond_get_member_by_sw_if_index (*sw_if_index);
+ if (mif2)
{
- sif2->ready = 1;
- if (sif2->selected == LACP_PORT_SELECTED)
- lacp_machine_dispatch (&lacp_mux_machine, vm, sif2,
- LACP_MUX_EVENT_READY, &sif2->mux_state);
+ mif2->ready = 1;
+ if (mif2->selected == LACP_PORT_SELECTED)
+ lacp_machine_dispatch (&lacp_mux_machine, vm, mif2,
+ LACP_MUX_EVENT_READY, &mif2->mux_state);
}
}
out:
- lacp_set_port_selected (vm, sif);
+ lacp_set_port_selected (vm, mif);
}
/*