|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
51 #ifndef CLIB_MARCH_VARIANT
59 #define foreach_l2_patch_error \
60 _(PATCHED, "L2 patch packets") \
61 _(DROPPED, "L2 patch misconfigured drops")
65 #define _(sym,str) L2_PATCH_ERROR_##sym,
72 #define _(sym,string) string,
89 if ((
b->
flags & VLIB_BUFFER_IS_TRACED) == 0)
203 em->
counters[node_counter_base_index + L2_PATCH_ERROR_PATCHED] +=
206 return frame->n_vectors;
212 .vector_size =
sizeof (
u32),
230 #ifndef CLIB_MARCH_VARIANT
247 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
251 return VNET_API_ERROR_INVALID_SW_IF_INDEX_2;
317 else if (
unformat (line_input,
"del"))
342 case VNET_API_ERROR_INVALID_SW_IF_INDEX:
346 case VNET_API_ERROR_INVALID_SW_IF_INDEX_2:
352 (0,
"WARNING: vnet_l2_patch_add_del returned %d",
rv);
374 .path =
"test l2patch",
375 .short_help =
"test l2patch rx <intfc> tx <intfc> [del]",
392 for (rx_sw_if_index = 0;
426 .path =
"show l2patch",
427 .short_help =
"Show l2 interface cross-connect entries",
static clib_error_t * l2_patch_init(vlib_main_t *vm)
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
static clib_error_t * show_l2patch(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Display the contents of the l2patch table.
u32 ethernet_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
static_always_inline void l2_patch_trace(vlib_main_t *vm, vlib_node_runtime_t *node, l2_patch_main_t *l2pm, vlib_buffer_t *b, u32 sw_if_index)
vlib_get_buffers(vm, from, b, n_left_from)
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
l2_patch_main_t l2_patch_main
#define clib_error_return(e, args...)
vlib_error_main_t error_main
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 vlib_cli_command_t test_patch_command
(constructor) VLIB_CLI_COMMAND (test_patch_command)
static char * l2_patch_error_strings[]
u32 * tx_sw_if_index_by_rx_sw_if_index
int vnet_l2_patch_add_del(u32 rx_sw_if_index, u32 tx_sw_if_index, int is_add)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define VLIB_NODE_FN(node)
static clib_error_t * test_patch_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vnet_main_t * vnet_get_main(void)
#define VLIB_NODE_FLAG_TRACE
static vlib_cli_command_t show_l2patch_cli
(constructor) VLIB_CLI_COMMAND (show_l2patch_cli)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vlib_node_registration_t l2_patch_node
(constructor) VLIB_REGISTER_NODE (l2_patch_node)
#define static_always_inline
vl_api_interface_index_t tx_sw_if_index
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
#define VLIB_CLI_COMMAND(x,...)
struct _vlib_node_registration vlib_node_registration_t
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define foreach_l2_patch_error
format_function_t format_vnet_sw_if_index_name
unformat_function_t unformat_vnet_sw_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,...
static u8 * format_l2_patch_trace(u8 *s, va_list *args)
#define VLIB_INIT_FUNCTION(x)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static_always_inline void l2_patch_inline(vlib_main_t *vm, vlib_node_runtime_t *node, l2_patch_main_t *l2pm, vlib_buffer_t **b, u16 *next, u32 n_left, int do_trace)
u32 * tx_next_by_rx_sw_if_index
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)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
#define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL
u16 nexts[VLIB_FRAME_SIZE]
vl_api_interface_index_t sw_if_index
vl_api_fib_path_type_t type
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,...)