|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
53 #define _(sym,name) name,
67 static char *display_names[] = {
68 #define _(sym,name) #sym,
72 u32 feature_bitmap = va_arg (*args,
u32);
73 u32 verbose = va_arg (*args,
u32);
75 if (feature_bitmap == 0)
77 s =
format (s,
" none configured");
81 feature_bitmap &= ~L2INPUT_FEAT_DROP;
85 if (feature_bitmap & (1 <<
i))
88 s =
format (s,
"%17s (%s)\n",
101 u32 verbose = va_arg (*args,
u32);
129 s =
format (s,
" L2 bridge bd-id %d idx %d shg %d %s",
134 s =
format (s,
" L2 xconnect %U",
202 const u8 * old_address,
const u8 * new_address)
216 L2FIB_ENTRY_RESULT_FLAG_BVI |
217 L2FIB_ENTRY_RESULT_FLAG_STATIC);
270 i32 l2_if_adjust = 0;
372 L2INPUT_FEAT_UU_FLOOD |
373 L2INPUT_FEAT_UU_FWD |
376 L2INPUT_FEAT_ARP_UFWD |
377 L2INPUT_FEAT_ARP_TERM);
406 L2FIB_ENTRY_RESULT_FLAG_BVI |
407 L2FIB_ENTRY_RESULT_FLAG_STATIC);
433 .flags = member_flags,
449 ~(L2INPUT_FEAT_LEARN | L2INPUT_FEAT_FWD | L2INPUT_FEAT_FLOOD);
461 L2INPUT_FEAT_DROP | L2INPUT_FEAT_INPUT_CLASSIFY;
465 ~(L2INPUT_FEAT_LEARN | L2INPUT_FEAT_FWD | L2INPUT_FEAT_FLOOD);
487 hi->l2_if_count += l2_if_adjust;
491 if ((
hi->l2_if_count == 1) && (l2_if_adjust == 1))
498 else if ((
hi->l2_if_count == 0) && (l2_if_adjust == -1))
512 if (dev_class->set_l2_mode_function)
514 dev_class->set_l2_mode_function (
vnet_main,
hi, l2_if_adjust);
651 .path =
"set interface l2 bridge",
652 .short_help =
"set interface l2 bridge <interface> <bridge-domain-id> [bvi|uu-fwd] [shg]",
717 .path =
"set interface l2 xconnect",
718 .short_help =
"set interface l2 xconnect <interface> <peer interface>",
767 .path =
"set interface l3",
768 .short_help =
"set interface l3 <interface>",
832 mode =
"l2 xconnect";
884 .short_help =
"show mode [<if-name1> <if-name2> ...]",
889 #define foreach_l2_init_function \
890 _(feat_bitmap_drop_init) \
892 _(l2_input_classify_init) \
895 _(l2_in_out_acl_init) \
899 _(l2_efp_filter_init) \
912 if ((error = vlib_call_init_function (vm, a))) return error; } \
void l2fib_flush_int_mac(vlib_main_t *vm, u32 sw_if_index)
Flush all non static MACs from an interface.
void ethernet_register_l2_input(vlib_main_t *vm, u32 node_index)
vnet_interface_main_t * im
struct _vnet_device_class vnet_device_class_t
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.
#define vec_new(T, N)
Create new vector of given type and length (unspecified alignment, no header).
u32 ethernet_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
void ethernet_sw_interface_set_l2_mode(vnet_main_t *vnm, u32 sw_if_index, u32 l2)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define clib_error_return(e, args...)
#define L2_FLOOD_MEMBER_BVI
u32 bd_remove_member(l2_bridge_domain_t *bd_config, u32 sw_if_index)
vl_api_tunnel_mode_t mode
vnet_hw_interface_class_t ethernet_hw_interface_class
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
static vnet_device_class_t * vnet_get_device_class(vnet_main_t *vnm, u32 dev_class_index)
void l2fib_add_entry(const u8 *mac, u32 bd_index, u32 sw_if_index, l2fib_entry_result_flags_t flags)
Add an entry to the l2fib.
l2_bridge_domain_t * bd_get(u32 bd_index)
u32 bd_input_walk(u32 bd_index, bd_input_walk_fn_t fn, void *data)
#define pool_foreach(VAR, POOL)
Iterate through pool.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
u32 * output_node_index_vec
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#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)
void bd_add_member(l2_bridge_domain_t *bd_config, l2_flood_member_t *member)
vnet_flood_class_t flood_class
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
static u32 bd_find_or_add_bd_index(bd_main_t *bdm, u32 bd_id)
Get or create a bridge domain.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
vnet_sw_interface_t * sw_interfaces
u32 feat_next_node_index[32]
l2_output_config_t * l2output_intf_config(u32 sw_if_index)
Get a pointer to the config for the given interface.
#define vec_free(V)
Free vector's memory (no header).
u32 bd_find_index(bd_main_t *bdm, u32 bd_id)
Get a bridge domain.
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,...
@ VNET_FLOOD_CLASS_NO_FLOOD
#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
u32 l2fib_del_entry(const u8 *mac, u32 bd_index, u32 sw_if_index)
Delete an entry from the l2fib.
#define vec_foreach(var, vec)
Vector iterator.
static uword pool_elts(void *v)
Number of active elements in a pool.
void bd_validate(l2_bridge_domain_t *bd_config)
Init bridge domain if not done already.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static vlib_main_t * vlib_get_main(void)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
#define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL
enum l2_bd_port_type_t_ l2_bd_port_type_t
l2_input_config_t * configs
vl_api_interface_index_t sw_if_index
#define L2_FLOOD_MEMBER_NORMAL
enum walk_rc_t_ walk_rc_t
Walk return code.
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.
vnet_interface_main_t interface_main
void l2fib_table_init(void)
l2_bridge_domain_t * bd_configs