*/
#include <vlib/vlib.h>
-#include <vnet/vnet.h>
-#include <vnet/pg/pg.h>
#include <vnet/ethernet/ethernet.h>
-#include <vnet/ethernet/packet.h>
#include <vnet/ip/ip_packet.h>
-#include <vnet/ip/ip4_packet.h>
-#include <vnet/ip/ip6_packet.h>
-#include <vlib/cli.h>
#include <vnet/l2/l2_input.h>
#include <vnet/l2/l2_output.h>
-#include <vnet/l2/feat_bitmap.h>
#include <vnet/l2/l2_in_out_feat_arc.h>
#include <vppinfra/error.h>
u8 ip6_feat_arc_index[IN_OUT_FEAT_ARC_N_TABLE_GROUPS];
u8 nonip_feat_arc_index[IN_OUT_FEAT_ARC_N_TABLE_GROUPS];
u32 next_slot[IN_OUT_FEAT_ARC_N_TABLE_GROUPS];
-
- /* convenience variables */
- vlib_main_t *vlib_main;
- vnet_main_t *vnet_main;
} l2_in_out_feat_arc_main_t __attribute__ ((aligned (CLIB_CACHE_LINE_BYTES)));
typedef struct
#undef _
};
+extern l2_in_out_feat_arc_main_t l2_in_out_feat_arc_main;
+#ifndef CLIB_MARCH_VARIANT
l2_in_out_feat_arc_main_t l2_in_out_feat_arc_main;
+#endif /* CLIB_MARCH_VARIANT */
#define get_u16(addr) ( *((u16 *)(addr)) )
#define L2_FEAT_ARC_VEC_SIZE 2
return frame->n_vectors;
}
-static vlib_node_registration_t l2_in_feat_arc_node;
-static uword
-l2_in_feat_arc_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (l2_in_feat_arc_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE))
return l2_in_out_feat_arc_node_fn (vm, node, frame,
&l2_in_feat_arc_node, 1, 0);
}
-static vlib_node_registration_t l2_out_feat_arc_node;
-static uword
-l2_out_feat_arc_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (l2_out_feat_arc_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE))
return l2_in_out_feat_arc_node_fn (vm, node, frame,
&l2_out_feat_arc_node, 1, 0);
}
-static vlib_node_registration_t l2_in_feat_arc_end_node;
-static uword
-l2_in_feat_arc_end_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (l2_in_feat_arc_end_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE))
return l2_in_out_feat_arc_node_fn (vm, node, frame,
&l2_in_feat_arc_end_node, 0, 0);
}
-static vlib_node_registration_t l2_out_feat_arc_end_node;
-static uword
-l2_out_feat_arc_end_node_fn (vlib_main_t * vm,
- vlib_node_runtime_t * node, vlib_frame_t * frame)
+VLIB_NODE_FN (l2_out_feat_arc_end_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE))
return l2_in_out_feat_arc_node_fn (vm, node, frame,
}
+#ifndef CLIB_MARCH_VARIANT
void
vnet_l2_in_out_feat_arc_enable_disable (u32 sw_if_index, int is_output,
int enable_disable)
l2input_intf_bitmap_enable (sw_if_index, L2INPUT_FEAT_INPUT_FEAT_ARC,
(u32) enable_disable);
}
+#endif /* CLIB_MARCH_VARIANT */
/* *INDENT-OFF* */
VNET_FEATURE_ARC_INIT (l2_in_ip4_arc, static) =
/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (l2_in_feat_arc_node,static) = {
+VLIB_REGISTER_NODE (l2_in_feat_arc_node) = {
.name = "l2-input-feat-arc",
- .function = l2_in_feat_arc_node_fn,
.vector_size = sizeof (u32),
.format_trace = format_l2_in_feat_arc_trace,
.type = VLIB_NODE_TYPE_INTERNAL,
};
-VLIB_REGISTER_NODE (l2_out_feat_arc_node,static) = {
+VLIB_REGISTER_NODE (l2_out_feat_arc_node) = {
.name = "l2-output-feat-arc",
- .function = l2_out_feat_arc_node_fn,
.vector_size = sizeof (u32),
.format_trace = format_l2_out_feat_arc_trace,
.type = VLIB_NODE_TYPE_INTERNAL,
};
-VLIB_REGISTER_NODE (l2_in_feat_arc_end_node,static) = {
+VLIB_REGISTER_NODE (l2_in_feat_arc_end_node) = {
.name = "l2-input-feat-arc-end",
- .function = l2_in_feat_arc_end_node_fn,
.vector_size = sizeof (u32),
.format_trace = format_l2_in_feat_arc_trace,
.sibling_of = "l2-input-feat-arc",
};
-VLIB_REGISTER_NODE (l2_out_feat_arc_end_node,static) = {
+VLIB_REGISTER_NODE (l2_out_feat_arc_end_node) = {
.name = "l2-output-feat-arc-end",
- .function = l2_out_feat_arc_end_node_fn,
.vector_size = sizeof (u32),
.format_trace = format_l2_out_feat_arc_trace,
.sibling_of = "l2-output-feat-arc",
.node_name = "l2-output-feat-arc-end",
.runs_before = 0, /* not before any other features */
};
-
-
-VLIB_NODE_FUNCTION_MULTIARCH (l2_in_feat_arc_node, l2_in_feat_arc_node_fn)
-VLIB_NODE_FUNCTION_MULTIARCH (l2_out_feat_arc_node, l2_out_feat_arc_node_fn)
-VLIB_NODE_FUNCTION_MULTIARCH (l2_in_feat_arc_end_node, l2_in_feat_arc_end_node_fn)
-VLIB_NODE_FUNCTION_MULTIARCH (l2_out_feat_arc_end_node, l2_out_feat_arc_end_node_fn)
-
/* *INDENT-ON* */
+#ifndef CLIB_MARCH_VARIANT
clib_error_t *
l2_in_out_feat_arc_init (vlib_main_t * vm)
{
l2_in_out_feat_arc_main_t *mp = &l2_in_out_feat_arc_main;
- mp->vlib_main = vm;
- mp->vnet_main = vnet_get_main ();
-
/* Initialize the feature next-node indexes */
feat_bitmap_init_next_nodes (vm,
l2_in_feat_arc_end_node.index,
VLIB_INIT_FUNCTION (l2_in_out_feat_arc_init);
+#endif /* CLIB_MARCH_VARIANT */
/*
* fd.io coding-style-patch-verification: ON