summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session_node.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-11-28 10:11:42 -0500
committerDave Barach <dave@barachs.net>2017-11-28 10:12:25 -0500
commit2a8639155a6cbc0f7c412f26af4ad638b12edb73 (patch)
treeedb262fb6e816a86a59f303178fe23064e29feb6 /src/vnet/session/session_node.c
parentf988e696149f42828444c69762c036d9684b6bb0 (diff)
Shut down session queue input nodes on exit
Shut off (especially) worker-thread session queue input nodes. Otherwise, vpp can crash when the main thread unmaps the API segment. Change-Id: Idf855e7570e0066cc921ae34bc53afabaa9e1dba Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r--src/vnet/session/session_node.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index ce460e9a94c..f647360ea5b 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -705,6 +705,25 @@ VLIB_REGISTER_NODE (session_queue_node) =
};
/* *INDENT-ON* */
+static clib_error_t *
+session_queue_exit (vlib_main_t * vm)
+{
+ if (vec_len (vlib_mains) < 2)
+ return 0;
+
+ /*
+ * Shut off (especially) worker-thread session nodes.
+ * Otherwise, vpp can crash as the main thread unmaps the
+ * API segment.
+ */
+ vlib_worker_thread_barrier_sync (vm);
+ session_node_enable_disable (0 /* is_enable */ );
+ vlib_worker_thread_barrier_release (vm);
+ return 0;
+}
+
+VLIB_MAIN_LOOP_EXIT_FUNCTION (session_queue_exit);
+
/*
* fd.io coding-style-patch-verification: ON
*