aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-06-29 00:19:08 -0700
committerNeale Ranns <nranns@cisco.com>2017-06-30 13:55:23 +0000
commitbb620d74b247f419eb485886c55148099b0213bb (patch)
tree9f1705287a3ac5445059bec8028a6e50f1440165 /src/vlib
parent3e01588bf39f817921e92dd641a1a65d66e40737 (diff)
VPP debug image with worker threads hit assert on adding IP route with traffic (VPP-892)
When stacking DPOs the VLIB graph is also updated to add the edge between the nodes, if this edge does not yet exist. This addition should be done with the workers stopped. Change-Id: I327e4d7d26f0b23eb280f17e4619ff2093ff7940 Signed-off-by: Neale Ranns <nranns@cisco.com> (cherry picked from commit c02bd03ddf5eec9e9c79811360685f13e4ba8ee1)
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/node.c20
-rw-r--r--src/vlib/node_funcs.h3
2 files changed, 23 insertions, 0 deletions
diff --git a/src/vlib/node.c b/src/vlib/node.c
index eecad274..2cda0f06 100644
--- a/src/vlib/node.c
+++ b/src/vlib/node.c
@@ -151,6 +151,26 @@ vlib_node_runtime_update (vlib_main_t * vm, u32 node_index, u32 next_index)
vlib_worker_thread_barrier_release (vm);
}
+uword
+vlib_node_get_next (vlib_main_t * vm, uword node_index, uword next_node_index)
+{
+ vlib_node_main_t *nm = &vm->node_main;
+ vlib_node_t *node;
+ uword *p;
+
+ node = vec_elt (nm->nodes, node_index);
+
+ /* Runtime has to be initialized. */
+ ASSERT (nm->flags & VLIB_NODE_MAIN_RUNTIME_STARTED);
+
+ if ((p = hash_get (node->next_slot_by_node, next_node_index)))
+ {
+ return p[0];
+ }
+
+ return (~0);
+}
+
/* Add next node to given node in given slot. */
uword
vlib_node_add_next_with_slot (vlib_main_t * vm,
diff --git a/src/vlib/node_funcs.h b/src/vlib/node_funcs.h
index d6588a74..c0389b2f 100644
--- a/src/vlib/node_funcs.h
+++ b/src/vlib/node_funcs.h
@@ -1070,6 +1070,9 @@ vlib_node_vectors_per_main_loop_as_integer (vlib_main_t * vm, u32 node_index)
void
vlib_frame_free (vlib_main_t * vm, vlib_node_runtime_t * r, vlib_frame_t * f);
+/* Return the edge index if present, ~0 otherwise */
+uword vlib_node_get_next (vlib_main_t * vm, uword node, uword next_node);
+
/* Add next node to given node in given slot. */
uword
vlib_node_add_next_with_slot (vlib_main_t * vm,