|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
24 lacp_pdu_t *lacpdu = (lacp_pdu_t *) mif->
last_rx_pkt;
27 return LACP_ERROR_UNSUPPORTED;
33 if ((lacpdu->actor.tlv_length != sizeof (lacp_actor_partner_t)) ||
34 (lacpdu->partner.tlv_length !=
sizeof (lacp_actor_partner_t)) ||
35 (lacpdu->collector.tlv_length !=
sizeof (lacp_collector_t)) ||
36 (lacpdu->terminator.tlv_length != 0))
37 return (LACP_ERROR_BAD_TLV);
40 LACP_RX_EVENT_PDU_RECEIVED, &mif->
rx_state);
48 marker->marker_info = pkt->marker_info;
49 marker->marker_info.tlv_type = MARKER_RESPONSE_INFORMATION;
55 marker->marker_info.tlv_type = MARKER_INFORMATION;
56 marker->marker_info.requester_port = mif->
actor.port_number;
58 marker->marker_info.requester_transaction_id = mif->
marker_tx_id;
67 ethernet_marker_pdu_t *h0;
122 if ((marker->marker_info.tlv_length != sizeof (marker_information_t)) ||
123 (marker->terminator.tlv_length != 0))
124 return (LACP_ERROR_BAD_TLV);
128 return LACP_ERROR_NONE;
141 marker_pdu_t *marker;
142 uword last_packet_signature;
147 if ((mif == 0) || (mif->
mode != BOND_MODE_LACP))
149 return LACP_ERROR_DISABLED;
163 if (nbytes <
sizeof (lacp_pdu_t))
166 return LACP_ERROR_TOO_SMALL;
195 if (nbytes <
sizeof (lacp_pdu_t))
198 return LACP_ERROR_TOO_SMALL;
201 last_packet_signature =
209 e = LACP_ERROR_CACHE_HIT;
245 .runs_after =
VLIB_INITS(
"lacp_periodic_init"),
269 if (t->
len >= sizeof (lacp_pdu_t))
271 switch (lacpdu->subtype)
275 s =
format (s,
" Markerv1\n");
277 s =
format (s,
" Subtype %u, Version %u\n", marker->subtype,
278 marker->version_number);
279 s =
format (s,
" Marker Information TLV: type %u\n",
280 marker->marker_info.tlv_type);
281 s =
format (s,
" Marker Information TLV: length %u\n",
282 marker->marker_info.tlv_length);
283 s =
format (s,
" Requester port: %u\n",
284 ntohs (marker->marker_info.requester_port));
286 marker->marker_info.requester_system);
287 s =
format (s,
" Requester transaction ID: %u\n",
288 ntohl (marker->marker_info.requester_transaction_id));
293 s =
format (s,
" LACPv1\n");
295 s =
format (s,
" Subtype %u, Version %u\n", lacpdu->subtype,
296 lacpdu->version_number);
297 s =
format (s,
" Actor Information TLV: length %u\n",
298 lacpdu->actor.tlv_length);
300 lacpdu->actor.port_info.system);
301 s =
format (s,
" System priority %u\n",
302 ntohs (lacpdu->actor.port_info.system_priority));
303 s =
format (s,
" Key %u\n",
ntohs (lacpdu->actor.port_info.key));
304 s =
format (s,
" Port priority %u\n",
305 ntohs (lacpdu->actor.port_info.port_priority));
306 s =
format (s,
" Port number %u\n",
307 ntohs (lacpdu->actor.port_info.port_number));
308 s =
format (s,
" State 0x%x\n", lacpdu->actor.port_info.state);
310 while (state_entry->
str)
312 if (lacpdu->actor.port_info.state & (1 << state_entry->
bit))
313 s =
format (s,
" %s (%d)\n", state_entry->
str,
318 s =
format (s,
" Partner Information TLV: length %u\n",
319 lacpdu->partner.tlv_length);
321 lacpdu->partner.port_info.system);
322 s =
format (s,
" System priority %u\n",
323 ntohs (lacpdu->partner.port_info.system_priority));
325 format (s,
" Key %u\n",
ntohs (lacpdu->partner.port_info.key));
327 format (s,
" Port priority %u\n",
328 ntohs (lacpdu->partner.port_info.port_priority));
330 format (s,
" Port number %u\n",
331 ntohs (lacpdu->partner.port_info.port_number));
332 s =
format (s,
" State 0x%x\n", lacpdu->partner.port_info.state);
334 while (state_entry->
str)
336 if (lacpdu->partner.port_info.state & (1 << state_entry->
bit))
337 s =
format (s,
" %s (%d)\n", state_entry->
str,
348 if (t->
len > sizeof (lacp_pdu_t))
349 len =
sizeof (lacp_pdu_t);
359 s =
format (s,
" 0x%04x: ",
i);
#define clib_memcpy(d, s, n)
static bond_if_t * bond_get_bond_if_by_dev_instance(u32 dev_instance)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define LACP_STEADY_STATE
u8 * format_ethernet_address(u8 *s, va_list *args)
vlib_main_t vlib_node_runtime_t * node
#define MARKER_PROTOCOL_VERSION
uword last_packet_signature
f64 last_marker_pdu_recd_time
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
__clib_export uword hash_memory(void *p, word n_bytes, uword state)
f64 last_lacpdu_recd_time
static void lacp_start_current_while_timer(vlib_main_t *vm, member_if_t *mif, u8 expiration)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
u8 last_packet_signature_valid
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)
lacp_machine_t lacp_rx_machine
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static uword vlib_buffer_contents(vlib_main_t *vm, u32 buffer_index, u8 *contents)
Copy buffer contents to memory.
vnet_main_t * vnet_get_main(void)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
#define LACP_ACTOR_LACP_VERSION
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
u16 current_length
Nbytes between current data and the end of this buffer.
int lacp_machine_dispatch(lacp_machine_t *machine, vlib_main_t *vm, member_if_t *mif, int event, int *state)
u64 marker_bad_pdu_received
void * vlib_packet_template_get_packet(vlib_main_t *vm, vlib_packet_template_t *t, u32 *bi_result)
format_function_t format_vnet_sw_if_index_name
description fragment has unexpected format
#define VLIB_INIT_FUNCTION(x)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static member_if_t * bond_get_member_by_sw_if_index(u32 sw_if_index)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
lacp_state_struct lacp_state_array[]
f64 last_marker_pdu_sent_time
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]
VLIB buffer representation.