19 #ifndef CLIB_MARCH_VARIANT 39 return (pwcw - pw_cw_dpo_pool);
71 u32 indent = va_arg (*args,
u32);
79 return (
format(s,
"pw-cw[???,%d]:", pwcwi));
83 s =
format(s,
"pw-cw[%d]:", pwcwi);
135 u32 n_left_from, next_index, * from, * to_next;
141 while (n_left_from > 0)
147 while (n_left_from >= 4 && n_left_to_next >= 2)
150 u32 bi0, pwcwi0, bi1, pwcwi1;
154 bi0 = to_next[0] = from[0];
155 bi1 = to_next[1] = from[1];
210 bi0, bi1, next0, next1);
213 while (n_left_from > 0 && n_left_to_next > 0)
244 n_left_to_next, bi0, next0);
274 .vector_size =
sizeof(
u32),
278 #ifndef CLIB_MARCH_VARIANT u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
dpo_lock_fn_t dv_lock
A reference counting lock function.
void pw_cw_dpo_create(const dpo_id_t *parent, dpo_id_t *dpo)
Create an PW CW pop.
A virtual function table regisitered for a DPO type.
static pw_cw_dpo_t * pw_cw_dpo_get(index_t index)
static void pw_cw_dpo_unlock(dpo_id_t *dpo)
dpo_proto_t dpoi_proto
the data-path protocol of the type.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define VLIB_NODE_FN(node)
#define pool_len(p)
Number of elements in pool vector.
static void pw_cw_dpo_mem_show(void)
void dpo_register(dpo_type_t type, const dpo_vft_t *vft, const char *const *const *nodes)
For a given DPO type Register:
static u8 * format_pw_cw_trace(u8 *s, va_list *args)
static pw_cw_dpo_t * pw_cw_dpo_alloc(void)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
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.
A representation of a Psuedo Wire Control Word pop DPO.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static index_t pw_cw_dpo_get_index(pw_cw_dpo_t *pwcw)
static uword pw_cw_pop_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
pw_cw_dpo_t * pw_cw_dpo_pool
#define pool_put(P, E)
Free an object E in pool P.
static const char *const *const pw_cw_nodes[DPO_PROTO_NUM]
#define pool_get_aligned_zero(P, E, A)
Allocate an object E from a pool P with alignment A and zero it.
dpo_id_t pwcw_parent
Next DPO in the graph.
#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.
#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).
u16 pwcw_locks
Number of locks/users of the label.
u8 * format_pw_cw_dpo(u8 *s, va_list *args)
#define VLIB_REGISTER_NODE(x,...)
#define CLIB_PREFETCH(addr, size, type)
vlib_node_registration_t pw_cw_node
(constructor) VLIB_REGISTER_NODE (pw_cw_node)
A struct to hold tracing information for the MPLS label imposition node.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
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.
vlib_main_t vlib_node_runtime_t * node
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
struct pw_cw_trace_t_ pw_cw_trace_t
A struct to hold tracing information for the MPLS label imposition node.
static const char *const pw_cw_proto_nodes[]
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject.
index_t dpoi_index
the index of objects of that type
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u32 pw_cw_t
A Psuedo Wire Control Word is 4 bytes.
void pw_cw_dpo_module_init(void)
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
u16 dpoi_next_node
The next VLIB node to follow.
static void pw_cw_dpo_lock(dpo_id_t *dpo)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
void dpo_stack(dpo_type_t child_type, dpo_proto_t child_proto, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child-parent relationship.
static uword pool_elts(void *v)
Number of active elements in a pool.