|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
20 #include <vpp/app/version.h>
35 lacpdu->actor.port_info = mif->
actor;
38 lacpdu->partner.port_info = mif->
partner;
49 ethernet_lacp_pdu_t *h0;
143 u8 actor_state, partner_state;
151 actor_state = mif->
actor.state;
152 partner_state = mif->
partner.state;
157 LACP_RX_EVENT_TIMER_EXPIRED, &mif->
rx_state);
164 LACP_PTX_EVENT_TIMER_EXPIRED, &mif->
ptx_state);
173 if (actor_state != mif->
actor.state)
180 if (partner_state != mif->
partner.state)
222 .format =
"lacp-int-en-dis: BUG lacp_int == 0",
241 ethernet_lacp_pdu_t
h;
242 ethernet_marker_pdu_t m;
243 u8 dst[] = { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x02 };
252 memcpy (
h.ethernet.dst_address,
dst, sizeof (
h.ethernet.dst_address));
256 h.ethernet.type = htons (ETHERNET_TYPE_SLOW_PROTOCOLS);
262 h.lacp.actor.tlv_type = LACP_ACTOR_INFORMATION;
263 h.lacp.actor.tlv_length =
sizeof (lacp_actor_partner_t);
266 h.lacp.partner.tlv_type = LACP_PARTNER_INFORMATION;
267 h.lacp.partner.tlv_length =
sizeof (lacp_actor_partner_t);
270 h.lacp.collector.tlv_type = LACP_COLLECTOR_INFORMATION;
271 h.lacp.collector.tlv_length =
sizeof (lacp_collector_t);
272 h.lacp.collector.max_delay = 0;
275 h.lacp.terminator.tlv_type = LACP_TERMINATOR_INFORMATION;
276 h.lacp.terminator.tlv_length = 0;
289 memcpy (m.ethernet.dst_address,
dst, sizeof (m.ethernet.dst_address));
293 m.ethernet.type = htons (ETHERNET_TYPE_SLOW_PROTOCOLS);
298 m.marker.marker_info.tlv_length =
sizeof (marker_information_t);
301 m.marker.terminator.tlv_type = MARKER_TERMINATOR_INFORMATION;
302 m.marker.terminator.tlv_length = 0;
327 rc = (*transition->
action) ((
void *)
vm, (
void *) mif);
351 mif->
selected = LACP_PORT_UNSELECTED;
352 mif->
actor.state = LACP_STATE_AGGREGATION;
354 mif->
actor.state |= LACP_STATE_LACP_TIMEOUT;
356 mif->
actor.state |= LACP_STATE_LACP_ACTIVITY;
359 mif->
actor.key = htons (group);
360 mif->
actor.port_number = htons (port_number);
364 mif->
partner.key = htons (group);
365 mif->
partner.port_number = htons (port_number);
458 .version = VPP_BUILD_VER,
459 .description =
"Link Aggregation Control Protocol (LACP)",
void lacp_init_mux_machine(vlib_main_t *vm, member_if_t *mif)
static u8 lacp_timer_is_expired(vlib_main_t *vm, f64 timer)
static uword vnet_sw_interface_is_link_up(vnet_main_t *vnm, u32 sw_if_index)
clib_error_t * lacp_plugin_api_hookup(vlib_main_t *vm)
f64 last_lacpdu_sent_time
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(lacp_sw_interface_up_down)
#define clib_memcpy(d, s, n)
static bond_if_t * bond_get_bond_if_by_dev_instance(u32 dev_instance)
static u8 lacp_timer_is_running(f64 timer)
static int lacp_pick_packet_template(member_if_t *mif)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
void lacp_create_periodic_process(void)
lacp_fsm_machine_t * tables
void lacp_init_ptx_machine(vlib_main_t *vm, member_if_t *mif)
@ LACP_PACKET_TEMPLATE_ETHERNET
#define LACP_DEFAULT_SYSTEM_PRIORITY
#define MARKER_PROTOCOL_VERSION
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
@ LACP_PROCESS_EVENT_STOP
f64 last_marker_pdu_recd_time
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static clib_error_t * lacp_periodic_init(vlib_main_t *vm)
@ VNET_HW_INTERFACE_FLAG_LINK_UP
vl_api_dhcp_client_state_t state
@ LACP_PROCESS_EVENT_START
static void bond_register_callback(lacp_enable_disable_func func)
f64 last_lacpdu_recd_time
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
static void vlib_process_signal_event(vlib_main_t *vm, uword node_index, uword type_opaque, uword data)
static uword clib_bitmap_first_clear(uword *ai)
Return the lowest numbered clear bit in a bitmap.
#define LACP_DBG2(n, e, s, m, t)
static void lacp_interface_enable_disable(vlib_main_t *vm, bond_if_t *bif, member_if_t *mif, u8 enable)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
#define pool_foreach(VAR, POOL)
Iterate through pool.
lacp_machine_t lacp_rx_machine
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define ELOG_TYPE_DECLARE(f)
int lacp_selection_logic(vlib_main_t *vm, member_if_t *mif)
uword * port_number_bitmap
void lacp_init_state_machines(vlib_main_t *vm, member_if_t *mif)
#define LACP_SHORT_TIMOUT_TIME
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vlib_global_main_t vlib_global_main
#define LACP_ACTOR_LACP_VERSION
lacp_port_info_t actor_admin
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap.
static clib_error_t * lacp_hw_interface_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
void lacp_init_neighbor(member_if_t *mif, u8 *hw_address, u16 port_number, u32 group)
u16 current_length
Nbytes between current data and the end of this buffer.
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
static void lacp_fill_pdu(lacp_pdu_t *lacpdu, member_if_t *mif)
lacp_machine_t lacp_ptx_machine
int lacp_machine_dispatch(lacp_machine_t *machine, vlib_main_t *vm, member_if_t *mif, int event, int *state)
void * vlib_packet_template_get_packet(vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
vlib_packet_template_t packet_templates[LACP_N_PACKET_TEMPLATES]
static void lacp_stop_timer(f64 *timer)
lacp_fsm_state_t * state_table
static vnet_sw_interface_t * vnet_get_hw_sw_interface(vnet_main_t *vnm, u32 hw_if_index)
#define VLIB_INIT_FUNCTION(x)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static clib_error_t * lacp_sw_interface_up_down(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
void lacp_init_tx_machine(vlib_main_t *vm, member_if_t *mif)
static member_if_t * bond_get_member_by_sw_if_index(u32 sw_if_index)
void lacp_periodic(vlib_main_t *vm)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void lacp_send_ethernet_lacp_pdu(vlib_main_t *vm, member_if_t *mif)
void lacp_send_lacp_pdu(vlib_main_t *vm, member_if_t *mif)
lacp_port_info_t partner_admin
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
@ MARKER_PACKET_TEMPLATE_ETHERNET
#define LACP_DEFAULT_PORT_PRIORITY
f64 last_marker_pdu_sent_time
void vlib_packet_template_init(vlib_main_t *vm, vlib_packet_template_t *t, void *packet_data, uword n_packet_data_bytes, uword min_n_buffers_each_alloc, char *fmt,...)
static f64 vlib_time_now(vlib_main_t *vm)
void stat_segment_set_state_counter(u32 index, u64 value)
u32 total_length_not_including_first_buffer
Only valid for first buffer in chain.
vl_api_interface_index_t sw_if_index
vlib_packet_template_t marker_packet_templates[MARKER_N_PACKET_TEMPLATES]
u32 lacp_process_node_index
void lacp_init_rx_machine(vlib_main_t *vm, member_if_t *mif)
VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION(lacp_hw_interface_up_down)
VLIB buffer representation.
vl_api_wireguard_peer_flags_t flags