aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlibmemory
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlibmemory')
-rw-r--r--src/vlibmemory/memory_client.c4
-rw-r--r--src/vlibmemory/memory_shared.c16
2 files changed, 9 insertions, 11 deletions
diff --git a/src/vlibmemory/memory_client.c b/src/vlibmemory/memory_client.c
index 55ef0011cb7..07eb83eaa7c 100644
--- a/src/vlibmemory/memory_client.c
+++ b/src/vlibmemory/memory_client.c
@@ -199,8 +199,8 @@ vl_client_connect (const char *name, int ctx_quota, int input_queue_size)
pthread_mutex_lock (&svm->mutex);
oldheap = svm_push_data_heap (svm);
- vl_input_queue = svm_queue_init (input_queue_size, sizeof (uword),
- getpid (), 0);
+ vl_input_queue = svm_queue_alloc_and_init (input_queue_size, sizeof (uword),
+ getpid ());
svm_pop_heap (oldheap);
pthread_mutex_unlock (&svm->mutex);
diff --git a/src/vlibmemory/memory_shared.c b/src/vlibmemory/memory_shared.c
index c8c071f9a45..084d0b77b62 100644
--- a/src/vlibmemory/memory_shared.c
+++ b/src/vlibmemory/memory_shared.c
@@ -393,13 +393,13 @@ vl_api_default_mem_config (vl_shmem_hdr_t * shmem_hdr)
vlib_input_queue_length = am->vlib_input_queue_length;
shmem_hdr->vl_input_queue =
- svm_queue_init (vlib_input_queue_length, sizeof (uword),
- getpid (), am->vlib_signal);
+ svm_queue_alloc_and_init (vlib_input_queue_length, sizeof (uword),
+ getpid ());
#define _(sz,n) \
do { \
ring_alloc_t _rp; \
- _rp.rp = svm_queue_init ((n), (sz), 0, 0); \
+ _rp.rp = svm_queue_alloc_and_init ((n), (sz), 0); \
_rp.size = (sz); \
_rp.nitems = n; \
_rp.hits = 0; \
@@ -413,7 +413,7 @@ vl_api_default_mem_config (vl_shmem_hdr_t * shmem_hdr)
#define _(sz,n) \
do { \
ring_alloc_t _rp; \
- _rp.rp = svm_queue_init ((n), (sz), 0, 0); \
+ _rp.rp = svm_queue_alloc_and_init ((n), (sz), 0); \
_rp.size = (sz); \
_rp.nitems = n; \
_rp.hits = 0; \
@@ -428,7 +428,6 @@ vl_api_default_mem_config (vl_shmem_hdr_t * shmem_hdr)
void
vl_api_mem_config (vl_shmem_hdr_t * hdr, vl_api_shm_elem_config_t * config)
{
- api_main_t *am = &api_main;
vl_api_shm_elem_config_t *c;
ring_alloc_t *rp;
u32 size;
@@ -444,9 +443,8 @@ vl_api_mem_config (vl_shmem_hdr_t * hdr, vl_api_shm_elem_config_t * config)
switch (c->type)
{
case VL_API_QUEUE:
- hdr->vl_input_queue = svm_queue_init (c->count,
- c->size,
- getpid (), am->vlib_signal);
+ hdr->vl_input_queue = svm_queue_alloc_and_init (c->count, c->size,
+ getpid ());
continue;
case VL_API_VLIB_RING:
vec_add2 (hdr->vl_rings, rp, 1);
@@ -460,7 +458,7 @@ vl_api_mem_config (vl_shmem_hdr_t * hdr, vl_api_shm_elem_config_t * config)
}
size = sizeof (ring_alloc_t) + c->size;
- rp->rp = svm_queue_init (c->count, size, 0, 0);
+ rp->rp = svm_queue_alloc_and_init (c->count, size, 0);
rp->size = size;
rp->nitems = c->count;
rp->hits = 0;