|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
61 "%s: head %d feature_bitmap %x ethertype %x sw_if_index %d, next_index %d",
62 is_output ?
"OUT-FEAT-ARC" :
"IN-FEAT-ARC", t->
arc_head,
84 #define foreach_l2_in_feat_arc_error \
85 _(DEFAULT, "in default") \
88 #define foreach_l2_out_feat_arc_error \
89 _(DEFAULT, "out default") \
94 #define _(sym,str) L2_IN_FEAT_ARC_ERROR_##sym,
101 #define _(sym,string) string,
108 #define _(sym,str) L2_OUT_FEAT_ARC_ERROR_##sym,
115 #define _(sym,string) string,
122 #ifndef CLIB_MARCH_VARIANT
126 #define get_u16(addr) ( *((u16 *)(addr)) )
127 #define L2_FEAT_ARC_VEC_SIZE 2
133 for (ii = 0; ii < vector_sz; ii++)
139 u32 * out_sw_if_index)
142 for (ii = 0; ii < vector_sz; ii++)
154 for (ii = 0; ii < vector_sz; ii++)
158 out_ethertype[ii] = clib_net_to_host_u16 (
get_u16 (l3h0 - 2));
166 u16 * ethertype,
u8 ip4_arc,
u8 ip6_arc,
167 u8 nonip_arc,
u16 * out_next)
170 for (ii = 0; ii < vector_sz; ii++)
174 switch (ethertype[ii])
176 case ETHERNET_TYPE_IP4:
177 feature_arc = ip4_arc;
179 case ETHERNET_TYPE_IP6:
180 feature_arc = ip6_arc;
183 feature_arc = nonip_arc;
191 is_output ? L2OUTPUT_FEAT_OUTPUT_FEAT_ARC :
192 L2INPUT_FEAT_INPUT_FEAT_ARC);
203 for (ii = 0; ii < vector_sz; ii++)
207 is_output ? L2OUTPUT_FEAT_OUTPUT_FEAT_ARC :
208 L2INPUT_FEAT_INPUT_FEAT_ARC);
220 for (ii = 0; ii < vector_sz; ii++)
228 t->
ethertype = arc_head ? ethertype[ii] : 0;
237 int arc_head,
int do_trace)
256 ethertype = ethertypes;
274 ip6_arc_index, nonip_arc_index,
next);
295 const int vec_sz = 1;
303 ip6_arc_index, nonip_arc_index,
next);
324 return frame->n_vectors;
384 #ifndef CLIB_MARCH_VARIANT
391 (
u32) enable_disable);
394 (
u32) enable_disable);
401 .arc_name =
"l2-input-ip4",
408 .arc_name =
"l2-output-ip4",
415 .arc_name =
"l2-input-ip6",
421 .arc_name =
"l2-output-ip6",
428 .arc_name =
"l2-input-nonip",
434 .arc_name =
"l2-output-nonip",
445 .name =
"l2-input-feat-arc",
446 .vector_size =
sizeof (
u32),
456 .name =
"l2-output-feat-arc",
457 .vector_size =
sizeof (
u32),
467 .name =
"l2-input-feat-arc-end",
468 .vector_size =
sizeof (
u32),
470 .sibling_of =
"l2-input-feat-arc",
474 .name =
"l2-output-feat-arc-end",
475 .vector_size =
sizeof (
u32),
477 .sibling_of =
"l2-output-feat-arc",
482 .arc_name =
"l2-input-ip4",
483 .node_name =
"l2-input-feat-arc-end",
489 .arc_name =
"l2-output-ip4",
490 .node_name =
"l2-output-feat-arc-end",
496 .arc_name =
"l2-input-ip6",
497 .node_name =
"l2-input-feat-arc-end",
504 .arc_name =
"l2-output-ip6",
505 .node_name =
"l2-output-feat-arc-end",
511 .arc_name =
"l2-input-nonip",
512 .node_name =
"l2-input-feat-arc-end",
519 .arc_name =
"l2-output-nonip",
520 .node_name =
"l2-output-feat-arc-end",
526 #ifndef CLIB_MARCH_VARIANT
550 int has_features = 0;
558 return has_features > 0;
584 void *feature_config,
585 u32 n_feature_config_bytes)
589 return VNET_API_ERROR_INVALID_VALUE;
595 enable_disable, feature_config,
596 n_feature_config_bytes);
602 if (had_features != has_features)
@ IN_OUT_FEAT_ARC_N_TABLE_GROUPS
static u8 * format_l2_out_feat_arc_trace(u8 *s, va_list *args)
l2_in_out_feat_arc_main_t l2_in_out_feat_arc_main
static_always_inline int vnet_have_features(u8 arc, u32 sw_if_index)
static char * l2_in_feat_arc_error_strings[]
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static int l2_is_input_arc(u8 arc_index)
vlib_node_registration_t l2_in_feat_arc_end_node
(constructor) VLIB_REGISTER_NODE (l2_in_feat_arc_end_node)
nat44_ei_hairpin_src_next_t next_index
u8 ip4_feat_arc_index[IN_OUT_FEAT_ARC_N_TABLE_GROUPS]
vlib_node_registration_t l2_out_feat_arc_end_node
(constructor) VLIB_REGISTER_NODE (l2_out_feat_arc_end_node)
void vnet_l2_in_out_feat_arc_enable_disable(u32 sw_if_index, int is_output, int enable_disable)
vlib_get_buffers(vm, from, b, n_left_from)
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
static u8 * format_l2_in_feat_arc_trace(u8 *s, va_list *args)
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_always_inline void maybe_trace_xN(int vector_sz, int arc_head, vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t **b, u32 *sw_if_index, u16 *ethertype, u16 *next)
@ L2_OUT_FEAT_ARC_N_ERROR
static_always_inline void set_next_in_arc_tail_xN(int vector_sz, int is_output, u32 *next_nodes, vlib_buffer_t **b, u16 *out_next)
static uword l2_in_out_feat_arc_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_output, vlib_node_registration_t *fa_node, int arc_head, int do_trace)
#define CLIB_PREFETCH(addr, size, type)
u8 ip6_feat_arc_index[IN_OUT_FEAT_ARC_N_TABLE_GROUPS]
static_always_inline void buffer_prefetch_xN(int vector_sz, vlib_buffer_t **b)
#define VLIB_NODE_FN(node)
int vnet_l2_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
char ** l2output_get_feat_names(void)
#define VLIB_NODE_FLAG_TRACE
#define foreach_l2_out_feat_arc_error
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define foreach_l2_in_feat_arc_error
VNET_FEATURE_INIT(l2_in_ip4_arc_end, static)
#define static_always_inline
static_always_inline void get_ethertype_xN(int vector_sz, int is_output, vlib_buffer_t **b, u16 *out_ethertype)
#define L2_FEAT_ARC_VEC_SIZE
@ IN_OUT_FEAT_ARC_OUTPUT_TABLE_GROUP
#define CLIB_CACHE_LINE_BYTES
@ IN_OUT_FEAT_ARC_INPUT_TABLE_GROUP
static_always_inline void set_next_in_arc_head_xN(int vector_sz, int is_output, u32 *next_nodes, vlib_buffer_t **b, u32 *sw_if_index, u16 *ethertype, u8 ip4_arc, u8 ip6_arc, u8 nonip_arc, u16 *out_next)
vlib_node_registration_t l2_in_feat_arc_node
(constructor) VLIB_REGISTER_NODE (l2_in_feat_arc_node)
struct _vlib_node_registration vlib_node_registration_t
static u32 vnet_l2_feature_next(vlib_buffer_t *b, u32 *next_nodes, u32 feat_bit)
Return the graph node index for the feature corresponding to the next set bit after clearing the curr...
u8 nonip_feat_arc_index[IN_OUT_FEAT_ARC_N_TABLE_GROUPS]
void l2output_intf_bitmap_enable(u32 sw_if_index, l2output_feat_masks_t feature_bitmap, u32 enable)
Enable (or disable) the feature in the bitmap for the given interface.
description fragment has unexpected format
#define VLIB_INIT_FUNCTION(x)
clib_error_t * l2_in_out_feat_arc_init(vlib_main_t *vm)
u32 feat_next_node_index[IN_OUT_FEAT_ARC_N_TABLE_GROUPS][32]
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
static char * l2_out_feat_arc_error_strings[]
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define VNET_FEATURES(...)
static u8 * format_l2_in_out_feat_arc_trace(u8 *s, u32 is_output, va_list *args)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
static int l2_is_output_arc(u8 arc_index)
static_always_inline void vnet_feature_arc_start(u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
VNET_FEATURE_ARC_INIT(l2_in_ip4_arc, static)
u16 nexts[VLIB_FRAME_SIZE]
u8 vnet_get_feature_arc_index(const char *s)
static int l2_has_features(u32 sw_if_index, int is_output)
vl_api_interface_index_t sw_if_index
u32 sw_if_indices[VLIB_FRAME_SIZE]
static void feat_bitmap_init_next_nodes(vlib_main_t *vm, u32 node_index, u32 num_features, char **feat_names, u32 *next_nodes)
Initialize the feature next-node indexes of a graph node.
vl_api_fib_path_type_t type
vlib_node_registration_t l2_out_feat_arc_node
(constructor) VLIB_REGISTER_NODE (l2_out_feat_arc_node)
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)
static_always_inline void get_sw_if_index_xN(int vector_sz, int is_output, vlib_buffer_t **b, u32 *out_sw_if_index)
vl_api_wireguard_peer_flags_t flags