30 #ifndef CLIB_MARCH_VARIANT 41 s =
format (s,
"NSIM: ring drop");
43 s =
format (s,
"NSIM: tx time %.6f sw_if_index %d",
52 #define foreach_nsim_error \ 53 _(BUFFERED, "Packets buffered") \ 54 _(DROPPED, "Packets dropped due to lack of space") 58 #define _(sym,str) NSIM_ERROR_##sym, 64 #ifndef CLIB_MARCH_VARIANT 66 #define _(sym,string) string, 83 u32 n_left_from, *from;
91 u32 no_error = node->
errors[NSIM_ERROR_BUFFERED];
92 u32 no_buffer_error = node->
errors[NSIM_ERROR_DROPPED];
105 while (n_left_from > 0)
107 b[0]->
error = no_error;
129 b[0]->
error = no_buffer_error;
135 if (b[0]->
flags & VLIB_BUFFER_IS_TRACED)
162 #ifndef CLIB_MARCH_VARIANT 166 .vector_size =
sizeof (
u32),
#define WHEEL_ENTRY_DATA_SIZE
static f64 vlib_time_now(vlib_main_t *vm)
#define VLIB_NODE_FN(node)
vlib_node_registration_t nsim_node
(constructor) VLIB_REGISTER_NODE (nsim_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.
static char * nsim_error_strings[]
#define foreach_nsim_error
u8 data[WHEEL_ENTRY_DATA_SIZE]
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define VLIB_REGISTER_NODE(x,...)
static_always_inline void vlib_buffer_enqueue_to_next(vlib_main_t *vm, vlib_node_runtime_t *node, u32 *buffers, u16 *nexts, uword count)
nsim_wheel_entry_t * entries
#define clib_memcpy(a, b, c)
static uword nsim_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_trace)
nsim_wheel_t ** wheel_by_thread
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
struct _vlib_node_registration vlib_node_registration_t
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static_always_inline void vlib_get_buffers(vlib_main_t *vm, u32 *bi, vlib_buffer_t **b, int count)
Translate array of buffer indices into buffer pointers.
#define VLIB_NODE_FLAG_TRACE
static u8 * format_nsim_trace(u8 *s, va_list *args)