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 sif->
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 (sif->
partner.state & LACP_STATE_SYNCHRONIZATION)
135 LACP_MUX_EVENT_UNSELECTED, &sif->
mux_state);
142 (sif->
partner.state & LACP_STATE_AGGREGATION) ||
154 sif->
actor.state |= LACP_STATE_DEFAULTED;
160 lacp_pdu_t *lacpdu = (lacp_pdu_t *) sif->
last_rx_pkt;
162 if ((lacpdu->actor.port_info.state & LACP_STATE_AGGREGATION) !=
163 (sif->
partner.state & LACP_STATE_AGGREGATION) ||
164 memcmp (&sif->
partner, &lacpdu->actor.port_info,
174 lacp_pdu_t *lacpdu = (lacp_pdu_t *) sif->
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 & sif->
actor.state)
180 || memcmp (&sif->
actor, &lacpdu->partner.port_info,
181 sizeof (sif->
actor) -
sizeof (sif->
actor.state)))
195 lacp_pdu_t *lacpdu = (lacp_pdu_t *) sif->
last_rx_pkt;
197 if ((!memcmp (&sif->
partner, &lacpdu->actor.port_info,
199 ((sif->
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 *) sif->
last_rx_pkt;
214 if (!(sif->
partner.state & LACP_STATE_LACP_ACTIVITY) &&
215 (lacpdu->actor.port_info.state & LACP_STATE_LACP_ACTIVITY))
218 sif->
partner = lacpdu->actor.port_info;
219 sif->
actor.state &= ~LACP_STATE_DEFAULTED;
220 if (match && (lacpdu->actor.port_info.state & LACP_STATE_SYNCHRONIZATION))
221 sif->
partner.state |= LACP_STATE_SYNCHRONIZATION;
223 sif->
partner.state &= ~LACP_STATE_SYNCHRONIZATION;
233 LACP_RX_EVENT_PORT_MOVED, &sif->
rx_state);
236 LACP_RX_EVENT_PORT_DISABLED, &sif->
rx_state);
247 sif->
actor.state &= ~LACP_STATE_EXPIRED;
251 LACP_RX_EVENT_BEGIN, &sif->
rx_state);
262 sif->
partner.state &= ~LACP_STATE_SYNCHRONIZATION;
266 LACP_RX_EVENT_PORT_MOVED, &sif->
rx_state);
272 LACP_RX_EVENT_LACP_ENABLED, &sif->
rx_state);
275 LACP_RX_EVENT_LACP_DISABLED, &sif->
rx_state);
288 sif->
partner.state &= ~LACP_STATE_SYNCHRONIZATION;
289 sif->
partner.state |= LACP_STATE_LACP_TIMEOUT;
297 sif->
actor.state |= LACP_STATE_EXPIRED;
300 LACP_RX_EVENT_TIMER_EXPIRED, &sif->
rx_state);
303 LACP_RX_EVENT_PDU_RECEIVED, &sif->
rx_state);
316 sif->
partner.state &= ~LACP_STATE_AGGREGATION;
317 sif->
actor.state &= ~LACP_STATE_EXPIRED;
331 sif->
actor.state &= ~LACP_STATE_EXPIRED;
334 LACP_RX_EVENT_PDU_RECEIVED, &sif->
rx_state);
344 lacp_pdu_t *lacpdu = (lacp_pdu_t *) sif->
last_rx_pkt;
349 if ((sif != sif2) && (sif2->
rx_state == LACP_RX_STATE_PORT_DISABLED) &&
351 lacpdu->partner.port_info.system, 6) &&
352 (sif2->
partner.port_number == lacpdu->partner.port_info.port_number))
371 sif->
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, &sif->
rx_state);
#define LACP_ACTION_LACP_DISABLED
static lacp_fsm_machine_t lacp_rx_fsm_table[]
vlib_main_t vlib_global_main
vnet_main_t * vnet_get_main(void)
static void lacp_update_default_selected(vlib_main_t *vm, slave_if_t *sif)
void lacp_init_rx_machine(vlib_main_t *vm, slave_if_t *sif)
static void lacp_record_pdu(vlib_main_t *vm, slave_if_t *sif)
format_function_t format_vnet_sw_if_index_name
static u8 * format_rx_event(u8 *s, va_list *args)
#define LACP_ACTION_EXPIRED
static u8 * format_rx_sm_state(u8 *s, va_list *args)
static u8 lacp_timer_is_running(f64 timer)
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
int lacp_rx_action_current(void *p1, void *p2)
int lacp_rx_action_expired(void *p1, void *p2)
static u8 lacp_timer_is_expired(vlib_main_t *vm, f64 timer)
static void lacp_set_port_moved(vlib_main_t *vm, slave_if_t *sif, u8 val)
vlib_worker_thread_t * vlib_worker_threads
static void lacp_stop_timer(f64 *timer)
#define LACP_ACTION_INITIALIZE
int lacp_rx_action_defaulted(void *p1, void *p2)
#define LACP_ACTION_CURRENT
void lacp_rx_debug_func(slave_if_t *sif, int event, int state, lacp_fsm_state_t *transition)
lacp_machine_t lacp_mux_machine
int lacp_rx_action_initialize(void *p1, void *p2)
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_update_selected(vlib_main_t *vm, slave_if_t *sif)
static u8 lacp_compare_partner(slave_if_t *sif)
void lacp_selection_logic(vlib_main_t *vm, slave_if_t *sif)
u32 elog_string(elog_main_t *em, char *fmt,...)
add a string to the event-log string table
#define LACP_ACTION_DEFAULTED
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void lacp_update_ntt(vlib_main_t *vm, slave_if_t *sif)
lacp_port_info_t partner_admin
static_always_inline uword os_get_thread_index(void)
static void lacp_start_periodic_timer(vlib_main_t *vm, slave_if_t *sif, u8 expiration)
int lacp_rx_action_port_disabled(void *p1, void *p2)
static void lacp_start_current_while_timer(vlib_main_t *vm, slave_if_t *sif, u8 expiration)
vl_api_dhcp_client_state_t state
static void lacp_set_port_unselected(vlib_main_t *vm, slave_if_t *sif)
static void lacp_record_default(slave_if_t *sif)
static void lacp_ptx_post_short_timeout_event(vlib_main_t *vm, slave_if_t *sif)
static int lacp_port_is_moved(vlib_main_t *vm, slave_if_t *sif)
int lacp_machine_dispatch(lacp_machine_t *machine, vlib_main_t *vm, slave_if_t *sif, int event, int *state)