|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
29 #ifndef CLIB_MARCH_VARIANT
32 #define _(sym,name) name,
46 static char *display_names[] = {
47 #define _(sym,name) #sym,
51 u32 feature_bitmap = va_arg (*args,
u32);
52 u32 verbose = va_arg (*args,
u32);
54 if (feature_bitmap == 0)
56 s =
format (s,
" none configured");
63 if (feature_bitmap & (1 <<
i))
67 format (s,
"%17s (%s)\n", display_names[
i],
97 s =
format (s,
"l2-output: sw_if_index %d dst %U src %U data "
98 "%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x",
111 #define _(sym,string) string,
130 b->
error =
node->errors[L2OUTPUT_ERROR_SHG_DROP];
137 u32 n_left,
int l2_efp,
int l2_vtr,
int l2_pbb,
138 int shg_set,
int update_feature_bitmap)
148 if (l2_vtr || l2_pbb || shg_set)
156 if (update_feature_bitmap)
167 for (
i = 0;
i < 4;
i++)
169 u32 failed1 = l2_efp &&
176 b[
i]->
error =
node->errors[L2OUTPUT_ERROR_VTR_DROP];
178 b[
i]->
error =
node->errors[L2OUTPUT_ERROR_EFP_DROP];
186 for (
i = 0;
i < 4;
i++)
190 b[
i]->
error =
node->errors[L2OUTPUT_ERROR_VTR_DROP];
210 if (update_feature_bitmap)
215 u32 failed1 = l2_efp &&
222 b[0]->
error =
node->errors[L2OUTPUT_ERROR_VTR_DROP];
224 b[0]->
error =
node->errors[L2OUTPUT_ERROR_EFP_DROP];
231 b[0]->
error =
node->errors[L2OUTPUT_ERROR_VTR_DROP];
269 int l2_vtr,
int l2_pbb)
272 if (config->
shg == 0 && feature_bitmap == 0)
274 if ((l2_efp | l2_vtr | l2_pbb) == 0)
277 l2_efp, l2_vtr, l2_pbb, 0, 0);
279 else if (config->
shg == 0)
281 l2_efp, l2_vtr, l2_pbb, 0, 1);
282 else if (feature_bitmap == 0)
284 l2_efp, l2_vtr, l2_pbb, 1, 0);
287 l2_efp, l2_vtr, l2_pbb, 1, 1);
309 cdo = cur_data_offsets;
363 cdo = cur_data_offsets +
off;
371 if (
PREDICT_FALSE ((feature_bitmap & ~L2OUTPUT_FEAT_OUTPUT) != 0))
382 (
b,
count,
node->errors[L2OUTPUT_ERROR_MAPPING_DROP]);
389 if (feature_bitmap & L2OUTPUT_FEAT_EFP_FILTER)
440 L2OUTPUT_ERROR_L2OUTPUT,
frame->n_vectors);
442 return frame->n_vectors;
448 .vector_size =
sizeof (
u32),
466 #define foreach_l2output_bad_intf_error \
467 _(DROP, "L2 output to interface not in L2 mode or deleted")
470 #define _(sym,string) string,
477 #define _(sym,str) L2OUTPUT_BAD_INTF_ERROR_##sym,
518 to_next[0] = bi0 =
from[0];
519 to_next[1] = bi1 =
from[1];
526 b0->
error =
node->errors[L2OUTPUT_BAD_INTF_ERROR_DROP];
527 b1->
error =
node->errors[L2OUTPUT_BAD_INTF_ERROR_DROP];
542 b0->
error =
node->errors[L2OUTPUT_BAD_INTF_ERROR_DROP];
548 return frame->n_vectors;
553 .name =
"l2-output-bad-intf",
554 .vector_size =
sizeof (
u32),
598 #ifndef CLIB_MARCH_VARIANT
static char * l2output_feat_names[]
ptr_config_t output_pbb_vtr
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
const char *const const char *const raw
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static char * l2output_bad_intf_error_strings[]
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
void l2output_create_output_node_mapping(vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 sw_if_index)
Create a mapping in the next node mapping table for the given sw_if_index.
nat44_ei_hairpin_src_next_t next_index
#define foreach_l2output_bad_intf_error
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static_always_inline void clib_memset_u16(void *p, u16 val, uword count)
u8 * format_ethernet_address(u8 *s, va_list *args)
vlib_get_buffers(vm, from, b, n_left_from)
u8 * format_l2_output_features(u8 *s, va_list *args)
@ VLIB_NODE_TYPE_INTERNAL
static u32 l2_pbb_process(vlib_buffer_t *b0, ptr_config_t *config)
vlib_main_t vlib_node_runtime_t * node
static u8 * format_l2output_trace(u8 *s, va_list *args)
static_always_inline void l2output_process_batch(vlib_main_t *vm, vlib_node_runtime_t *node, l2_output_config_t *config, vlib_buffer_t **b, i16 *cdo, u16 *next, u32 n_left, int l2_efp, int l2_vtr, int l2_pbb)
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 * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
#define vec_elt(v, i)
Get vector value at index i.
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
static u32 l2_vtr_process(vlib_buffer_t *b0, vtr_config_t *config)
Perform the configured tag rewrite on the packet.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
u32 * output_node_index_vec
static_always_inline void l2output_set_buffer_error(vlib_buffer_t **b, u32 n_left, vlib_error_t error)
#define VLIB_NODE_FN(node)
l2output_bad_intf_error_t
char ** l2output_get_feat_names(void)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
vnet_main_t * vnet_get_main(void)
#define VLIB_NODE_FLAG_TRACE
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static u8 l2_efp_filter_process(vlib_buffer_t *b0, vtr_config_t *in_config)
#define static_always_inline
static_always_inline void split_horizon_violation(vlib_node_runtime_t *node, u8 shg, vlib_buffer_t *b, u16 *next)
Check for split horizon violations.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
static_always_inline void l2output_process_batch_inline(vlib_main_t *vm, vlib_node_runtime_t *node, l2_output_config_t *config, vlib_buffer_t **b, i16 *cdo, u16 *next, u32 n_left, int l2_efp, int l2_vtr, int l2_pbb, int shg_set, int update_feature_bitmap)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
static_always_inline uword clib_count_equal_u32(u32 *data, uword max_count)
struct _vlib_node_registration vlib_node_registration_t
l2_output_config_t * l2output_intf_config(u32 sw_if_index)
Get a pointer to the config for the given interface.
@ L2OUTPUT_BAD_INTF_N_ERROR
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 vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
vlib_put_next_frame(vm, node, next_index, 0)
#define VLIB_INIT_FUNCTION(x)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
l2output_main_t l2output_main
static_always_inline void clib_prefetch_load(void *p)
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.
#define foreach_l2output_error
vlib_node_registration_t l2output_node
(constructor) VLIB_REGISTER_NODE (l2output_node)
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.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
u16 nexts[VLIB_FRAME_SIZE]
vlib_node_registration_t l2output_bad_intf_node
(constructor) VLIB_REGISTER_NODE (l2output_bad_intf_node)
int vlib_main(vlib_main_t *volatile vm, unformat_input_t *input)
vl_api_interface_index_t sw_if_index
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
u32 sw_if_indices[VLIB_FRAME_SIZE]
l2_output_config_t * configs
static clib_error_t * l2output_init(vlib_main_t *vm)
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 buffer representation.
#define VLIB_REGISTER_NODE(x,...)
static char * l2output_error_strings[]
vl_api_wireguard_peer_flags_t flags