Shut down session queue input nodes on exit
[vpp.git] / src / vnet / session / session_node.c
index 7811617..f647360 100644 (file)
@@ -325,8 +325,7 @@ session_tx_fifo_read_and_snd_i (vlib_main_t * vm, vlib_node_runtime_t * node,
          /* *INDENT-ON* */
 
          VLIB_BUFFER_TRACE_TRAJECTORY_INIT (b0);
-         if (VLIB_BUFFER_TRACE_TRAJECTORY)
-           b0->pre_data[1] = 3;
+         tcp_trajectory_add_start (b0, 3);
 
          if (PREDICT_FALSE (n_trace > 0))
            {
@@ -706,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
  *