perfmon: new perfmon plugin
[vpp.git] / src / vlib / node_funcs.h
index b607ef2..b33f496 100644 (file)
@@ -201,6 +201,10 @@ vlib_node_set_state (vlib_main_t * vm, u32 node_index,
       nm->input_node_counts_by_state[new_state] += 1;
     }
 
+  if (PREDICT_FALSE (r->state == VLIB_NODE_STATE_DISABLED))
+    vlib_node_runtime_perf_counter (vm, r, 0, 0, 0,
+                                   VLIB_NODE_RUNTIME_PERF_RESET);
+
   n->state = new_state;
   r->state = new_state;
 }
@@ -242,6 +246,7 @@ vlib_node_set_interrupt_pending_with_data (vlib_main_t * vm, u32 node_index,
       vec_add2 (nm->pending_remote_interrupts, i, 1);
       i->node_runtime_index = n->runtime_index;
       i->data = data;
+      *nm->pending_remote_interrupts_notify = 1;
       clib_spinlock_unlock (&nm->pending_interrupt_lock);
     }
 }
@@ -450,6 +455,13 @@ vlib_current_process (vlib_main_t * vm)
   return vlib_get_current_process (vm)->node_runtime.node_index;
 }
 
+always_inline u32
+vlib_get_current_process_node_index (vlib_main_t * vm)
+{
+  vlib_process_t *process = vlib_get_current_process (vm);
+  return process->node_runtime.node_index;
+}
+
 /** Returns TRUE if a process suspend time is less than 10us
     @param dt - remaining poll time in seconds
     @returns 1 if dt < 10e-6, 0 otherwise
@@ -1235,6 +1247,15 @@ vlib_node_increment_counter (vlib_main_t * vm, u32 node_index,
 u32 vlib_process_create (vlib_main_t * vm, char *name,
                         vlib_node_function_t * f, u32 log2_n_stack_bytes);
 
+always_inline int
+vlib_node_set_dispatch_wrapper (vlib_main_t *vm, vlib_node_function_t *fn)
+{
+  if (fn && vm->dispatch_wrapper_fn)
+    return 1;
+  vm->dispatch_wrapper_fn = fn;
+  return 0;
+}
+
 #endif /* included_vlib_node_funcs_h */
 
 /*