vcl: add worker unregister api 50/20550/4
authorFlorin Coras <fcoras@cisco.com>
Mon, 8 Jul 2019 19:34:45 +0000 (12:34 -0700)
committerDave Barach <openvpp@barachs.net>
Mon, 8 Jul 2019 21:42:37 +0000 (21:42 +0000)
Type:feature

Change-Id: Ie73644aed94e58d5dce822de5000183e414401df
Signed-off-by: Florin Coras <fcoras@cisco.com>
src/vcl/vppcom.c
src/vcl/vppcom.h

index 3d08d39..dcbbfc4 100644 (file)
@@ -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)
 {
index 49cff41..6dfdd26 100644 (file)
@@ -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
  */