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;
109 while (n_left_to_next > 0 && ep->
tx_time <= now)
116 _vec_len (my_buffer_cache) = n;
133 NSIM_TX_ERROR_DROPPED, drops);
136 return n_rx_packets + drops;
141 bi0 = my_buffer_cache[_vec_len (my_buffer_cache) - 1];
142 _vec_len (my_buffer_cache) -= 1;
168 b0->
flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
178 to_next, n_left_to_next,
213 #ifndef CLIB_MARCH_VARIANT 217 .name =
"nsim-wheel",
220 .state = VLIB_NODE_STATE_DISABLED,
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_get_trace_count(vlib_main_t *vm, vlib_node_runtime_t *rt)
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
#define clib_memcpy_fast(a, b, c)
static f64 vlib_time_now(vlib_main_t *vm)
u16 current_length
Nbytes between current data and the end of this buffer.
#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)
u8 data[WHEEL_ENTRY_DATA_SIZE]
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)
VLIB buffer representation.
u32 ** buffer_indices_by_thread
#define VLIB_NODE_FLAG_TRACE
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.