21 #ifndef CLIB_MARCH_VARIANT 43 return (mdd - mpls_disp_dpo_pool);
86 u32 indent = va_arg(*args,
u32);
91 s =
format(s,
"mpls-disposition:[%d]:[", index);
157 u32 n_left_from, next_index, * from, * to_next;
183 while (n_left_from > 0)
189 while (n_left_from >= 4 && n_left_to_next >= 2)
192 u32 bi0, mddi0, bi1, mddi1;
196 bi0 = to_next[0] = from[0];
197 bi1 = to_next[1] = from[1];
260 else if (payload_is_ip6)
317 bi0, bi1, next0, next1);
320 while (n_left_from > 0 && n_left_to_next > 0)
364 else if (payload_is_ip6)
402 n_left_to_next, bi0, next0);
418 s =
format(s,
"rpf-id:%d %U, %U",
435 .name =
"ip4-mpls-label-disposition-pipe",
436 .vector_size =
sizeof(
u32),
439 .sibling_of =
"ip4-input",
453 .name =
"ip6-mpls-label-disposition-pipe",
454 .vector_size =
sizeof(
u32),
457 .sibling_of =
"ip6-input",
471 .name =
"ip4-mpls-label-disposition-uniform",
472 .vector_size =
sizeof(
u32),
475 .sibling_of =
"ip4-input",
489 .name =
"ip6-mpls-label-disposition-uniform",
490 .vector_size =
sizeof(
u32),
493 .sibling_of =
"ip6-input",
498 #ifndef CLIB_MARCH_VARIANT 517 "ip4-mpls-label-disposition-pipe",
522 "ip6-mpls-label-disposition-pipe",
533 "ip4-mpls-label-disposition-uniform",
538 "ip6-mpls-label-disposition-uniform",
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.
u16 mdd_locks
Number of locks/users of the label.
A struct to hold tracing information for the MPLS label disposition node.
void mpls_disp_dpo_create(dpo_proto_t payload_proto, fib_rpf_id_t rpf_id, fib_mpls_lsp_mode_t mode, const dpo_id_t *parent, dpo_id_t *dpo)
Create an MPLS label object.
A virtual function table regisitered for a DPO type.
static_always_inline void ip6_set_traffic_class_network_order(ip6_header_t *ip6, ip_dscp_t dscp)
static void mpls_disp_dpo_lock(dpo_id_t *dpo)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
char * ip4_error_strings[]
static const char *const *const mpls_label_disp_pipe_nodes[DPO_PROTO_NUM]
static const char *const mpls_label_disp_pipe_ip6_nodes[]
#define VLIB_NODE_FN(node)
#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:
enum dpo_type_t_ dpo_type_t
Common types of data-path objects New types can be dynamically added using dpo_register_new_type() ...
u8 * format_fib_mpls_lsp_mode(u8 *s, va_list *ap)
Format an LSP mode type.
#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.
vlib_node_registration_t ip6_mpls_label_disposition_uniform_node
(constructor) VLIB_REGISTER_NODE (ip6_mpls_label_disposition_uniform_node)
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.
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)
vlib_node_registration_t ip4_mpls_label_disposition_pipe_node
(constructor) VLIB_REGISTER_NODE (ip4_mpls_label_disposition_pipe_node)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
static void mpls_disp_dpo_mem_show(void)
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, fib_mpls_lsp_mode_t mode)
enum fib_mpls_lsp_mode_t_ fib_mpls_lsp_mode_t
MPLS LSP mode - only valid at the head and tail.
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.
static const char *const mpls_label_disp_pipe_ip4_nodes[]
static u8 mpls_exp_to_ip_dscp(u8 exp)
When in uniform mode convert an MPLS EXP value to an IPv[46] DSCP value.
#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).
vl_api_tunnel_mode_t mode
mpls_disp_dpo_t * mpls_disp_dpo_pool
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
dpo_proto_t mddt_payload_proto
#define VLIB_REGISTER_NODE(x,...)
#define CLIB_PREFETCH(addr, size, type)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
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)
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.
void mpls_disp_dpo_module_init(void)
vlib_main_t vlib_node_runtime_t * node
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.
static const char *const mpls_label_disp_uniform_ip4_nodes[]
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject.
static const char *const *const mpls_label_disp_uniform_nodes[DPO_PROTO_NUM]
dpo_id_t mdd_dpo
Next DPO in the graph.
struct _vlib_node_registration vlib_node_registration_t
static mpls_disp_dpo_t * mpls_disp_dpo_get(index_t index)
index_t dpoi_index
the index of objects of that type
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
fib_mpls_lsp_mode_t mdd_mode
LSP mode.
VLIB buffer representation.
static const char *const mpls_label_disp_uniform_ip6_nodes[]
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vlib_node_registration_t ip6_mpls_label_disposition_pipe_node
(constructor) VLIB_REGISTER_NODE (ip6_mpls_label_disposition_pipe_node)
u8 * format_dpo_proto(u8 *s, va_list *args)
format a DPO protocol
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.
vlib_node_registration_t ip4_mpls_label_disposition_uniform_node
(constructor) VLIB_REGISTER_NODE (ip4_mpls_label_disposition_uniform_node)
fib_mpls_lsp_mode_t mddt_mode
#define CLIB_CACHE_LINE_BYTES
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static u16 ip4_header_checksum(ip4_header_t *i)
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.