|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
36 used_elt_bmp[
i] |= match_bmp[
i];
43 else if (
n_free >= n_extracted)
66 return n_left - n_extracted;
69 void __clib_section (
".vlib_buffer_enqueue_to_next_fn")
135 void __clib_section (
".vlib_buffer_enqueue_to_single_next_fn")
140 u32 *to_next, n_left_to_next, n_enq;
147 n_left_to_next -=
count;
152 n_enq = n_left_to_next;
155 n_left_to_next -= n_enq;
176 u64 nelts, tail, new_tail;
183 tail = __atomic_load_n (&fq->
tail, __ATOMIC_ACQUIRE);
186 if (new_tail >= fq->
head + nelts)
192 while (new_tail >= fq->
head + nelts)
196 if (!__atomic_compare_exchange_n (&fq->
tail, &tail, new_tail, 0 ,
197 __ATOMIC_RELAXED, __ATOMIC_RELAXED))
200 return fq->
elts + (new_tail & (nelts - 1));
207 u32 *buffer_indices,
u16 *thread_indices,
208 u32 n_packets,
int drop_on_congestion)
224 buffer_indices,
mask, n_packets);
231 __atomic_store_n (&hf->
valid, 1, __ATOMIC_RELEASE);
255 if (drop_on_congestion && n_drop)
258 return n_packets - n_drop;
261 u32 __clib_section (
".vlib_buffer_enqueue_to_thread_fn")
264 u32 *buffer_indices,
u16 *thread_indices,
u32 n_packets,
265 int drop_on_congestion)
287 thread_indices, n_packets,
295 u32 __clib_section (
".vlib_frame_queue_dequeue_fn")
320 fqt = &fqm->frame_queue_traces[thread_id];
334 fqh = &fqm->frame_queue_histogram[thread_id];
338 for (elix = 0; elix < fqt->
nelts; elix++)
356 if (!__atomic_load_n (&
elt->valid, __ATOMIC_ACQUIRE))
370 if (
elt->maybe_trace)
390 elt->n_vectors -= n_copy;
391 elt->offset += n_copy;
398 __atomic_store_n (&fq->
head, fq->
head + 1, __ATOMIC_RELEASE);
418 #ifndef CLIB_MARCH_VARIANT
static_always_inline void clib_mask_compare_u16(u16 v, u16 *a, u64 *mask, u32 n_elts)
Compare 16-bit elemments with provied value and return bitmap.
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
#define count_trailing_zeros(x)
vlib_buffer_enqueue_to_thread_fn_t * buffer_enqueue_to_thread_fn
nat44_ei_hairpin_src_next_t next_index
vlib_buffer_copy_indices(to, tmp, n_free)
static void vlib_worker_thread_barrier_check(void)
vlib_main_t vlib_node_runtime_t * node
#define CLIB_MULTIARCH_FN(fn)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static vlib_frame_queue_elt_t * vlib_get_frame_queue_elt(vlib_frame_queue_main_t *fqm, u32 index, int dont_wait)
vlib_frame_t * vlib_get_frame_to_node(vlib_main_t *vm, u32 to_node_index)
volatile uword check_frame_queues
vlib_buffer_enqueue_to_next_fn_t * buffer_enqueue_to_next_fn
vlib_buffer_enqueue_to_single_next_fn_t * buffer_enqueue_to_single_next_fn
#define STRUCT_OFFSET_OF(t, f)
void vlib_put_frame_to_node(vlib_main_t *vm, u32 to_node_index, vlib_frame_t *f)
static_always_inline u32 enqueue_one(vlib_main_t *vm, vlib_node_runtime_t *node, u64 *used_elt_bmp, u16 next_index, u32 *buffers, u16 *nexts, u32 n_buffers, u32 n_left, u32 *tmp)
vlib_buffer_func_main_t vlib_buffer_func_main
u32 buffer_index[VLIB_FRAME_SIZE]
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define VLIB_NODE_FLAG_TRACE
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vlib_global_main_t vlib_global_main
#define static_always_inline
CLIB_MARCH_FN_REGISTRATION(vlib_buffer_enqueue_to_next_fn)
static_always_inline u32 vlib_buffer_enqueue_to_thread_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_queue_main_t *fqm, u32 *buffer_indices, u16 *thread_indices, u32 n_packets, int drop_on_congestion)
vlib_frame_queue_t ** vlib_frame_queues
static_always_inline u32 clib_compress_u32(u32 *dst, u32 *src, u64 *mask, u32 n_elts)
Compress array of 32-bit elemments into destination array based on mask.
i32 n_vectors[FRAME_QUEUE_MAX_NELTS]
static clib_error_t * vlib_buffer_funcs_init(vlib_main_t *vm)
vlib_put_next_frame(vm, node, next_index, 0)
#define VLIB_INIT_FUNCTION(x)
static vlib_main_t * vlib_get_main_by_index(u32 thread_index)
u64 count[FRAME_QUEUE_MAX_NELTS]
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_frame_queue_elt_t * elts
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
u16 nexts[VLIB_FRAME_SIZE]
vlib_frame_queue_dequeue_fn_t * frame_queue_dequeue_fn
#define CLIB_MARCH_FN_POINTER(fn)
static vlib_thread_main_t * vlib_get_thread_main()
vlib_main_t ** vlib_mains
#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).
vlib_frame_queue_main_t * frame_queue_mains
u64 used_elts[VLIB_FRAME_SIZE/64]
vlib_frame_t * vlib_get_next_frame_internal(vlib_main_t *vm, vlib_node_runtime_t *node, u32 next_index, u32 allocate_new_next_frame)