aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/misc.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-06-14 18:38:02 -0400
committerKeith Burns <alagalah@gmail.com>2016-06-17 16:24:16 +0000
commitd65346098daf8967e882d0299679a131769c9be9 (patch)
tree50a9bb16a3f2c1ef8a9ef6b5e2623564a8453a5d /vnet/vnet/misc.c
parent378893a485d0e0dd331cebcb2ebefdeca073b1ab (diff)
Dynamically compute ip feature subgraph order
This change-set enables plugins to add themselves to the ip4/ip6 feature subgraphs without having to modify core vpp engine code at all. Add VNET_IP4/IP6_UNICAST/MULTICAST_FEATURE_INIT macros which express the required ordering constraints, and off you go. Along the way, added an implementation of Warshall's algorithm to vppinfra; to compute the positive transitive closure of a relation. In this case, the relation is "feature A runs before feature B." With that in hand, ip_feature_init_cast(...) computes a partial order across the set of configured feature subgraph nodes. In unit-testing, we discovered VPP-145 - ip4/6 inacl wiped out vnet_buffer(b)->ip>current_config_index, which exists in main. So, we fixed that by moving b->trace_index, adding b->current_config_index, and removing the ip opaque union current_config_index. Change-Id: Iff132116f66413dc6b31ac3377198c7a32d51f48 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vnet/vnet/misc.c')
-rw-r--r--vnet/vnet/misc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/vnet/vnet/misc.c b/vnet/vnet/misc.c
index 6effe6eae3e..9dbed8d8609 100644
--- a/vnet/vnet/misc.c
+++ b/vnet/vnet/misc.c
@@ -76,6 +76,15 @@ vnet_main_init (vlib_main_t * vm)
if ((error = vlib_call_init_function (vm, vnet_interface_init)))
return error;
+ if ((error = vlib_call_init_function (vm, ip_main_init)))
+ return error;
+
+ if ((error = vlib_call_init_function (vm, ip4_lookup_init)))
+ return error;
+
+ if ((error = vlib_call_init_function (vm, ip6_lookup_init)))
+ return error;
+
vnm->vlib_main = vm;
hw_if_index = vnet_register_interface