154 return (
format(s,
"l2-bridge-%U-dpo",
222 u32 n_left_from, next_index, * from, * to_next;
229 while (n_left_from > 0)
235 while (n_left_from >= 4 && n_left_to_next > 2)
238 u32 bi0, l2bi0, bi1, l2bi1;
288 n_left_to_next, bi0, bi1,
293 while (n_left_from > 0 && n_left_to_next > 0)
346 s =
format (s,
"%U sw_if_index:%d",
363 .name =
"l2-bridge-dpo",
364 .vector_size =
sizeof (
u32),
dpo_lock_fn_t dv_lock
A reference counting lock function.
A virtual function table regisitered for a DPO type.
static l2_bridge_dpo_t * l2_bridge_dpo_get_from_dpo(const dpo_id_t *dpo)
vnet_main_t * vnet_get_main(void)
struct l2_bridge_dpo_trace_t_ l2_bridge_dpo_trace_t
Interface DPO trace data.
static index_t * l2_bridge_dpo_db
u8 * format_l2_bridge_dpo(u8 *s, va_list *ap)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static l2_bridge_dpo_t * l2_bridge_dpo_alloc(void)
u16 l2b_locks
number of locks.
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
static const char *const *const l2_bridge_dpo_nodes[DPO_PROTO_NUM]
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static const char *const l2_bridge_dpo_l2_nodes[]
The per-protocol VLIB graph nodes that are assigned to a glean object.
Interface DPO trace data.
#define pool_len(p)
Number of elements in pool vector.
void dpo_register(dpo_type_t type, const dpo_vft_t *vft, const char *const *const *nodes)
For a given DPO type Register:
enum l2_bridge_dpo_next_t_ l2_bridge_dpo_next_t
void fib_show_memory_usage(const char *name, u32 in_use_elts, u32 allocd_elts, size_t size_elt)
Show the memory usage for a type.
The data-path object representing an L2 bridge.
static void l2_bridge_dpo_mem_show(void)
VNET_SW_INTERFACE_ADD_DEL_FUNCTION(l2_bridge_dpo_interface_delete)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
format_function_t format_vnet_sw_interface_name
static ethernet_header_t * ethernet_buffer_get_header(vlib_buffer_t *b)
static u8 * format_l2_bridge_dpo_trace(u8 *s, va_list *args)
dpo_type_t dpoi_type
the type
void l2_bridge_dpo_add_or_lock(u32 sw_if_index, dpo_id_t *dpo)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define pool_put(P, E)
Free an object E in pool P.
VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION(l2_bridge_dpo_hw_interface_state_change)
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
vlib_node_registration_t l2_bridge_dpo_l2_node
(constructor) VLIB_REGISTER_NODE (l2_bridge_dpo_l2_node)
#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.
#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).
void l2_bridge_dpo_module_init(void)
static uword l2_bridge_dpo_l2(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
l2_bridge_dpo_t * l2_bridge_dpo_pool
pool of all interface DPOs
#define VLIB_BUFFER_IS_TRACED
static void l2_bridge_dpo_unlock(dpo_id_t *dpo)
static clib_error_t * l2_bridge_dpo_interface_state_change(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static l2_bridge_dpo_t * l2_bridge_dpo_get(index_t index)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
u32 l2b_sw_if_index
The Software interface index that the packets will output on.
VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(l2_bridge_dpo_interface_state_change)
index_t dpoi_index
the index of objects of that type
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static index_t l2_bridge_dpo_get_index(l2_bridge_dpo_t *l2b)
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
#define VLIB_REGISTER_NODE(x,...)
static clib_error_t * l2_bridge_dpo_interface_delete(vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
static void l2_bridge_dpo_lock(dpo_id_t *dpo)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static uword l2_bridge_dpo_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static clib_error_t * l2_bridge_dpo_hw_interface_state_change(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
Registered callback for HW interface state changes.
static uword pool_elts(void *v)
Number of active elements in a pool.