summaryrefslogtreecommitdiffstats
path: root/src/vlib/node_funcs.h
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-03-28 14:16:15 +0200
committerDave Barach <openvpp@barachs.net>2017-04-04 14:40:22 +0000
commit2c2b6407129461e183bc8ad5964cddc98ed1626c (patch)
tree6a16cebde5edfe4ed661f8f88860c77407813fef /src/vlib/node_funcs.h
parent8328534a2734b64e5da791007fd346c54cdb4d32 (diff)
vlib: make vlib_node_interrupt_pending(...) thread safe
Change-Id: I24577bd32ae23fbe8515cc8d960eab5448ce3b5c Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/node_funcs.h')
-rw-r--r--src/vlib/node_funcs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vlib/node_funcs.h b/src/vlib/node_funcs.h
index 8ccfc438020..1f7d94e1ecf 100644
--- a/src/vlib/node_funcs.h
+++ b/src/vlib/node_funcs.h
@@ -183,7 +183,9 @@ vlib_node_set_interrupt_pending (vlib_main_t * vm, u32 node_index)
vlib_node_main_t *nm = &vm->node_main;
vlib_node_t *n = vec_elt (nm->nodes, node_index);
ASSERT (n->type == VLIB_NODE_TYPE_INPUT);
+ clib_spinlock_lock_if_init (&nm->pending_interrupt_lock);
vec_add1 (nm->pending_interrupt_node_runtime_indices, n->runtime_index);
+ clib_spinlock_unlock_if_init (&nm->pending_interrupt_lock);
}
always_inline vlib_process_t *