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, 80 uword n_rx_packets = 0;
110 while (n_left_to_next > 0 && ep->
tx_time <= now)
117 _vec_len (my_buffer_cache) = n;
134 NSIM_TX_ERROR_DROPPED, drops);
137 return n_rx_packets + drops;
142 bi0 = my_buffer_cache[_vec_len (my_buffer_cache) - 1];
143 _vec_len (my_buffer_cache) -= 1;
158 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
168 to_next, n_left_to_next,
203 #ifndef CLIB_MARCH_VARIANT 207 .name =
"nsim-wheel",
210 .state = VLIB_NODE_STATE_DISABLED,
static f64 vlib_time_now(vlib_main_t *vm)
#define VLIB_NODE_FN(node)
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
#define clib_memcpy(a, b, c)
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
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.