intfc->ssvm_size = em->segment_size;
intfc->i_am_master = 1;
intfc->name = name;
+ intfc->my_pid = getpid();
if (is_master == 0)
{
rv = ssvm_slave_init (intfc, 20 /* timeout in seconds */);
sh->opaque [CHUNK_POOL_INDEX] = (void *) elts;
sh->opaque [CHUNK_POOL_FREELIST_INDEX] = (void *) elt_indices;
- sh->opaque [CHUNK_POOL_NFREE] = (void *) em->nbuffers;
+ sh->opaque [CHUNK_POOL_NFREE] = (void *)(uword) em->nbuffers;
ssvm_pop_heap (oldheap);
n_present_in_cache = vec_len (em->chunk_cache);
/* admin / link up/down check */
- if ((u64)(sh->opaque [MASTER_ADMIN_STATE_INDEX]) == 0 ||
- (u64)(sh->opaque [SLAVE_ADMIN_STATE_INDEX]) == 0)
+ if (sh->opaque [MASTER_ADMIN_STATE_INDEX] == 0 ||
+ sh->opaque [SLAVE_ADMIN_STATE_INDEX] == 0)
{
interface_down = 1;
goto out;
elts = (ssvm_eth_queue_elt_t *) (sh->opaque [CHUNK_POOL_INDEX]);
elt_indices = (u32 *) (sh->opaque [CHUNK_POOL_FREELIST_INDEX]);
- n_available = (u32) (u64) (sh->opaque [CHUNK_POOL_NFREE]);
+ n_available = (u32) pointer_to_uword(sh->opaque [CHUNK_POOL_NFREE]);
if (n_present_in_cache < n_left*2)
{
if (PREDICT_TRUE(n_allocated > 0))
{
- memcpy (&em->chunk_cache[n_present_in_cache],
+ clib_memcpy (&em->chunk_cache[n_present_in_cache],
&elt_indices[n_available - n_allocated],
sizeof(u32) * n_allocated);
}
n_present_in_cache += n_allocated;
n_available -= n_allocated;
- sh->opaque [CHUNK_POOL_NFREE] = (void *) (u64) n_available;
+ sh->opaque [CHUNK_POOL_NFREE] = uword_to_pointer(n_available, void*);
_vec_len (em->chunk_cache) = n_present_in_cache;
}
elt->owner = !i_am_master;
elt->tag = 1;
- memcpy (elt->data, b0->data + b0->current_data, b0->current_length);
+ clib_memcpy (elt->data, b0->data + b0->current_data, b0->current_length);
if (PREDICT_FALSE (prev_elt != 0))
prev_elt->next_index = elt - elts;
.rx_redirect_to_node = ssvm_eth_set_interface_next_node,
.no_flatten_output_chains = 1,
};
+
+VLIB_DEVICE_TX_FUNCTION_MULTIARCH (ssvm_eth_device_class,
+ ssvm_eth_interface_tx)