Use thread local storage for thread index
[vpp.git] / src / vlib / node.h
index 2a532cc..1e2f4c3 100644 (file)
@@ -42,6 +42,7 @@
 
 #include <vppinfra/cpu.h>
 #include <vppinfra/longjmp.h>
+#include <vppinfra/lock.h>
 #include <vppinfra/timing_wheel.h>
 #include <vlib/trace.h>                /* for vlib_trace_filter_t */
 
@@ -343,8 +344,8 @@ typedef struct vlib_frame_t
   /* Number of vector elements currently in frame. */
   u16 n_vectors;
 
-  /* Owner cpuid / heap id */
-  u16 cpu_index;
+  /* Owner thread / heap id */
+  u16 thread_index;
 
   /* Scalar and vector arguments to next node. */
   u8 arguments[0];
@@ -458,7 +459,7 @@ typedef struct vlib_node_runtime_t
                                          zero before first run of this
                                          node. */
 
-  u16 cpu_index;                       /**< CPU this node runs on */
+  u16 thread_index;                    /**< thread this node runs on */
 
   u8 runtime_data[0];                  /**< Function dependent
                                          node-runtime data. This data is
@@ -644,6 +645,7 @@ typedef struct
 
   /* Node runtime indices for input nodes with pending interrupts. */
   u32 *pending_interrupt_node_runtime_indices;
+  clib_spinlock_t pending_interrupt_lock;
 
   /* Input nodes are switched from/to interrupt to/from polling mode
      when average vector length goes above/below polling/interrupt