- b0 = vlib_get_buffer (vm, bi0);
- /* Initialize the buffer */
-
- 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_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] =
- (ep->tx_sw_if_index == nsm->sw_if_index0) ? nsm->sw_if_index1 :
- nsm->sw_if_index0;
- next0 = (ep->tx_sw_if_index == nsm->sw_if_index0) ?
- nsm->output_next_index0 : nsm->output_next_index1;