18 #define foreach_punt_error \ 19 _(DISPATCHED, "dispatched") \ 20 _(NO_REASON, "No such punt reason") \ 21 _(NO_REG, "No registrations") \ 22 _(REP_FAIL, "Replication Faliure") 26 #define _(v,s) PUNT_ERROR_##v, 33 #define _(v,s) [PUNT_ERROR_##v] = s, 52 #ifndef CLIB_MARCH_VARIANT 78 u32 * n_left_to_next,
u32 ** to_next,
u32 * n_dispatched)
81 u16 n_clones0, n_cloned0, clone0;
96 for (clone0 = 1; clone0 < n_cloned0; clone0++)
102 *n_left_to_next -= 1;
121 *to_next, *n_left_to_next, ci0, next0);
127 *n_dispatched = *n_dispatched + n_clones0;
142 u32 * n_left_to_next,
u32 ** to_next,
u32 * n_dispatched)
168 *n_dispatched = *n_dispatched + 1;
182 next_index, n_left_to_next, to_next,
202 u32 n_left_from, *from, *to_next, next_index, thread_index;
208 n_left_from = frame->n_vectors;
209 next_index = node->cached_next_index;
213 while (n_left_from > 0)
219 while (n_left_from > 4 && n_left_to_next > 2)
234 bi0 = to_next[0] = from[0];
235 bi1 = to_next[1] = from[1];
240 &next_index, &n_left_to_next,
241 &to_next, &n_dispatched);
243 &next_index, &n_left_to_next,
244 &to_next, &n_dispatched);
250 to_next, n_left_to_next,
251 bi0, bi1, next0, next1);
253 while (n_left_from > 0 && n_left_to_next > 0)
258 bi0 = to_next[0] = from[0];
263 &next_index, &n_left_to_next,
264 &to_next, &n_dispatched);
270 to_next, n_left_to_next,
277 PUNT_ERROR_DISPATCHED, n_dispatched);
279 return frame->n_vectors;
284 .name =
"punt-dispatch",
285 .vector_size =
sizeof (
u32),
297 #ifndef CLIB_MARCH_VARIANT u32 ** punt_clones
Per-thread clone vectors.
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
enum punt_next_t_ punt_next_t
#define VLIB_NODE_FN(node)
vlib_error_t * errors
Vector of errors for this node.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
u8 * format_vlib_punt_reason(u8 *s, va_list *args)
Format a punt reason.
#define VLIB_INIT_FUNCTION(x)
static u32 punt_dispatch_one(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_combined_counter_main_t *cm, u32 thread_index, u32 bi0, u32 *next_index, u32 *n_left_to_next, u32 **to_next, u32 *n_dispatched)
static u8 * format_punt_trace(u8 *s, va_list *args)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
struct punt_trace_t_ punt_trace_t
vlib_error_t error
Error code for buffers to be enqueued to error handler.
clib_error_t * punt_node_init(vlib_main_t *vm)
vlib_punt_reason_t pt_reason
#define foreach_punt_error
#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).
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define VLIB_REGISTER_NODE(x,...)
static void vlib_buffer_copy_trace_flag(vlib_main_t *vm, vlib_buffer_t *b, u32 bi_target)
static u16 vlib_buffer_clone(vlib_main_t *vm, u32 src_buffer, u32 *buffers, u16 n_buffers, u16 head_end_offset)
Create multiple clones of buffer and store them in the supplied array.
static_always_inline uword vlib_get_thread_index(void)
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.
static char * punt_error_strings[]
enum punt_error_t_ punt_error_t
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_combined_counter_main_t punt_counters
Counters per punt-reason.
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
A collection of combined counters.
u16 ** punt_dp_db
A DB used in the DP per-reason to dispatch packets to the requested nodes.
static u32 vlib_num_workers()
vlib_node_registration_t punt_dispatch_node
(constructor) VLIB_REGISTER_NODE (punt_dispatch_node)
#define CLIB_CACHE_LINE_BYTES
enum vlib_punt_reason_t_ vlib_punt_reason_t
The 'syatem' defined punt reasons.
static u32 punt_replicate(vlib_main_t *vm, vlib_node_runtime_t *node, u32 thread_index, vlib_buffer_t *b0, u32 bi0, vlib_punt_reason_t pr0, u32 *next_index, u32 *n_left_to_next, u32 **to_next, u32 *n_dispatched)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.