aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/mpls/mpls_output.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-12-21 13:19:10 +0000
committerOle Tr�an <otroan@employees.org>2021-01-18 08:35:52 +0000
commit4a58e49cfe03150034a65e147a2ffe8d24391b86 (patch)
treea929278e8a40067c1d103cf75174aa83f334c26e /src/vnet/mpls/mpls_output.c
parent20399f8f3a27d54f65c4aff92998a2a345a7adab (diff)
ipsec: Support MPLS over IPSec[46] interface
Type: feature Signed-off-by: Neale Ranns <nranns@cisco.com> Change-Id: I89dc3815eabfee135cd5b3c910dea5e2e2ef1333
Diffstat (limited to 'src/vnet/mpls/mpls_output.c')
-rw-r--r--src/vnet/mpls/mpls_output.c59
1 files changed, 27 insertions, 32 deletions
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 <vnet/ip/ip.h>
#include <vnet/mpls/mpls.h>
#include <vnet/ip/ip_frag.h>
+#include <vnet/adj/adj_dp.h>
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;