Dynamically compute ip feature subgraph order 53/1553/6
authorDave Barach <dave@barachs.net>
Tue, 14 Jun 2016 22:38:02 +0000 (18:38 -0400)
committerKeith Burns <alagalah@gmail.com>
Fri, 17 Jun 2016 16:24:16 +0000 (16:24 +0000)
commitd65346098daf8967e882d0299679a131769c9be9
tree50a9bb16a3f2c1ef8a9ef6b5e2623564a8453a5d
parent378893a485d0e0dd331cebcb2ebefdeca073b1ab
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>
25 files changed:
vlib/vlib/buffer.h
vnet/Makefile.am
vnet/vnet/buffer.h
vnet/vnet/classify/input_acl.c
vnet/vnet/ip/ip.h
vnet/vnet/ip/ip4.h
vnet/vnet/ip/ip4_forward.c
vnet/vnet/ip/ip4_input.c
vnet/vnet/ip/ip4_source_check.c
vnet/vnet/ip/ip6.h
vnet/vnet/ip/ip6_forward.c
vnet/vnet/ip/ip6_input.c
vnet/vnet/ip/ip_feature_registration.c [new file with mode: 0644]
vnet/vnet/ip/ip_feature_registration.h [new file with mode: 0644]
vnet/vnet/ip/ip_input_acl.c
vnet/vnet/ipsec/ipsec.c
vnet/vnet/ipsec/ipsec_input.c
vnet/vnet/l2tp/decap.c
vnet/vnet/l2tp/l2tp.c
vnet/vnet/misc.c
vpp/api/api.c
vppinfra/Makefile.am
vppinfra/vppinfra/ptclosure.c [new file with mode: 0644]
vppinfra/vppinfra/ptclosure.h [new file with mode: 0644]
vppinfra/vppinfra/test_ptclosure.c [new file with mode: 0644]