aboutsummaryrefslogtreecommitdiffstats
path: root/vlib
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-09-06 22:30:16 +0200
committerDave Barach <openvpp@barachs.net>2016-09-06 23:15:25 +0000
commit5d447a9f64afd4ebed1b126b0faa5732563f81fe (patch)
tree965ef2b60d14e62bf94347e4cc18833534927e0d /vlib
parentd4024f586216a6bf4e2dfb667df8149b7f95b5c6 (diff)
Add support for input nodes in interrupt mode on the worker threads
Change-Id: Ice2e0e60c801bd6fb67f3a544e95e9ffaa22ca16 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vlib')
-rw-r--r--vlib/vlib/threads.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/vlib/vlib/threads.c b/vlib/vlib/threads.c
index 7b5b8ff0544..dc9b1bbecd7 100644
--- a/vlib/vlib/threads.c
+++ b/vlib/vlib/threads.c
@@ -1337,6 +1337,8 @@ vlib_worker_thread_internal (vlib_main_t * vm)
vlib_node_main_t *nm = &vm->node_main;
u64 cpu_time_now = clib_cpu_time_now ();
+ vec_alloc (nm->pending_interrupt_node_runtime_indices, 32);
+
while (1)
{
vlib_worker_thread_barrier_check ();
@@ -1351,6 +1353,28 @@ vlib_worker_thread_internal (vlib_main_t * vm)
cpu_time_now);
}
+ /* Next handle interrupts. */
+ {
+ uword l = _vec_len (nm->pending_interrupt_node_runtime_indices);
+ uword i;
+ if (l > 0)
+ {
+ _vec_len (nm->pending_interrupt_node_runtime_indices) = 0;
+ for (i = 0; i < l; i++)
+ {
+ n = vec_elt_at_index (nm->nodes_by_type[VLIB_NODE_TYPE_INPUT],
+ nm->
+ pending_interrupt_node_runtime_indices
+ [i]);
+ cpu_time_now =
+ dispatch_node (vm, n, VLIB_NODE_TYPE_INPUT,
+ VLIB_NODE_STATE_INTERRUPT,
+ /* frame */ 0,
+ cpu_time_now);
+ }
+ }
+ }
+
if (_vec_len (nm->pending_frames))
{
int i;