summaryrefslogtreecommitdiffstats
path: root/src/vlibmemory
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-11-30 12:11:20 -0800
committerDave Barach <openvpp@barachs.net>2018-12-03 16:23:55 +0000
commit940f78fcf4e276cadef3f163d0493b74fc49755c (patch)
treec508300f67e1da4bb03bcd58bf2e1ff5eb62c087 /src/vlibmemory
parentadc74d7b3da5a48cd346ce14694415e7c5c307bb (diff)
vcl: handle worker process exit
Change-Id: Ife05d25fd736ae3064f01e974e5aecc5b48de924 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vlibmemory')
-rw-r--r--src/vlibmemory/memory_client.c21
-rw-r--r--src/vlibmemory/memory_client.h1
2 files changed, 15 insertions, 7 deletions
diff --git a/src/vlibmemory/memory_client.c b/src/vlibmemory/memory_client.c
index 239cbfee36f..79344a6af68 100644
--- a/src/vlibmemory/memory_client.c
+++ b/src/vlibmemory/memory_client.c
@@ -270,22 +270,17 @@ vl_api_memclnt_delete_reply_t_handler (vl_api_memclnt_delete_reply_t * mp)
am->vl_input_queue = 0;
}
-int
-vl_client_disconnect (void)
+void
+vl_client_send_disconnect (void)
{
vl_api_memclnt_delete_t *mp;
- vl_api_memclnt_delete_reply_t *rp;
- svm_queue_t *vl_input_queue;
vl_shmem_hdr_t *shmem_hdr;
- time_t begin;
api_main_t *am = &api_main;
ASSERT (am->vlib_rp);
shmem_hdr = am->shmem_hdr;
ASSERT (shmem_hdr && shmem_hdr->vl_input_queue);
- vl_input_queue = am->vl_input_queue;
-
mp = vl_msg_api_alloc (sizeof (vl_api_memclnt_delete_t));
clib_memset (mp, 0, sizeof (*mp));
mp->_vl_msg_id = ntohs (VL_API_MEMCLNT_DELETE);
@@ -293,6 +288,18 @@ vl_client_disconnect (void)
mp->handle = (uword) am->my_registration;
vl_msg_api_send_shmem (shmem_hdr->vl_input_queue, (u8 *) & mp);
+}
+
+int
+vl_client_disconnect (void)
+{
+ vl_api_memclnt_delete_reply_t *rp;
+ svm_queue_t *vl_input_queue;
+ api_main_t *am = &api_main;
+ time_t begin;
+
+ vl_input_queue = am->vl_input_queue;
+ vl_client_send_disconnect ();
/*
* Have to be careful here, in case the client is disconnecting
diff --git a/src/vlibmemory/memory_client.h b/src/vlibmemory/memory_client.h
index f2898f30b23..eb3431a51e6 100644
--- a/src/vlibmemory/memory_client.h
+++ b/src/vlibmemory/memory_client.h
@@ -21,6 +21,7 @@
#include <vlibmemory/memory_shared.h>
int vl_client_connect (const char *name, int ctx_quota, int input_queue_size);
+void vl_client_send_disconnect (void);
int vl_client_disconnect (void);
int vl_client_api_map (const char *region_name);
void vl_client_api_unmap (void);