diff options
author | Dave Barach <dave@barachs.net> | 2017-10-17 11:48:29 -0400 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2017-10-18 11:47:29 +0000 |
commit | cf5e848d69a4f14464c1e2d56896bc9f7e586951 (patch) | |
tree | cc74c2ba457b03a7dc75fabb1b1304e3e47342f0 /src/vlibmemory/memory_vlib.c | |
parent | 965fec9089de96c2afbffc3dec3360d043e3eead (diff) |
CSIT-844: fix binary api rx pthread heap push/pop
We need to push/pop the rx pthread's heap without affecting other
thread(s).
Search clib_per_cpu_mheaps, locate an unused slot. Duplicate the main
thread heap pointer in that slot, and set __os_thread_index
appropriately.
Miscellaneous cleanups. Print exec_inband results as a vector, instead
of as a format string. Don't bail out of vpp_api_test with results
pending, e.g. at the end of a vpp_api_test script. Even though vpp
will eventuallly garbage-collect them, We don't want to leave
allocated reply messages lurking in the api message allocation
rings...
Change-Id: I0e8a25d1ff0d3700249dc330d079db16c2fcbc55
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlibmemory/memory_vlib.c')
-rw-r--r-- | src/vlibmemory/memory_vlib.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vlibmemory/memory_vlib.c b/src/vlibmemory/memory_vlib.c index 65d04dc266f..338fda45241 100644 --- a/src/vlibmemory/memory_vlib.c +++ b/src/vlibmemory/memory_vlib.c @@ -188,7 +188,6 @@ vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t * mp) int rv = 0; void *oldheap; api_main_t *am = &api_main; - u8 *serialized_message_table_in_shmem; /* * This is tortured. Maintain a vlib-address-space private @@ -237,7 +236,9 @@ vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t * mp) regp->name = format (0, "%s", mp->name); vec_add1 (regp->name, 0); - serialized_message_table_in_shmem = vl_api_serialize_message_table (am, 0); + if (am->serialized_message_table_in_shmem == 0) + am->serialized_message_table_in_shmem = + vl_api_serialize_message_table (am, 0); pthread_mutex_unlock (&svm->mutex); svm_pop_heap (oldheap); @@ -250,7 +251,8 @@ vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t * mp) am->shmem_hdr->application_restarts); rp->context = mp->context; rp->response = ntohl (rv); - rp->message_table = pointer_to_uword (serialized_message_table_in_shmem); + rp->message_table = + pointer_to_uword (am->serialized_message_table_in_shmem); vl_msg_api_send_shmem (q, (u8 *) & rp); } |