From 4a58e49cfe03150034a65e147a2ffe8d24391b86 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Mon, 21 Dec 2020 13:19:10 +0000 Subject: ipsec: Support MPLS over IPSec[46] interface Type: feature Signed-off-by: Neale Ranns Change-Id: I89dc3815eabfee135cd5b3c910dea5e2e2ef1333 --- src/vnet/mpls/mpls_output.c | 59 +++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 32 deletions(-) (limited to 'src/vnet/mpls') diff --git a/src/vnet/mpls/mpls_output.c b/src/vnet/mpls/mpls_output.c index 4783a7ef349..a1d2d3baa88 100644 --- a/src/vnet/mpls/mpls_output.c +++ b/src/vnet/mpls/mpls_output.c @@ -19,6 +19,7 @@ #include #include #include +#include typedef struct { /* Adjacency taken. */ @@ -199,36 +200,32 @@ mpls_output_inline (vlib_main_t * vm, } if (mode == MPLS_OUTPUT_MIDCHAIN_MODE) { - adj0->sub_type.midchain.fixup_func - (vm, adj0, p0, - adj0->sub_type.midchain.fixup_data); - adj1->sub_type.midchain.fixup_func - (vm, adj1, p1, - adj1->sub_type.midchain.fixup_data); - } + adj_midchain_fixup (vm, adj0, p0, VNET_LINK_MPLS); + adj_midchain_fixup (vm, adj1, p1, VNET_LINK_MPLS); + } - p0->error = error_node->errors[error0]; - p1->error = error_node->errors[error1]; + p0->error = error_node->errors[error0]; + p1->error = error_node->errors[error1]; - if (PREDICT_FALSE(p0->flags & VLIB_BUFFER_IS_TRACED)) - { - mpls_output_trace_t *tr = vlib_add_trace (vm, node, - p0, sizeof (*tr)); - tr->adj_index = vnet_buffer(p0)->ip.adj_index[VLIB_TX]; - tr->flow_hash = vnet_buffer(p0)->ip.flow_hash; - } - if (PREDICT_FALSE(p1->flags & VLIB_BUFFER_IS_TRACED)) - { - mpls_output_trace_t *tr = vlib_add_trace (vm, node, - p1, sizeof (*tr)); - tr->adj_index = vnet_buffer(p1)->ip.adj_index[VLIB_TX]; - tr->flow_hash = vnet_buffer(p1)->ip.flow_hash; - } + if (PREDICT_FALSE (p0->flags & VLIB_BUFFER_IS_TRACED)) + { + mpls_output_trace_t *tr = + vlib_add_trace (vm, node, p0, sizeof (*tr)); + tr->adj_index = vnet_buffer (p0)->ip.adj_index[VLIB_TX]; + tr->flow_hash = vnet_buffer (p0)->ip.flow_hash; + } + if (PREDICT_FALSE (p1->flags & VLIB_BUFFER_IS_TRACED)) + { + mpls_output_trace_t *tr = + vlib_add_trace (vm, node, p1, sizeof (*tr)); + tr->adj_index = vnet_buffer (p1)->ip.adj_index[VLIB_TX]; + tr->flow_hash = vnet_buffer (p1)->ip.flow_hash; + } - vlib_validate_buffer_enqueue_x2 (vm, node, next_index, - to_next, n_left_to_next, - pi0, pi1, next0, next1); - } + vlib_validate_buffer_enqueue_x2 (vm, node, next_index, to_next, + n_left_to_next, pi0, pi1, next0, + next1); + } while (n_left_from > 0 && n_left_to_next > 0) { @@ -288,12 +285,10 @@ mpls_output_inline (vlib_main_t * vm, } if (mode == MPLS_OUTPUT_MIDCHAIN_MODE) { - adj0->sub_type.midchain.fixup_func - (vm, adj0, p0, - adj0->sub_type.midchain.fixup_data); - } + adj_midchain_fixup (vm, adj0, p0, VNET_LINK_MPLS); + } - p0->error = error_node->errors[error0]; + p0->error = error_node->errors[error0]; from += 1; n_left_from -= 1; -- cgit 1.2.3-korg