100 {lacp_rx_state_initialize},
101 {lacp_rx_state_port_disabled},
102 {lacp_rx_state_expired},
103 {lacp_rx_state_lacp_disabled},
104 {lacp_rx_state_defaulted},
105 {lacp_rx_state_current},
116 mif->
selected = LACP_PORT_UNSELECTED;
120 case LACP_MUX_STATE_DETACHED:
122 case LACP_MUX_STATE_WAITING:
124 case LACP_MUX_STATE_ATTACHED:
127 case LACP_MUX_STATE_COLLECTING_DISTRIBUTING:
128 if (mif->
partner.state & LACP_STATE_SYNCHRONIZATION)
135 LACP_MUX_EVENT_UNSELECTED, &mif->
mux_state);
142 (mif->
partner.state & LACP_STATE_AGGREGATION) ||
154 mif->
actor.state |= LACP_STATE_DEFAULTED;
160 lacp_pdu_t *lacpdu = (lacp_pdu_t *) mif->
last_rx_pkt;
162 if ((lacpdu->actor.port_info.state & LACP_STATE_AGGREGATION) !=
163 (mif->
partner.state & LACP_STATE_AGGREGATION) ||
164 memcmp (&mif->
partner, &lacpdu->actor.port_info,
174 lacp_pdu_t *lacpdu = (lacp_pdu_t *) mif->
last_rx_pkt;
175 u8 states = LACP_STATE_LACP_ACTIVITY | LACP_STATE_LACP_TIMEOUT |
176 LACP_STATE_SYNCHRONIZATION | LACP_STATE_AGGREGATION;
178 if ((states & lacpdu->partner.port_info.state) !=
179 (states & mif->
actor.state)
180 || memcmp (&mif->
actor, &lacpdu->partner.port_info,
181 sizeof (mif->
actor) -
sizeof (mif->
actor.state)))
195 lacp_pdu_t *lacpdu = (lacp_pdu_t *) mif->
last_rx_pkt;
197 if ((!memcmp (&mif->
partner, &lacpdu->actor.port_info,
199 ((mif->
actor.state & LACP_STATE_AGGREGATION) ==
200 (lacpdu->partner.port_info.state & LACP_STATE_AGGREGATION))) ||
201 ((lacpdu->actor.port_info.state & LACP_STATE_AGGREGATION) == 0))
210 lacp_pdu_t *lacpdu = (lacp_pdu_t *) mif->
last_rx_pkt;
214 if (!(mif->
partner.state & LACP_STATE_LACP_ACTIVITY) &&
215 (lacpdu->actor.port_info.state & LACP_STATE_LACP_ACTIVITY))
218 mif->
partner = lacpdu->actor.port_info;
219 mif->
actor.state &= ~LACP_STATE_DEFAULTED;
220 if (match && (lacpdu->actor.port_info.state & LACP_STATE_SYNCHRONIZATION))
221 mif->
partner.state |= LACP_STATE_SYNCHRONIZATION;
223 mif->
partner.state &= ~LACP_STATE_SYNCHRONIZATION;
233 LACP_RX_EVENT_PORT_MOVED, &mif->
rx_state);
236 LACP_RX_EVENT_PORT_DISABLED, &mif->
rx_state);
247 mif->
actor.state &= ~LACP_STATE_EXPIRED;
251 LACP_RX_EVENT_BEGIN, &mif->
rx_state);
262 mif->
partner.state &= ~LACP_STATE_SYNCHRONIZATION;
266 LACP_RX_EVENT_PORT_MOVED, &mif->
rx_state);
272 LACP_RX_EVENT_LACP_ENABLED, &mif->
rx_state);
275 LACP_RX_EVENT_LACP_DISABLED, &mif->
rx_state);
288 mif->
partner.state &= ~LACP_STATE_SYNCHRONIZATION;
289 mif->
partner.state |= LACP_STATE_LACP_TIMEOUT;
297 mif->
actor.state |= LACP_STATE_EXPIRED;
300 LACP_RX_EVENT_TIMER_EXPIRED, &mif->
rx_state);
303 LACP_RX_EVENT_PDU_RECEIVED, &mif->
rx_state);
316 mif->
partner.state &= ~LACP_STATE_AGGREGATION;
317 mif->
actor.state &= ~LACP_STATE_EXPIRED;
331 mif->
actor.state &= ~LACP_STATE_EXPIRED;
334 LACP_RX_EVENT_PDU_RECEIVED, &mif->
rx_state);
344 lacp_pdu_t *lacpdu = (lacp_pdu_t *) mif->
last_rx_pkt;
349 if ((mif != mif2) && (mif2->
rx_state == LACP_RX_STATE_PORT_DISABLED) &&
351 lacpdu->partner.port_info.system, 6) &&
352 (mif2->
partner.port_number == lacpdu->partner.port_info.port_number))
371 mif->
actor.state &= ~LACP_STATE_EXPIRED;
383 #define _(b, s, n) {.bit = b, .str = #s, }, 388 int e = va_arg (*args,
int);
391 if (e >= (
sizeof (lacp_rx_event_array) /
sizeof (*event_entry)))
392 s =
format (s,
"Bad event %d", e);
394 s =
format (s,
"%s", event_entry[e].str);
430 LACP_RX_EVENT_LACP_ENABLED, &mif->
rx_state);
#define LACP_ACTION_LACP_DISABLED
static lacp_fsm_machine_t lacp_rx_fsm_table[]
vlib_main_t vlib_global_main
void lacp_init_rx_machine(vlib_main_t *vm, member_if_t *mif)
vnet_main_t * vnet_get_main(void)
#define pool_foreach(VAR, POOL)
Iterate through pool.
static void lacp_set_port_moved(vlib_main_t *vm, member_if_t *mif, u8 val)
static void lacp_update_selected(vlib_main_t *vm, member_if_t *mif)
static u8 lacp_compare_partner(member_if_t *mif)
lacp_port_info_t partner_admin
format_function_t format_vnet_sw_if_index_name
static u8 * format_rx_event(u8 *s, va_list *args)
#define LACP_ACTION_EXPIRED
static void lacp_ptx_post_short_timeout_event(vlib_main_t *vm, member_if_t *mif)
static u8 * format_rx_sm_state(u8 *s, va_list *args)
static u8 lacp_timer_is_running(f64 timer)
int lacp_rx_action_current(void *p1, void *p2)
description fragment has unexpected format
int lacp_rx_action_expired(void *p1, void *p2)
static u8 lacp_timer_is_expired(vlib_main_t *vm, f64 timer)
vlib_worker_thread_t * vlib_worker_threads
static void lacp_stop_timer(f64 *timer)
#define LACP_ACTION_INITIALIZE
static void lacp_update_ntt(vlib_main_t *vm, member_if_t *mif)
static void lacp_start_periodic_timer(vlib_main_t *vm, member_if_t *mif, u8 expiration)
static void lacp_record_default(member_if_t *mif)
int lacp_rx_action_defaulted(void *p1, void *p2)
void lacp_rx_debug_func(member_if_t *mif, int event, int state, lacp_fsm_state_t *transition)
#define LACP_ACTION_CURRENT
lacp_machine_t lacp_mux_machine
int lacp_rx_action_initialize(void *p1, void *p2)
static void lacp_start_current_while_timer(vlib_main_t *vm, member_if_t *mif, u8 expiration)
int lacp_rx_action_lacp_disabled(void *p1, void *p2)
#define ELOG_TYPE_DECLARE(f)
#define LACP_ACTION_PORT_DISABLED
#define ELOG_TRACK_DATA(em, f, track)
static void lacp_set_port_unselected(vlib_main_t *vm, member_if_t *mif)
static int lacp_port_is_moved(vlib_main_t *vm, member_if_t *mif)
#define LACP_ACTION_DEFAULTED
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static_always_inline uword os_get_thread_index(void)
__clib_export u32 elog_string(elog_main_t *em, char *fmt,...)
add a string to the event-log string table
int lacp_rx_action_port_disabled(void *p1, void *p2)
int lacp_machine_dispatch(lacp_machine_t *machine, vlib_main_t *vm, member_if_t *mif, int event, int *state)
void lacp_selection_logic(vlib_main_t *vm, member_if_t *mif)
vl_api_dhcp_client_state_t state
static void lacp_update_default_selected(vlib_main_t *vm, member_if_t *mif)
static void lacp_record_pdu(vlib_main_t *vm, member_if_t *mif)