aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/ssvm/ssvm_eth.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-01-05 03:20:25 -0800
committerDave Barach <openvpp@barachs.net>2018-01-09 18:33:08 +0000
commite86a8edd3c14fb41ace2a12efd17bc7772bf623f (patch)
tree480219864cadd743fdb95c21379aeaf88a985e23 /src/vnet/devices/ssvm/ssvm_eth.c
parent4363ad6c96b5641fca1b16c5a6ec22e2364adcfd (diff)
api: refactor vlibmemory
- separate client/server code for both memory and socket apis - separate memory api code from generic vlib api code - move unix_shared_memory_fifo to svm and rename to svm_fifo_t - overall declutter Change-Id: I90cdd98ff74d0787d58825b914b0f1eafcfa4dc2 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/devices/ssvm/ssvm_eth.c')
-rw-r--r--src/vnet/devices/ssvm/ssvm_eth.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/vnet/devices/ssvm/ssvm_eth.c b/src/vnet/devices/ssvm/ssvm_eth.c
index db4fafa9a14..8a0cebe29d4 100644
--- a/src/vnet/devices/ssvm/ssvm_eth.c
+++ b/src/vnet/devices/ssvm/ssvm_eth.c
@@ -38,7 +38,7 @@ ssvm_eth_create (ssvm_eth_main_t * em, u8 * name, int is_master)
ssvm_private_t *intfc;
void *oldheap;
clib_error_t *e;
- unix_shared_memory_queue_t *q;
+ svm_queue_t *q;
ssvm_shared_header_t *sh;
ssvm_eth_queue_elt_t *elts;
u32 *elt_indices;
@@ -71,13 +71,13 @@ ssvm_eth_create (ssvm_eth_main_t * em, u8 * name, int is_master)
sh = intfc->sh;
oldheap = ssvm_push_heap (sh);
- q = unix_shared_memory_queue_init (em->queue_elts, sizeof (u32),
- 0 /* consumer pid not interesting */ ,
- 0 /* signal not sent */ );
+ q = svm_queue_init (em->queue_elts, sizeof (u32),
+ 0 /* consumer pid not interesting */ ,
+ 0 /* signal not sent */ );
sh->opaque[TO_MASTER_Q_INDEX] = (void *) q;
- q = unix_shared_memory_queue_init (em->queue_elts, sizeof (u32),
- 0 /* consumer pid not interesting */ ,
- 0 /* signal not sent */ );
+ q = svm_queue_init (em->queue_elts, sizeof (u32),
+ 0 /* consumer pid not interesting */ ,
+ 0 /* signal not sent */ );
sh->opaque[TO_SLAVE_Q_INDEX] = (void *) q;
/*
@@ -246,7 +246,7 @@ ssvm_eth_interface_tx (vlib_main_t * vm,
vnet_interface_output_runtime_t *rd = (void *) node->runtime_data;
ssvm_private_t *intfc = vec_elt_at_index (em->intfcs, rd->dev_instance);
ssvm_shared_header_t *sh = intfc->sh;
- unix_shared_memory_queue_t *q;
+ svm_queue_t *q;
u32 *from;
u32 n_left;
ssvm_eth_queue_elt_t *elts, *elt, *prev_elt;
@@ -265,9 +265,9 @@ ssvm_eth_interface_tx (vlib_main_t * vm,
u32 *elt_indices;
if (i_am_master)
- q = (unix_shared_memory_queue_t *) sh->opaque[TO_SLAVE_Q_INDEX];
+ q = (svm_queue_t *) sh->opaque[TO_SLAVE_Q_INDEX];
else
- q = (unix_shared_memory_queue_t *) sh->opaque[TO_MASTER_Q_INDEX];
+ q = (svm_queue_t *) sh->opaque[TO_MASTER_Q_INDEX];
queue_lock = (u32 *) q;
@@ -366,7 +366,7 @@ ssvm_eth_interface_tx (vlib_main_t * vm,
while (__sync_lock_test_and_set (queue_lock, 1))
;
- unix_shared_memory_queue_add_raw (q, (u8 *) & elt_index);
+ svm_queue_add_raw (q, (u8 *) & elt_index);
CLIB_MEMORY_BARRIER ();
*queue_lock = 0;