X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlibmemory%2Fmemory_shared.c;h=0604b0a1cdfcfb3178fd9d248afec2e5ffa6820f;hb=b7b929931a07fbb27b43d5cd105f366c3e29807e;hp=c8c071f9a45a0bf377b9e5db1987a224f5d42806;hpb=d6c30d9cae3ec8946c75d9ed87d40c053e2c083a;p=vpp.git diff --git a/src/vlibmemory/memory_shared.c b/src/vlibmemory/memory_shared.c index c8c071f9a45..0604b0a1cdf 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; @@ -520,7 +518,7 @@ vl_map_shmem (const char *region_name, int is_vlib) struct timespec ts, tsrem; char *vpe_api_region_suffix = "-vpe-api"; - memset (a, 0, sizeof (*a)); + clib_memset (a, 0, sizeof (*a)); if (strstr (region_name, vpe_api_region_suffix)) { @@ -592,7 +590,7 @@ vl_map_shmem (const char *region_name, int is_vlib) ts = tsrem; } /* Mutex buggered, "fix" it */ - memset (&q->mutex, 0, sizeof (q->mutex)); + clib_memset (&q->mutex, 0, sizeof (q->mutex)); clib_warning ("forcibly release main input queue mutex"); mutex_ok: