|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
67 s =
format (s,
"l2-input: sw_if_index %d dst %U src %U [%U]",
77 #ifndef CLIB_MARCH_VARIANT
81 #define foreach_l2input_error \
82 _(L2INPUT, "L2 input packets") \
83 _(DROP, "L2 input drops")
87 #define _(sym,str) L2INPUT_ERROR_##sym,
94 #define _(sym,string) string,
139 #define get_u16(addr) ( *((u16 *)(addr)) )
140 u16 ethertype = clib_net_to_host_u16 (
get_u16 (l3h0 - 2));
144 feat_mask &= ~(L2INPUT_FEAT_FWD |
145 L2INPUT_FEAT_UU_FLOOD |
146 L2INPUT_FEAT_UU_FWD | L2INPUT_FEAT_GBP_FWD);
148 if (ethertype != ETHERNET_TYPE_ARP)
149 feat_mask &= ~(L2INPUT_FEAT_ARP_UFWD);
152 if (ethertype != ETHERNET_TYPE_ARP &&
153 (ethertype != ETHERNET_TYPE_IP6 ||
protocol != IP_PROTOCOL_ICMP6))
154 feat_mask &= ~(L2INPUT_FEAT_ARP_TERM);
163 if (ethertype == ETHERNET_TYPE_ARP)
167 clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_request))
173 icmp6_neighbor_solicitation_or_advertisement_header_t *ndh0;
175 if (ndh0->icmp.type == ICMP6_neighbor_solicitation)
219 feat_mask = L2INPUT_FEAT_DROP;
225 vnet_buffer (b0)->l2.feature_bitmap = feature_bitmap;
251 u32 sw_if_index0, sw_if_index1, sw_if_index2, sw_if_index3;
280 if (
b[0]->
flags & VLIB_BUFFER_IS_TRACED)
291 if (
b[1]->
flags & VLIB_BUFFER_IS_TRACED)
302 if (
b[2]->
flags & VLIB_BUFFER_IS_TRACED)
313 if (
b[3]->
flags & VLIB_BUFFER_IS_TRACED)
354 L2INPUT_ERROR_L2INPUT,
frame->n_vectors);
358 return frame->n_vectors;
372 .vector_size =
sizeof (
u32),
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
u8 * format_ethernet_address(u8 *s, va_list *args)
vlib_get_buffers(vm, from, b, n_left_from)
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vlib_buffer_enqueue_to_next(vm, node, from,(u16 *) nexts, frame->n_vectors)
static void * ip6_next_header(ip6_header_t *i)
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
#define VLIB_NODE_FN(node)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define VLIB_NODE_FLAG_TRACE
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define static_always_inline
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
struct _vlib_node_registration vlib_node_registration_t
u32 feat_next_node_index[32]
description fragment has unexpected format
static uword ethernet_address_cast(const u8 *a)
static_always_inline l2fib_seq_num_t l2_fib_mk_seq_num(u8 bd_sn, u8 if_sn)
u8 * format_ethernet_header_with_length(u8 *s, va_list *args)
vl_api_ip_proto_t protocol
static u32 feat_bitmap_get_next_node_index(u32 *next_nodes, u32 bitmap)
Return the graph node index for the feature corresponding to the first set bit in the bitmap.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
u16 nexts[VLIB_FRAME_SIZE]
static_always_inline void clib_prefetch_store(void *p)
l2_input_config_t * configs
vl_api_interface_index_t sw_if_index
vl_api_fib_path_type_t type
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
vl_api_wireguard_peer_flags_t flags