From 38ca6e62d725ab81d304fb1af4ec8aae2fd78ba6 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Fri, 17 Jul 2020 17:16:34 -0400 Subject: api: call api reaper callbacks for socket clients Add a callback to clear the per-client packet trace buffer cache. Save the packet trace dump pg setup script. Type: improvement Signed-off-by: Dave Barach Change-Id: I252be911b5f937ece0da5dca152263ece3d52963 --- src/vlibmemory/memory_api.c | 8 +++----- src/vlibmemory/socket_api.c | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/vlibmemory') diff --git a/src/vlibmemory/memory_api.c b/src/vlibmemory/memory_api.c index b5f3fae232e..18a87b30044 100644 --- a/src/vlibmemory/memory_api.c +++ b/src/vlibmemory/memory_api.c @@ -231,7 +231,7 @@ vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t * mp) vl_msg_api_send_shmem (q, (u8 *) & rp); } -int +void vl_api_call_reaper_functions (u32 client_index) { clib_error_t *error = 0; @@ -245,7 +245,6 @@ vl_api_call_reaper_functions (u32 client_index) clib_error_report (error); i = i->next_init_function; } - return 0; } /* @@ -263,8 +262,7 @@ vl_api_memclnt_delete_t_handler (vl_api_memclnt_delete_t * mp) handle = mp->index; - if (vl_api_call_reaper_functions (handle)) - return; + vl_api_call_reaper_functions (handle); epoch = vl_msg_api_handle_get_epoch (handle); client_index = vl_msg_api_handle_get_index (handle); @@ -616,7 +614,7 @@ vl_mem_api_dead_client_scan (api_main_t * am, vl_shmem_hdr_t * shm, f64 now) handle = vl_msg_api_handle_from_index_and_epoch (dead_indices[i], shm->application_restarts); - (void) vl_api_call_reaper_functions (handle); + vl_api_call_reaper_functions (handle); } } diff --git a/src/vlibmemory/socket_api.c b/src/vlibmemory/socket_api.c index 6238746525a..566305ff7fc 100644 --- a/src/vlibmemory/socket_api.c +++ b/src/vlibmemory/socket_api.c @@ -170,6 +170,8 @@ vl_socket_free_registration_index (u32 pool_index) { int i; vl_api_registration_t *rp; + void vl_api_call_reaper_functions (u32 client_index); + if (pool_is_free_index (socket_main.registration_pool, pool_index)) { clib_warning ("main pool index %d already free", pool_index); @@ -177,6 +179,8 @@ vl_socket_free_registration_index (u32 pool_index) } rp = pool_elt_at_index (socket_main.registration_pool, pool_index); + vl_api_call_reaper_functions (pool_index); + ASSERT (rp->registration_type != REGISTRATION_TYPE_FREE); for (i = 0; i < vec_len (rp->additional_fds_to_close); i++) if (close (rp->additional_fds_to_close[i]) < 0) -- cgit 1.2.3-korg