u32 trace_cnt __attribute__((unused)) = vlib_get_trace_count (vm, node);
volatile u32 * lock;
u32 * elt_indices;
+ uword n_trace = vlib_get_trace_count (vm, node);
/* Either side down? buh-bye... */
- if ((u64)(sh->opaque [MASTER_ADMIN_STATE_INDEX]) == 0 ||
- (u64)(sh->opaque [SLAVE_ADMIN_STATE_INDEX]) == 0)
+ if (pointer_to_uword(sh->opaque [MASTER_ADMIN_STATE_INDEX]) == 0 ||
+ pointer_to_uword(sh->opaque [SLAVE_ADMIN_STATE_INDEX]) == 0)
return 0;
if (intfc->i_am_master)
b0->total_length_not_including_first_buffer =
elt->total_length_not_including_first_buffer;
- memcpy (b0->data + b0->current_data, elt->data,
+ clib_memcpy (b0->data + b0->current_data, elt->data,
b0->current_length);
if (PREDICT_FALSE(prev != 0))
*/
VLIB_BUFFER_TRACE_TRAJECTORY_INIT(b0);
- /* $$$$ tracing */
+ if (PREDICT_FALSE(n_trace > 0))
+ {
+ ssvm_eth_input_trace_t *tr;
+
+ vlib_trace_buffer (vm, node, next0,
+ b0, /* follow_chain */ 1);
+ vlib_set_trace_count (vm, node, --n_trace);
+
+ tr = vlib_add_trace (vm, node, b0, sizeof (*tr));
+
+ tr->next_index = next0;
+ tr->sw_if_index = intfc->vlib_hw_if_index;
+ }
vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
to_next, n_left_to_next,
ASSERT(vec_len(intfc->rx_queue) > 0);
- n_available = (u32)(u64)(sh->opaque[CHUNK_POOL_NFREE]);
+ n_available = (u32)pointer_to_uword(sh->opaque[CHUNK_POOL_NFREE]);
elt_indices = (u32 *)(sh->opaque[CHUNK_POOL_FREELIST_INDEX]);
- memcpy (&elt_indices[n_available], intfc->rx_queue,
+ clib_memcpy (&elt_indices[n_available], intfc->rx_queue,
vec_len (intfc->rx_queue) * sizeof (u32));
n_available += vec_len (intfc->rx_queue);
- sh->opaque[CHUNK_POOL_NFREE] = (void *) (u64) n_available;
+ sh->opaque[CHUNK_POOL_NFREE] = uword_to_pointer(n_available, void* );
ssvm_unlock (sh);
},
};
+VLIB_NODE_FUNCTION_MULTIARCH (ssvm_eth_input_node, ssvm_eth_input_node_fn)
+