X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnsim%2Fnsim_input.c;h=2e328a58bf357d49048ac97465e09f73eef24d5c;hb=10c5ff143;hp=38c3891fd95a6e096ee4f687e61bfbe6e272ae50;hpb=edb3a9bca826ddaaf5f3c7ee83f9e474bd2a2e11;p=vpp.git diff --git a/src/plugins/nsim/nsim_input.c b/src/plugins/nsim/nsim_input.c index 38c3891fd95..2e328a58bf3 100644 --- a/src/plugins/nsim/nsim_input.c +++ b/src/plugins/nsim/nsim_input.c @@ -76,6 +76,7 @@ nsim_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, u32 my_thread_index = vm->thread_index; u32 *my_buffer_cache = nsm->buffer_indices_by_thread[my_thread_index]; nsim_wheel_t *wp = nsm->wheel_by_thread[my_thread_index]; + u32 n_trace = vlib_get_trace_count (vm, node); f64 now = vlib_time_now (vm); uword n_rx_packets = 0; vlib_buffer_t *b0; @@ -153,8 +154,20 @@ nsim_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node, b0->current_data = 0; b0->current_length = ep->current_length; + VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0); + + if (PREDICT_FALSE (n_trace)) + { + nsim_tx_trace_t *t0; + vlib_trace_buffer (vm, node, next_index, b0, + 0 /* follow_chain */ ); + t0 = vlib_add_trace (vm, node, b0, sizeof (*t0)); + t0->expired = ep->tx_time; + t0->tx_sw_if_index = ep->tx_sw_if_index; + } + /* Copy data from the ring */ - clib_memcpy (b0->data, ep->data, ep->current_length); + clib_memcpy_fast (b0->data, ep->data, ep->current_length); b0->flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID; vnet_buffer (b0)->sw_if_index[VLIB_TX] = ep->tx_sw_if_index; vnet_buffer (b0)->sw_if_index[VLIB_RX] =