|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
108 n_insert =
vec_len (
node->next_nodes) -
r->n_next_nodes;
111 i =
r->next_frame_index +
r->n_next_nodes;
115 for (j = 0; j < n_insert; j++)
119 for (j = 0; j <
vec_len (
nm->nodes); j++)
163 if ((p =
hash_get (
node->next_slot_by_node, next_node_index)))
190 if ((p =
hash_get (
node->next_slot_by_node, next_node_index)))
206 if ((old_next_index =
node->next_nodes[
slot]) != ~0u)
214 node->next_nodes[
slot] = next_node_index;
219 next->prev_node_bitmap = clib_bitmap_ori (
next->prev_node_bitmap,
224 uword sib_node_index, sib_slot;
228 sib_node =
vec_elt (
nm->nodes, sib_node_index);
229 if (sib_node !=
node)
289 #define STACK_ALIGN (clib_mem_get_page_size())
291 #define STACK_ALIGN CLIB_CACHE_LINE_BYTES
304 if (
nm->node_fn_default_march_variant != ~0)
309 if (
r->march_variant ==
nm->node_fn_default_march_variant)
311 r =
r->next_registration;
324 r =
r->next_registration;
345 if (
r->node_fn_registrations)
371 if (!
nm->node_by_name)
392 if (
r->sibling_of &&
r->n_next_nodes > 0)
393 clib_error (
"sibling node should not have any next nodes `%v'", n->
name);
398 #define _(f) n->f = r->f
415 _(runtime_data_bytes);
416 if (
r->runtime_data_bytes > 0)
424 for (
i = 0;
i <
r->n_next_nodes;
i++)
440 uword log2_n_stack_bytes;
442 log2_n_stack_bytes =
clib_max (
r->process_log2_n_stack_bytes,
443 VLIB_PROCESS_LOG2_STACK_SIZE);
444 log2_n_stack_bytes =
clib_max (log2_n_stack_bytes,
458 clib_panic (
"failed to allocate process stack (%d bytes)",
459 1ULL << log2_n_stack_bytes);
485 nm->input_node_counts_by_state[n->
state] += 1;
492 rt->n_next_nodes =
r->n_next_nodes;
496 for (
i = 0;
i <
rt->n_next_nodes;
i++)
545 nm->node_fn_default_march_variant = ~0;
552 vec_add2 (nm->variants, v, 1); \
554 v->index = CLIB_MARCH_VARIANT_TYPE_##s; \
555 v->priority = clib_cpu_march_priority_##s (); \
578 static char *null_node_error_strings[] = {
579 "blackholed packets",
584 .vector_size =
sizeof (
u32),
587 .error_strings = null_node_error_strings,
598 r =
r->next_registration;
614 u32 threads_to_serialize;
637 for (j = 0; j < threads_to_serialize; j++)
639 stat_vm = stat_vms[j];
651 nodes = node_dups[j];
654 node_dups[j] = nodes;
660 *node_dupsp = node_dups;
661 *stat_vmsp = stat_vms;
673 #ifdef VLIB_SUPPORTS_ARBITRARY_SCALAR_SIZES
683 for (ni = 0; ni <
vec_len (
nm->nodes); ni++)
719 for (ni = 0; ni <
vec_len (
nm->nodes); ni++)
735 (
"node `%v' refers to unknown node `%s'", n->
name,
a);
744 for (ni = 0; ni <
vec_len (
nm->nodes); ni++)
770 if (
r->n_next_nodes == 0)
781 ASSERT (nf[
i].node_runtime_index ==
next->runtime_index);
801 memset (&
r, 0,
sizeof (
r));
805 r.process_log2_n_stack_bytes = log2_n_stack_bytes;
838 if (fnr->march_variant == v->
index)
851 fnr = fnr->next_registration;
void vlib_node_get_nodes(vlib_main_t *vm, u32 max_threads, int include_stats, int barrier_sync, vlib_node_t ****node_dupsp, vlib_main_t ***stat_vmsp)
Get list of nodes.
void vlib_node_sync_stats(vlib_main_t *vm, vlib_node_t *n)
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
struct _vlib_node_fn_registration vlib_node_fn_registration_t
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
void vlib_register_errors(vlib_main_t *vm, u32 node_index, u32 n_errors, char *error_strings[], vlib_error_desc_t counters[])
#define hash_set(h, key, value)
char * format
Format string.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
#define VLIB_FRAME_NO_FREE_AFTER_DISPATCH
#define vec_new(T, N)
Create new vector of given type and length (unspecified alignment, no header).
#define clib_memcpy(d, s, n)
nat44_ei_hairpin_src_next_t next_index
#define VLIB_NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH
int vlib_node_set_march_variant(vlib_main_t *vm, u32 node_index, clib_march_variant_type_t march_variant)
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
#define hash_create_string(elts, value_bytes)
elog_event_type_t * node_call_elog_event_types
void vlib_register_all_node_march_variants(vlib_main_t *vm)
vlib_node_main_t node_main
vlib_node_fn_registration_t * node_fn_registrations
u32 next_frame_index
Start of next frames for this node.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vl_api_dhcp_client_state_t state
vlib_node_runtime_t node_runtime
__clib_export u32 elog_string(elog_main_t *em, char *fmt,...)
add a string to the event-log string table
@ CLIB_MARCH_VARIANT_TYPE
#define VLIB_NODE_RUNTIME_DATA_SIZE
#define CLIB_MEM_VM_MAP_FAILED
uword() vlib_node_function_t(struct vlib_main_t *vm, struct vlib_node_runtime_t *node, struct vlib_frame_t *frame)
vnet_hw_if_output_node_runtime_t * r
elog_event_type_t * node_return_elog_event_types
void vlib_start_process(vlib_main_t *vm, uword process_index)
static vlib_global_main_t * vlib_get_global_main(void)
#define hash_unset(h, key)
void vlib_register_all_static_nodes(vlib_main_t *vm)
uword vlib_node_add_next_with_slot(vlib_main_t *vm, uword node_index, uword next_node_index, uword slot)
#define clib_mem_alloc_no_fail(size)
#define vec_elt(v, i)
Get vector value at index i.
static vnet_feature_upd_registration_t * regs
#define pool_foreach(VAR, POOL)
Iterate through pool.
#define clib_error_create(args...)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void vlib_worker_thread_node_runtime_update(void)
static void vlib_node_runtime_update(vlib_main_t *vm, u32 node_index, u32 next_index)
#define VLIB_NODE_MAIN_RUNTIME_STARTED
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define vec_dup(V)
Return copy of vector (no header, no alignment)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
__clib_export void clib_interrupt_resize(void **data, uword n_int)
u32 vlib_process_create(vlib_main_t *vm, char *name, vlib_node_function_t *f, u32 log2_n_stack_bytes)
Create a vlib process.
#define vlib_worker_thread_barrier_sync(X)
static_always_inline uword vlib_get_thread_index(void)
clib_march_variant_type_t index
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
clib_error_t * vlib_node_main_init(vlib_main_t *vm)
vlib_global_main_t vlib_global_main
vlib_node_function_t * function
Node function to call.
#define STATIC_ASSERT_SIZEOF(d, s)
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define VLIB_PROCESS_STACK_MAGIC
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
static void * vec_header(void *v, uword header_bytes)
Find a user vector header.
vlib_node_registration_t * node_registrations
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
static void node_set_elog_name(vlib_main_t *vm, uword node_index)
void vlib_node_rename(vlib_main_t *vm, u32 node_index, char *fmt,...)
#define CLIB_CACHE_LINE_BYTES
struct _vlib_node_registration vlib_node_registration_t
uword vlib_node_add_named_next_with_slot(vlib_main_t *vm, uword node, char *name, uword slot)
void vlib_frame_free(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_frame_t *f)
#define vec_add2_aligned(V, P, N, A)
Add N elements to end of vector V, return pointer to new elements in P.
#define hash_create_vec(elts, key_bytes, value_bytes)
#define vec_free(V)
Free vector's memory (no header).
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
static void node_elog_init(vlib_main_t *vm, uword ni)
format_function_t format_vlib_node_name
clib_march_variant_type_t
static uword null_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
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,...
#define foreach_march_variant
vlib_node_function_t * function
@ CLIB_MEM_PAGE_SZ_DEFAULT
uword vlib_node_get_next(vlib_main_t *vm, uword node_index, uword next_node_index)
#define vec_foreach(var, vec)
Vector iterator.
static vlib_main_t * vlib_get_main_by_index(u32 thread_index)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V,...
static_always_inline clib_mem_page_sz_t clib_mem_get_log2_page_size(void)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static u32 vlib_get_n_threads()
u64 * n_vectors_by_next_node
vnet_interface_output_runtime_t * rt
static void register_node(vlib_main_t *vm, vlib_node_registration_t *r)
#define clib_error(format, args...)
vlib_node_fn_variant_t * variants
__clib_export void * clib_mem_vm_map_stack(uword size, clib_mem_page_sz_t log2_page_sz, char *fmt,...)
static void * clib_mem_alloc_aligned(uword size, uword align)
u32 vlib_register_node(vlib_main_t *vm, vlib_node_registration_t *r)
#define clib_bitmap_foreach(i, ai)
Macro to iterate across set bits in a bitmap.
#define clib_panic(format, args...)
#define hash_create(elts, value_bytes)
static void vlib_next_frame_init(vlib_next_frame_t *nf)
#define vec_insert(V, N, M)
Insert N vector elements starting at element M, initialize new elements to zero (no header,...
#define VLIB_PENDING_FRAME_NO_NEXT_FRAME
vl_api_fib_path_type_t type
vlib_node_function_t * vlib_node_get_preferred_node_fn_variant(vlib_main_t *vm, vlib_node_fn_registration_t *regs)
static uword clib_mem_is_heap_object(void *p)
vl_api_wireguard_peer_flags_t flags