31 memset(mdd, 0,
sizeof(*mdd));
41 return (mdd - mpls_disp_dpo_pool);
68 u32 indent = va_arg (*args,
u32);
73 s =
format(s,
"mpls-disposition:[%d]:[%U]",
125 u32 n_left_from, next_index, * from, * to_next;
132 while (n_left_from > 0)
138 while (n_left_from >= 4 && n_left_to_next >= 2)
141 u32 bi0, mddi0, bi1, mddi1;
145 bi0 = to_next[0] = from[0];
146 bi1 = to_next[1] = from[1];
182 else if (payload_is_ip6)
212 bi0, bi1, next0, next1);
215 while (n_left_from > 0 && n_left_to_next > 0)
241 else if (payload_is_ip6)
263 n_left_to_next, bi0, next0);
293 .name =
"ip4-mpls-label-disposition",
294 .vector_size =
sizeof (
u32),
314 .function = ip6_mpls_label_disposition,
315 .name =
"ip6-mpls-label-disposition",
316 .vector_size =
sizeof (
u32),
325 ip6_mpls_label_disposition)
328 mpls_disp_dpo_mem_show (
void)
340 .dv_mem_show = mpls_disp_dpo_mem_show,
345 "ip4-mpls-label-disposition",
350 "ip6-mpls-label-disposition",
dpo_lock_fn_t dv_lock
A reference counting lock function.
u16 mdd_locks
Number of locks/users of the label.
A struct to hold tracing information for the MPLS label disposition node.
A virtual function table regisitered for a DPO type.
static void mpls_disp_dpo_lock(dpo_id_t *dpo)
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.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define pool_len(p)
Number of elements in pool vector.
static index_t mpls_disp_dpo_get_index(mpls_disp_dpo_t *mdd)
static mpls_disp_dpo_t * mpls_disp_dpo_alloc(void)
void dpo_register(dpo_type_t type, const dpo_vft_t *vft, const char *const *const *nodes)
For a given DPO type Register:
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
dpo_proto_t mdd_payload_proto
The protocol of the payload/packets that are being encapped.
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.
static const char *const *const mpls_label_disp_nodes[DPO_PROTO_NUM]
fib_rpf_id_t mdd_rpf_id
RPF-ID (if this is an mcast disposition)
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
static void mpls_disp_dpo_unlock(dpo_id_t *dpo)
static const char *const mpls_label_disp_ip6_nodes[]
static uword ip4_mpls_label_disposition(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define pool_put(P, E)
Free an object E in pool P.
VLIB_NODE_FUNCTION_MULTIARCH(ip4_mpls_label_disposition_node, ip4_mpls_label_disposition)
#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).
mpls_disp_dpo_t * mpls_disp_dpo_pool
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P (general version).
#define CLIB_PREFETCH(addr, size, type)
static const char *const mpls_label_disp_ip4_nodes[]
#define VLIB_BUFFER_IS_TRACED
struct mpls_label_disposition_trace_t_ mpls_label_disposition_trace_t
A struct to hold tracing information for the MPLS label disposition node.
u8 * format_mpls_disp_dpo(u8 *s, va_list *args)
index_t mpls_disp_dpo_create(dpo_proto_t payload_proto, fib_rpf_id_t rpf_id, const dpo_id_t *dpo)
Create an MPLS label object.
void mpls_disp_dpo_module_init(void)
u32 fib_rpf_id_t
An RPF-ID is numerical value that is used RPF validate.
A representation of an MPLS label for imposition in the data-path.
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject
dpo_id_t mdd_dpo
Next DPO in the graph.
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static mpls_disp_dpo_t * mpls_disp_dpo_get(index_t index)
static uword mpls_label_disposition_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u8 payload_is_ip4, u8 payload_is_ip6)
index_t dpoi_index
the index of objects of that type
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vlib_node_registration_t ip6_mpls_label_disposition_node
(constructor) VLIB_REGISTER_NODE (ip6_mpls_label_disposition_node)
u8 * format_dpo_proto(u8 *s, va_list *args)
format a DPO protocol
#define VLIB_REGISTER_NODE(x,...)
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
u16 dpoi_next_node
The next VLIB node to follow.
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vlib_node_registration_t ip4_mpls_label_disposition_node
(constructor) VLIB_REGISTER_NODE (ip4_mpls_label_disposition_node)
static u8 * format_mpls_label_disposition_trace(u8 *s, va_list *args)
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.