From d6c30d9cae3ec8946c75d9ed87d40c053e2c083a Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Mon, 29 Jan 2018 05:11:24 -0800 Subject: vlmemory/svm: fix client detach from svm region Clients cannot know at svm region detach time if the shm backing files have been recreated (e.g., if vpp restarts) and therefore should not try to unlink them. Otherwise, terminating clients attached to previous instantiations of a re-allocated region end up making the new instance un-mappable by removing its backing file. Change-Id: Idcd0cab776e63fd75b821bc9f0fac58217b9ccbe Signed-off-by: Florin Coras --- src/vlibmemory/memory_client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/vlibmemory/memory_client.c') diff --git a/src/vlibmemory/memory_client.c b/src/vlibmemory/memory_client.c index 9f533019c87..9c8dcaa9d64 100644 --- a/src/vlibmemory/memory_client.c +++ b/src/vlibmemory/memory_client.c @@ -261,7 +261,7 @@ vl_api_memclnt_delete_reply_t_handler (vl_api_memclnt_delete_reply_t * mp) am->vl_input_queue = 0; } -void +int vl_client_disconnect (void) { vl_api_memclnt_delete_t *mp; @@ -302,7 +302,7 @@ vl_client_disconnect (void) am->my_client_index = ~0; am->my_registration = 0; am->shmem_hdr = 0; - break; + return -1; } if (svm_queue_sub (vl_input_queue, (u8 *) & rp, SVM_Q_NOWAIT, 0) < 0) continue; @@ -317,6 +317,7 @@ vl_client_disconnect (void) vl_msg_api_handler ((void *) rp); break; } + return 0; } /** @@ -376,7 +377,7 @@ vl_client_api_map (const char *region_name) void vl_client_api_unmap (void) { - vl_unmap_shmem (); + vl_unmap_shmem_client (); } u8 -- cgit 1.2.3-korg