diff options
author | 2016-06-14 18:38:02 -0400 | |
---|---|---|
committer | 2016-06-17 16:24:16 +0000 | |
commit | d65346098daf8967e882d0299679a131769c9be9 (patch) | |
tree | 50a9bb16a3f2c1ef8a9ef6b5e2623564a8453a5d /vnet/vnet/l2tp/l2tp.c | |
parent | 378893a485d0e0dd331cebcb2ebefdeca073b1ab (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/l2tp/l2tp.c')
-rw-r--r-- | vnet/vnet/l2tp/l2tp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vnet/vnet/l2tp/l2tp.c b/vnet/vnet/l2tp/l2tp.c index 7dfbe156c46..db4b4f5a29b 100644 --- a/vnet/vnet/l2tp/l2tp.c +++ b/vnet/vnet/l2tp/l2tp.c @@ -577,12 +577,12 @@ int l2tpv3_interface_enable_disable (vnet_main_t * vnm, ip_config_main_t * rx_cm = &lm->rx_config_mains[VNET_UNICAST]; u32 ci; ip6_l2tpv3_config_t config; - ip6_rx_feature_type_t type; + u32 feature_index; if (pool_is_free_index (vnm->interface_main.sw_interfaces, sw_if_index)) return VNET_API_ERROR_INVALID_SW_IF_INDEX; - type = IP6_RX_FEATURE_L2TPV3; + feature_index = im->ip6_unicast_rx_feature_ipsec; ci = rx_cm->config_index_by_sw_if_index[sw_if_index]; ci = (enable_disable @@ -590,7 +590,7 @@ int l2tpv3_interface_enable_disable (vnet_main_t * vnm, : vnet_config_del_feature) (vlib_get_main(), &rx_cm->config_main, ci, - type, + feature_index, &config, sizeof (config)); rx_cm->config_index_by_sw_if_index[sw_if_index] = ci; |