|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
51 u32 feat_next_node_index[32];
82 s =
format (s,
"l2-flood: sw_if_index %d dst %U src %U bd_index %d",
91 #ifndef CLIB_MARCH_VARIANT
95 #define foreach_l2flood_error \
96 _(L2FLOOD, "L2 flood packets") \
97 _(REPL_FAIL, "L2 replication failures") \
98 _(NO_MEMBERS, "L2 replication complete") \
99 _(BVI_BAD_MAC, "BVI L3 mac mismatch") \
100 _(BVI_ETHERTYPE, "BVI packet with unhandled ethertype")
104 #define _(sym,str) L2FLOOD_ERROR_##sym,
111 #define _(sym,string) string,
158 u16 n_clones, n_cloned, clone0;
160 u32 sw_if_index0, bi0, ci0;
187 for (mi = bd_config->
flood_count - 1; mi >= 0; mi--)
189 member = &bd_config->
members[mi];
191 (!in_shg || (member->
shg != in_shg)))
206 b0->
error =
node->errors[L2FLOOD_ERROR_NO_MEMBERS];
208 to_next, n_left_to_next,
212 else if (n_clones > 1)
231 b0->
error =
node->errors[L2FLOOD_ERROR_REPL_FAIL];
237 goto use_original_buffer;
244 for (clone0 = 0; clone0 < n_cloned - 1; clone0++)
255 (b0->
flags & VLIB_BUFFER_IS_TRACED)))
273 to_next, n_left_to_next,
304 (b0->
flags & VLIB_BUFFER_IS_TRACED)))
329 c0->
error =
node->errors[L2FLOOD_ERROR_BVI_BAD_MAC];
333 c0->
error =
node->errors[L2FLOOD_ERROR_BVI_ETHERTYPE];
345 to_next, n_left_to_next,
351 to_next, n_left_to_next);
359 L2FLOOD_ERROR_L2FLOOD,
frame->n_vectors);
361 return frame->n_vectors;
368 .vector_size =
sizeof (
u32),
385 #ifndef CLIB_MARCH_VARIANT
473 .path =
"set interface l2 flood",
474 .short_help =
"set interface l2 flood <interface> [disable]",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static u32 vlib_num_workers()
void l2flood_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
Add the L3 input node for this ethertype to the next nodes structure.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
next_by_ethertype_t l3_next
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
vlib_node_registration_t l2flood_node
(constructor) VLIB_REGISTER_NODE (l2flood_node)
nat44_ei_hairpin_src_next_t next_index
clib_error_t * l2flood_init(vlib_main_t *vm)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
l2_flood_member_t *** members
#define foreach_l2flood_error
#define TO_BVI_ERR_BAD_MAC
u8 * format_ethernet_address(u8 *s, va_list *args)
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
#define clib_error_return(e, args...)
#define L2_FLOOD_MEMBER_BVI
#define TO_BVI_ERR_ETHERTYPE
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define VLIB_BUFFER_CLONE_HEAD_SIZE
l2flood_main_t l2flood_main
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define VLIB_NODE_FN(node)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static vlib_cli_command_t int_flood_cli
(constructor) VLIB_CLI_COMMAND (int_flood_cli)
#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 clib_error_t * int_flood(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Set subinterface flood enable/disable.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
static u16 vlib_buffer_clone(vlib_main_t *vm, u32 src_buffer, u32 *buffers, u16 n_buffers, u16 head_end_offset)
Create multiple clones of buffer and store them in the supplied array.
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
struct _vlib_node_registration vlib_node_registration_t
#define vec_set_len(v, l)
Set vector length to a user-defined value.
static u8 * format_l2flood_trace(u8 *s, va_list *args)
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
unformat_function_t unformat_vnet_sw_interface
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
#define VLIB_INIT_FUNCTION(x)
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)
l2_flood_member_t * members
clib_error_t * next_by_ethertype_register(next_by_ethertype_t *l3_next, u32 ethertype, u32 next_index)
static char * l2flood_error_strings[]
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 feat_next_node_index[32]
static_always_inline u32 l2_to_bvi(vlib_main_t *vlib_main, vnet_main_t *vnet_main, vlib_buffer_t *b0, u32 bvi_sw_if_index, next_by_ethertype_t *l3_next, u16 *next0)
Send a packet from L2 processing to L3 via the BVI interface.
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
l2_bridge_domain_t * bd_configs
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)