summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/segment_manager.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/session/segment_manager.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/session/segment_manager.c')
-rw-r--r--src/vnet/session/segment_manager.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c
index 9e6a1b55cbb..dc3e4c9e648 100644
--- a/src/vnet/session/segment_manager.c
+++ b/src/vnet/session/segment_manager.c
@@ -530,12 +530,12 @@ segment_manager_dealloc_fifos (u32 svm_segment_index, svm_fifo_t * rx_fifo,
/**
* Allocates shm queue in the first segment
*/
-unix_shared_memory_queue_t *
+svm_queue_t *
segment_manager_alloc_queue (segment_manager_t * sm, u32 queue_size)
{
ssvm_shared_header_t *sh;
svm_fifo_segment_private_t *segment;
- unix_shared_memory_queue_t *q;
+ svm_queue_t *q;
void *oldheap;
ASSERT (sm->segment_indices != 0);
@@ -544,10 +544,9 @@ segment_manager_alloc_queue (segment_manager_t * sm, u32 queue_size)
sh = segment->ssvm.sh;
oldheap = ssvm_push_heap (sh);
- q = unix_shared_memory_queue_init (queue_size,
- sizeof (session_fifo_event_t),
- 0 /* consumer pid */ ,
- 0 /* signal when queue non-empty */ );
+ q = svm_queue_init (queue_size,
+ sizeof (session_fifo_event_t), 0 /* consumer pid */ ,
+ 0 /* signal when queue non-empty */ );
ssvm_pop_heap (oldheap);
return q;
}
@@ -556,8 +555,7 @@ segment_manager_alloc_queue (segment_manager_t * sm, u32 queue_size)
* Frees shm queue allocated in the first segment
*/
void
-segment_manager_dealloc_queue (segment_manager_t * sm,
- unix_shared_memory_queue_t * q)
+segment_manager_dealloc_queue (segment_manager_t * sm, svm_queue_t * q)
{
ssvm_shared_header_t *sh;
svm_fifo_segment_private_t *segment;
@@ -569,7 +567,7 @@ segment_manager_dealloc_queue (segment_manager_t * sm,
sh = segment->ssvm.sh;
oldheap = ssvm_push_heap (sh);
- unix_shared_memory_queue_free (q);
+ svm_queue_free (q);
ssvm_pop_heap (oldheap);
}