From 369db83f91a411977015748a74c5a4579170a16c Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Mon, 8 Jul 2019 12:34:45 -0700 Subject: vcl: add worker unregister api Type:feature Change-Id: Ie73644aed94e58d5dce822de5000183e414401df Signed-off-by: Florin Coras --- src/vcl/vppcom.c | 7 +++++++ src/vcl/vppcom.h | 5 +++++ 2 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index 3d08d395a27..dcbbfc44a39 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -3357,6 +3357,13 @@ vppcom_worker_register (void) return VPPCOM_OK; } +void +vppcom_worker_unregister (void) +{ + vcl_worker_cleanup (vcl_worker_get_current (), 1 /* notify vpp */ ); + vcl_set_worker_index (~0); +} + int vppcom_worker_index (void) { diff --git a/src/vcl/vppcom.h b/src/vcl/vppcom.h index 49cff413ec8..6dfdd267ac7 100644 --- a/src/vcl/vppcom.h +++ b/src/vcl/vppcom.h @@ -303,6 +303,11 @@ extern int vppcom_data_segment_copy (void *buf, vppcom_data_segments_t ds, */ extern int vppcom_worker_register (void); +/** + * Unregister current worker + */ +extern void vppcom_worker_unregister (void); + /** * Retrieve current worker index */ -- cgit 1.2.3-korg