Add callback multiplex support
[vpp.git] / src / vlib / main.h
index 42f0c51..9b63116 100644 (file)
@@ -94,11 +94,14 @@ typedef struct vlib_main_t
   u32 node_counts_per_main_loop[2];
 
   /* Main loop hw / sw performance counters */
-  void (*vlib_node_runtime_perf_counter_cb) (struct vlib_main_t *,
-                                            u64 *, u64 *,
-                                            vlib_node_runtime_t *,
-                                            vlib_frame_t *, int);
-
+  void (**vlib_node_runtime_perf_counter_cbs) (struct vlib_main_t *,
+                                              u64 *, u64 *,
+                                              vlib_node_runtime_t *,
+                                              vlib_frame_t *, int);
+  void (**vlib_node_runtime_perf_counter_cb_tmp) (struct vlib_main_t *,
+                                                 u64 *, u64 *,
+                                                 vlib_node_runtime_t *,
+                                                 vlib_frame_t *, int);
   /* Every so often we switch to the next counter. */
 #define VLIB_LOG2_MAIN_LOOPS_PER_STATS_UPDATE 7
 
@@ -215,7 +218,10 @@ typedef struct vlib_main_t
   u8 **argv;
 
   /* Top of (worker) dispatch loop callback */
-  volatile void (*worker_thread_main_loop_callback) (struct vlib_main_t *);
+  void (**volatile worker_thread_main_loop_callbacks) (struct vlib_main_t *);
+  void (**volatile worker_thread_main_loop_callback_tmp)
+    (struct vlib_main_t *);
+  clib_spinlock_t worker_thread_main_loop_callback_lock;
 
   /* debugging */
   volatile int parked_at_barrier;