30 #ifndef CLIB_MARCH_VARIANT 39 s =
format (s,
"NSIM: tx at %.6f sw_if_index %d",
45 #define foreach_nsim_tx_error \ 46 _(TX, "Packets transmitted") \ 47 _(DROPPED, "No buffer drops") 51 #define _(sym,str) NSIM_TX_ERROR_##sym, 57 #ifndef CLIB_MARCH_VARIANT 59 #define _(sym,string) string, 81 uword n_rx_packets = 0;
111 while (n_left_to_next > 0 && ep->
tx_time <= now)
118 _vec_len (my_buffer_cache) = n;
135 NSIM_TX_ERROR_DROPPED, drops);
138 return n_rx_packets + drops;
143 bi0 = my_buffer_cache[_vec_len (my_buffer_cache) - 1];
144 _vec_len (my_buffer_cache) -= 1;
171 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
181 to_next, n_left_to_next,
216 #ifndef CLIB_MARCH_VARIANT 220 .name =
"nsim-wheel",
223 .state = VLIB_NODE_STATE_DISABLED,
static u32 vlib_get_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt)
#define clib_memcpy_fast(a, b, c)
static f64 vlib_time_now(vlib_main_t *vm)
#define VLIB_NODE_FN(node)
static void vlib_trace_buffer(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, vlib_buffer_t *b, int follow_chain)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
u16 current_length
Nbytes between current data and the end of this buffer.
u8 data[WHEEL_ENTRY_DATA_SIZE]
#define VLIB_BUFFER_DEFAULT_FREE_LIST_INDEX
u32 node_index
Node index.
#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,...)
nsim_wheel_entry_t * entries
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.
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
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)
#define VLIB_BUFFER_TRACE_TRAJECTORY_INIT(b)
u32 ** buffer_indices_by_thread
static void vlib_buffer_init_for_free_list(vlib_buffer_t *dst, vlib_buffer_free_list_t *fl)
static vlib_buffer_free_list_t * vlib_buffer_get_free_list(vlib_main_t *vm, vlib_buffer_free_list_index_t free_list_index)
#define VLIB_NODE_FLAG_TRACE
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 u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.