18 #define foreach_punt_error \ 19 _(DISPATCHED, "dispatched") \ 20 _(NO_REASON, "No such punt reason") \ 21 _(NO_REG, "No registrations") \ 22 _(REP_FAIL, "Replication Failure") 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;
117 *to_next, *n_left_to_next, ci0, next0);
123 *n_dispatched = *n_dispatched + n_cloned0;
143 u32 * n_left_to_next,
u32 ** to_next,
u32 * n_dispatched)
169 *n_dispatched = *n_dispatched + 1;
183 next_index, n_left_to_next, to_next,
203 u32 n_left_from, *from, *to_next, next_index, thread_index;
209 n_left_from = frame->n_vectors;
210 next_index = node->cached_next_index;
214 while (n_left_from > 0)
220 while (n_left_from > 4 && n_left_to_next > 2)
235 bi0 = to_next[0] = from[0];
236 bi1 = to_next[1] = from[1];
241 &next_index, &n_left_to_next,
242 &to_next, &n_dispatched);
244 &next_index, &n_left_to_next,
245 &to_next, &n_dispatched);
251 to_next, n_left_to_next,
252 bi0, bi1, next0, next1);
254 while (n_left_from > 0 && n_left_to_next > 0)
259 bi0 = to_next[0] = from[0];
264 &next_index, &n_left_to_next,
265 &to_next, &n_dispatched);
271 to_next, n_left_to_next,
278 PUNT_ERROR_DISPATCHED, n_dispatched);
280 return frame->n_vectors;
285 .name =
"punt-dispatch",
286 .vector_size =
sizeof (
u32),
298 #ifndef CLIB_MARCH_VARIANT #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.
static char * punt_error_strings[]
#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.
static u8 * format_punt_trace(u8 *s, va_list *args)
#define VLIB_INIT_FUNCTION(x)
struct punt_trace_t_ punt_trace_t
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
u32 ** punt_clones
Per-thread clone vectors.
#define foreach_punt_error
vlib_error_t error
Error code for buffers to be enqueued to error handler.
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)
vlib_punt_reason_t pt_reason
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)
#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 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.
clib_error_t * punt_node_init(vlib_main_t *vm)
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()
#define CLIB_CACHE_LINE_BYTES
enum vlib_punt_reason_t_ vlib_punt_reason_t
The 'syatem' defined punt reasons.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vlib_node_registration_t punt_dispatch_node
(constructor) VLIB_REGISTER_NODE (punt_dispatch_node)