summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-07-08 12:34:45 -0700
committerDave Barach <openvpp@barachs.net>2019-07-08 21:42:37 +0000
commit369db83f91a411977015748a74c5a4579170a16c (patch)
treedd597d101f1586c77d7aa400dc270135edb090d1
parentaaff5eefb1dddf3ea71e3258b362d6516350303e (diff)
vcl: add worker unregister api
Type:feature Change-Id: Ie73644aed94e58d5dce822de5000183e414401df Signed-off-by: Florin Coras <fcoras@cisco.com>
-rw-r--r--src/vcl/vppcom.c7
-rw-r--r--src/vcl/vppcom.h5
2 files changed, 12 insertions, 0 deletions
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
@@ -304,6 +304,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
*/
extern int vppcom_worker_index (void);