From 44f0f71b6b1e6dac466452664817abc388662efd Mon Sep 17 00:00:00 2001 From: Filip Tehlar Date: Mon, 11 Mar 2019 04:26:37 -0700 Subject: l2: migrate old MULTIARCH macros to VLIB_NODE_FN Change-Id: I8370c06150ce4499475e9d6dc6b3ab8be2016202 Signed-off-by: Filip Tehlar --- src/vnet/CMakeLists.txt | 11 ++++++++ src/vnet/l2/l2_efp_filter.c | 22 +++++++++------- src/vnet/l2/l2_efp_filter.h | 2 ++ src/vnet/l2/l2_flood.c | 18 +++++++------- src/vnet/l2/l2_in_out_acl.c | 31 ++++++++++++----------- src/vnet/l2/l2_in_out_feat_arc.c | 54 +++++++++++++++++----------------------- src/vnet/l2/l2_in_out_feat_arc.h | 5 +++- src/vnet/l2/l2_input.c | 21 +++++++++++----- src/vnet/l2/l2_input_classify.c | 18 +++++++------- src/vnet/l2/l2_input_vtr.c | 19 +++++++------- src/vnet/l2/l2_output_classify.c | 18 +++++++------- src/vnet/l2/l2_rw.c | 17 +++++++------ src/vnet/l2/l2_rw.h | 2 ++ src/vnet/l2/l2_uu_fwd.c | 11 +++----- src/vnet/l2/l2_xcrw.c | 21 +++++++++------- src/vnet/l2/l2_xcrw.h | 2 ++ 16 files changed, 150 insertions(+), 122 deletions(-) diff --git a/src/vnet/CMakeLists.txt b/src/vnet/CMakeLists.txt index 73fbf3ce82e..c5ad47ed32e 100644 --- a/src/vnet/CMakeLists.txt +++ b/src/vnet/CMakeLists.txt @@ -181,6 +181,17 @@ list(APPEND VNET_MULTIARCH_SOURCES l2/l2_learn.c l2/l2_output.c l2/l2_patch.c + l2/l2_in_out_feat_arc.c + l2/l2_input_classify.c + l2/l2_input.c + l2/l2_output_classify.c + l2/l2_flood.c + l2/l2_uu_fwd.c + l2/l2_efp_filter.c + l2/l2_rw.c + l2/l2_xcrw.c + l2/l2_in_out_acl.c + l2/l2_input_vtr.c ) list(APPEND VNET_HEADERS diff --git a/src/vnet/l2/l2_efp_filter.c b/src/vnet/l2/l2_efp_filter.c index 69d40a03497..3d152ad1f11 100644 --- a/src/vnet/l2/l2_efp_filter.c +++ b/src/vnet/l2/l2_efp_filter.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -80,9 +81,11 @@ format_l2_efp_filter_trace (u8 * s, va_list * args) return s; } -l2_efp_filter_main_t l2_efp_filter_main; +extern l2_efp_filter_main_t l2_efp_filter_main; -static vlib_node_registration_t l2_efp_filter_node; +#ifndef CLIB_MARCH_VARIANT +l2_efp_filter_main_t l2_efp_filter_main; +#endif /* CLIB_MARCH_VARIANT */ #define foreach_l2_efp_filter_error \ _(L2_EFP_FILTER, "L2 EFP filter packets") \ @@ -169,9 +172,9 @@ extract_keys (vnet_main_t * vnet_main, * The post-rewrite check is performed here. */ -static uword -l2_efp_filter_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (l2_efp_filter_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, + vlib_frame_t * frame) { u32 n_left_from, *from, *to_next; l2_efp_filter_next_t next_index; @@ -457,8 +460,7 @@ l2_efp_filter_node_fn (vlib_main_t * vm, /* *INDENT-OFF* */ -VLIB_REGISTER_NODE (l2_efp_filter_node,static) = { - .function = l2_efp_filter_node_fn, +VLIB_REGISTER_NODE (l2_efp_filter_node) = { .name = "l2-efp-filter", .vector_size = sizeof (u32), .format_trace = format_l2_efp_filter_trace, @@ -476,8 +478,9 @@ VLIB_REGISTER_NODE (l2_efp_filter_node,static) = { }; /* *INDENT-ON* */ -VLIB_NODE_FUNCTION_MULTIARCH (l2_efp_filter_node, l2_efp_filter_node_fn) - clib_error_t *l2_efp_filter_init (vlib_main_t * vm) +#ifndef CLIB_MARCH_VARIANT +clib_error_t * +l2_efp_filter_init (vlib_main_t * vm) { l2_efp_filter_main_t *mp = &l2_efp_filter_main; @@ -562,6 +565,7 @@ VLIB_CLI_COMMAND (int_l2_efp_filter_cli, static) = { }; /* *INDENT-ON* */ +#endif /* CLIB_MARCH_VARIANT */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/vnet/l2/l2_efp_filter.h b/src/vnet/l2/l2_efp_filter.h index f40851df3bd..4bd43587638 100644 --- a/src/vnet/l2/l2_efp_filter.h +++ b/src/vnet/l2/l2_efp_filter.h @@ -22,6 +22,8 @@ #include #include +extern vlib_node_registration_t l2_efp_filter_node; + #endif /* diff --git a/src/vnet/l2/l2_flood.c b/src/vnet/l2/l2_flood.c index 3198d323d60..1bc528138d7 100644 --- a/src/vnet/l2/l2_flood.c +++ b/src/vnet/l2/l2_flood.c @@ -87,9 +87,11 @@ format_l2flood_trace (u8 * s, va_list * args) return s; } -l2flood_main_t l2flood_main; +extern l2flood_main_t l2flood_main; -static vlib_node_registration_t l2flood_node; +#ifndef CLIB_MARCH_VARIANT +l2flood_main_t l2flood_main; +#endif /* CLIB_MARCH_VARIANT */ #define foreach_l2flood_error \ _(L2FLOOD, "L2 flood packets") \ @@ -134,9 +136,8 @@ typedef enum * could be turned into an ICMP reply. If BVI processing is not performed * last, the modified packet would be replicated to the remaining members. */ -static uword -l2flood_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (l2flood_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, vlib_frame_t * frame) { u32 n_left_from, *from, *to_next; l2flood_next_t next_index; @@ -362,8 +363,7 @@ l2flood_node_fn (vlib_main_t * vm, /* *INDENT-OFF* */ -VLIB_REGISTER_NODE (l2flood_node,static) = { - .function = l2flood_node_fn, +VLIB_REGISTER_NODE (l2flood_node) = { .name = "l2-flood", .vector_size = sizeof (u32), .format_trace = format_l2flood_trace, @@ -380,10 +380,9 @@ VLIB_REGISTER_NODE (l2flood_node,static) = { [L2FLOOD_NEXT_DROP] = "error-drop", }, }; - -VLIB_NODE_FUNCTION_MULTIARCH (l2flood_node, l2flood_node_fn) /* *INDENT-ON* */ +#ifndef CLIB_MARCH_VARIANT clib_error_t * l2flood_init (vlib_main_t * vm) { @@ -421,6 +420,7 @@ l2flood_register_input_type (vlib_main_t * vm, next_by_ethertype_register (&mp->l3_next, type, next_index); } +#endif /* CLIB_MARCH_VARIANT */ /** diff --git a/src/vnet/l2/l2_in_out_acl.c b/src/vnet/l2/l2_in_out_acl.c index 1ca13613078..50e87f3258b 100644 --- a/src/vnet/l2/l2_in_out_acl.c +++ b/src/vnet/l2/l2_in_out_acl.c @@ -80,10 +80,14 @@ format_l2_outacl_trace (u8 * s, va_list * args) return format_l2_in_out_acl_trace (s, IN_OUT_ACL_OUTPUT_TABLE_GROUP, args); } +extern l2_in_out_acl_main_t l2_in_out_acl_main; + +#ifndef CLIB_MARCH_VARIANT l2_in_out_acl_main_t l2_in_out_acl_main; +#endif /* CLIB_MARCH_VARIANT */ -static vlib_node_registration_t l2_inacl_node; -static vlib_node_registration_t l2_outacl_node; +extern vlib_node_registration_t l2_inacl_node; +extern vlib_node_registration_t l2_outacl_node; #define foreach_l2_inacl_error \ _(NONE, "valid input ACL packets") \ @@ -445,25 +449,24 @@ l2_in_out_acl_node_fn (vlib_main_t * vm, return frame->n_vectors; } -static uword -l2_inacl_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (l2_inacl_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, + vlib_frame_t * frame) { return l2_in_out_acl_node_fn (vm, node, frame, IN_OUT_ACL_INPUT_TABLE_GROUP); } -static uword -l2_outacl_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (l2_outacl_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, + vlib_frame_t * frame) { return l2_in_out_acl_node_fn (vm, node, frame, IN_OUT_ACL_OUTPUT_TABLE_GROUP); } /* *INDENT-OFF* */ -VLIB_REGISTER_NODE (l2_inacl_node,static) = { - .function = l2_inacl_node_fn, +VLIB_REGISTER_NODE (l2_inacl_node) = { .name = "l2-input-acl", .vector_size = sizeof (u32), .format_trace = format_l2_inacl_trace, @@ -480,8 +483,7 @@ VLIB_REGISTER_NODE (l2_inacl_node,static) = { }, }; -VLIB_REGISTER_NODE (l2_outacl_node,static) = { - .function = l2_outacl_node_fn, +VLIB_REGISTER_NODE (l2_outacl_node) = { .name = "l2-output-acl", .vector_size = sizeof (u32), .format_trace = format_l2_outacl_trace, @@ -497,12 +499,10 @@ VLIB_REGISTER_NODE (l2_outacl_node,static) = { [ACL_NEXT_INDEX_DENY] = "error-drop", }, }; - -VLIB_NODE_FUNCTION_MULTIARCH (l2_inacl_node, l2_inacl_node_fn) -VLIB_NODE_FUNCTION_MULTIARCH (l2_outacl_node, l2_outacl_node_fn) /* *INDENT-ON* */ +#ifndef CLIB_MARCH_VARIANT clib_error_t * l2_in_out_acl_init (vlib_main_t * vm) { @@ -527,6 +527,7 @@ l2_in_out_acl_init (vlib_main_t * vm) } VLIB_INIT_FUNCTION (l2_in_out_acl_init); +#endif /* CLIB_MARCH_VARIANT */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/vnet/l2/l2_in_out_feat_arc.c b/src/vnet/l2/l2_in_out_feat_arc.c index 083a720316f..8717ea908a9 100644 --- a/src/vnet/l2/l2_in_out_feat_arc.c +++ b/src/vnet/l2/l2_in_out_feat_arc.c @@ -128,8 +128,11 @@ static char *l2_out_feat_arc_error_strings[] = { #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 @@ -332,10 +335,9 @@ l2_in_out_feat_arc_node_fn (vlib_main_t * vm, 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, @@ -347,10 +349,9 @@ l2_in_feat_arc_node_fn (vlib_main_t * vm, &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, @@ -362,10 +363,9 @@ l2_out_feat_arc_node_fn (vlib_main_t * vm, &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, @@ -377,10 +377,9 @@ l2_in_feat_arc_end_node_fn (vlib_main_t * vm, &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, @@ -393,6 +392,7 @@ l2_out_feat_arc_end_node_fn (vlib_main_t * vm, } +#ifndef CLIB_MARCH_VARIANT void vnet_l2_in_out_feat_arc_enable_disable (u32 sw_if_index, int is_output, int enable_disable) @@ -404,6 +404,7 @@ vnet_l2_in_out_feat_arc_enable_disable (u32 sw_if_index, int is_output, 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) = @@ -451,9 +452,8 @@ VNET_FEATURE_ARC_INIT (l2_in_nonip_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, @@ -463,9 +463,8 @@ VLIB_REGISTER_NODE (l2_in_feat_arc_node,static) = { }; -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, @@ -475,17 +474,15 @@ VLIB_REGISTER_NODE (l2_out_feat_arc_node,static) = { }; -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", @@ -534,16 +531,10 @@ VNET_FEATURE_INIT (l2_out_nonip_arc_end, static) = .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) { @@ -642,6 +633,7 @@ vnet_l2_feature_enable_disable (const char *arc_name, const char *node_name, VLIB_INIT_FUNCTION (l2_in_out_feat_arc_init); +#endif /* CLIB_MARCH_VARIANT */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/vnet/l2/l2_in_out_feat_arc.h b/src/vnet/l2/l2_in_out_feat_arc.h index 799edee7929..0b5279ca1d0 100644 --- a/src/vnet/l2/l2_in_out_feat_arc.h +++ b/src/vnet/l2/l2_in_out_feat_arc.h @@ -58,7 +58,10 @@ int vnet_l2_feature_enable_disable (const char *arc_name, int enable_disable, void *feature_config, u32 n_feature_config_bytes); - +extern vlib_node_registration_t l2_in_feat_arc_end_node; +extern vlib_node_registration_t l2_out_feat_arc_end_node; +extern vlib_node_registration_t l2_out_feat_arc_node; +extern vlib_node_registration_t l2_in_feat_arc_node; #endif /* __included_vnet_in_out_feat_arc_h__ */ diff --git a/src/vnet/l2/l2_input.c b/src/vnet/l2/l2_input.c index b66a7446d66..704223a3d75 100644 --- a/src/vnet/l2/l2_input.c +++ b/src/vnet/l2/l2_input.c @@ -49,6 +49,8 @@ * For interfaces in Layer 3 mode, the packets will be routed. */ +#ifndef CLIB_MARCH_VARIANT + /* Feature graph node names */ static char *l2input_feat_names[] = { #define _(sym,name) name, @@ -94,6 +96,7 @@ format_l2_input_features (u8 * s, va_list * args) } return s; } +#endif /* CLIB_MARCH_VARIANT */ typedef struct { @@ -119,7 +122,11 @@ format_l2input_trace (u8 * s, va_list * args) return s; } +extern l2input_main_t l2input_main; + +#ifndef CLIB_MARCH_VARIANT l2input_main_t l2input_main; +#endif /* CLIB_MARCH_VARIANT */ #define foreach_l2input_error \ _(L2INPUT, "L2 input packets") \ @@ -455,9 +462,8 @@ l2input_node_inline (vlib_main_t * vm, return frame->n_vectors; } -static uword -l2input_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (l2input_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, vlib_frame_t * frame) { if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE))) return l2input_node_inline (vm, node, frame, 1 /* do_trace */ ); @@ -466,7 +472,6 @@ l2input_node_fn (vlib_main_t * vm, /* *INDENT-OFF* */ VLIB_REGISTER_NODE (l2input_node) = { - .function = l2input_node_fn, .name = "l2-input", .vector_size = sizeof (u32), .format_trace = format_l2input_trace, @@ -487,8 +492,9 @@ VLIB_REGISTER_NODE (l2input_node) = { }; /* *INDENT-ON* */ -VLIB_NODE_FUNCTION_MULTIARCH (l2input_node, l2input_node_fn) - clib_error_t *l2input_init (vlib_main_t * vm) +#ifndef CLIB_MARCH_VARIANT +clib_error_t * +l2input_init (vlib_main_t * vm) { l2input_main_t *mp = &l2input_main; @@ -851,6 +857,7 @@ set_int_l2_mode (vlib_main_t * vm, vnet_main_t * vnet_main, /* */ return 0; } +#endif /* CLIB_MARCH_VARIANT */ /** * Set subinterface in bridging mode with a bridge-domain ID. @@ -1213,6 +1220,7 @@ _(l2output_init) \ _(l2_patch_init) \ _(l2_xcrw_init) +#ifndef CLIB_MARCH_VARIANT clib_error_t * l2_init (vlib_main_t * vm) { @@ -1227,6 +1235,7 @@ while (0); } VLIB_INIT_FUNCTION (l2_init); +#endif /* CLIB_MARCH_VARIANT */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/vnet/l2/l2_input_classify.c b/src/vnet/l2/l2_input_classify.c index fcf4783bc1e..ffd1078d469 100644 --- a/src/vnet/l2/l2_input_classify.c +++ b/src/vnet/l2/l2_input_classify.c @@ -67,10 +67,12 @@ format_l2_input_classify_trace (u8 * s, va_list * args) return s; } +extern l2_input_classify_main_t l2_input_classify_main; + +#ifndef CLIB_MARCH_VARIANT /** l2 input classifier main data structure. */ l2_input_classify_main_t l2_input_classify_main; - -vlib_node_registration_t l2_input_classify_node; +#endif /* CLIB_MARCH_VARIANT */ #define foreach_l2_input_classify_error \ _(MISS, "Classify misses") \ @@ -142,9 +144,9 @@ static char *l2_input_classify_error_strings[] = { * Classifier hits in other than the first table */ -static uword -l2_input_classify_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (l2_input_classify_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, + vlib_frame_t * frame) { u32 n_left_from, *from, *to_next; l2_input_classify_next_t next_index; @@ -443,7 +445,6 @@ l2_input_classify_node_fn (vlib_main_t * vm, /* *INDENT-OFF* */ VLIB_REGISTER_NODE (l2_input_classify_node) = { - .function = l2_input_classify_node_fn, .name = "l2-input-classify", .vector_size = sizeof (u32), .format_trace = format_l2_input_classify_trace, @@ -467,9 +468,7 @@ VLIB_REGISTER_NODE (l2_input_classify_node) = { }; /* *INDENT-ON* */ -VLIB_NODE_FUNCTION_MULTIARCH (l2_input_classify_node, - l2_input_classify_node_fn); - +#ifndef CLIB_MARCH_VARIANT /** l2 input classsifier feature initialization. */ clib_error_t * l2_input_classify_init (vlib_main_t * vm) @@ -577,6 +576,7 @@ vnet_l2_input_classify_set_tables (u32 sw_if_index, return 0; } +#endif /* CLIB_MARCH_VARIANT */ static clib_error_t * int_l2_input_classify_command_fn (vlib_main_t * vm, diff --git a/src/vnet/l2/l2_input_vtr.c b/src/vnet/l2/l2_input_vtr.c index 25b3bd03e65..be3e6ba85f4 100644 --- a/src/vnet/l2/l2_input_vtr.c +++ b/src/vnet/l2/l2_input_vtr.c @@ -57,9 +57,9 @@ format_l2_invtr_trace (u8 * s, va_list * args) return s; } +#ifndef CLIB_MARCH_VARIANT l2_invtr_main_t l2_invtr_main; - -static vlib_node_registration_t l2_invtr_node; +#endif /* CLIB_MARCH_VARIANT */ #define foreach_l2_invtr_error \ _(L2_INVTR, "L2 inverter packets") \ @@ -86,9 +86,9 @@ typedef enum } l2_invtr_next_t; -static uword -l2_invtr_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (l2_invtr_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, + vlib_frame_t * frame) { u32 n_left_from, *from, *to_next; l2_invtr_next_t next_index; @@ -320,8 +320,7 @@ l2_invtr_node_fn (vlib_main_t * vm, /* *INDENT-OFF* */ -VLIB_REGISTER_NODE (l2_invtr_node,static) = { - .function = l2_invtr_node_fn, +VLIB_REGISTER_NODE (l2_invtr_node) = { .name = "l2-input-vtr", .vector_size = sizeof (u32), .format_trace = format_l2_invtr_trace, @@ -339,8 +338,9 @@ VLIB_REGISTER_NODE (l2_invtr_node,static) = { }; /* *INDENT-ON* */ -VLIB_NODE_FUNCTION_MULTIARCH (l2_invtr_node, l2_invtr_node_fn) - clib_error_t *l2_invtr_init (vlib_main_t * vm) +#ifndef CLIB_MARCH_VARIANT +clib_error_t * +l2_invtr_init (vlib_main_t * vm) { l2_invtr_main_t *mp = &l2_invtr_main; @@ -358,6 +358,7 @@ VLIB_NODE_FUNCTION_MULTIARCH (l2_invtr_node, l2_invtr_node_fn) } VLIB_INIT_FUNCTION (l2_invtr_init); +#endif /* CLIB_MARCH_VARIANT */ /* diff --git a/src/vnet/l2/l2_output_classify.c b/src/vnet/l2/l2_output_classify.c index 49a589ccc7d..1e55afcaa4d 100644 --- a/src/vnet/l2/l2_output_classify.c +++ b/src/vnet/l2/l2_output_classify.c @@ -59,10 +59,12 @@ format_l2_output_classify_trace (u8 * s, va_list * args) return s; } +extern l2_output_classify_main_t l2_output_classify_main; + +#ifndef CLIB_MARCH_VARIANT /** l2 output classifier main data structure. */ l2_output_classify_main_t l2_output_classify_main; - -vlib_node_registration_t l2_output_classify_node; +#endif /* CLIB_MARCH_VARIANT */ #define foreach_l2_output_classify_error \ _(MISS, "Classify misses") \ @@ -134,9 +136,9 @@ static char *l2_output_classify_error_strings[] = { * Classifier hits in other than the first table */ -static uword -l2_output_classify_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (l2_output_classify_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, + vlib_frame_t * frame) { u32 n_left_from, *from, *to_next; l2_output_classify_next_t next_index; @@ -436,7 +438,6 @@ l2_output_classify_node_fn (vlib_main_t * vm, /* *INDENT-OFF* */ VLIB_REGISTER_NODE (l2_output_classify_node) = { - .function = l2_output_classify_node_fn, .name = "l2-output-classify", .vector_size = sizeof (u32), .format_trace = format_l2_output_classify_trace, @@ -456,9 +457,7 @@ VLIB_REGISTER_NODE (l2_output_classify_node) = { }; /* *INDENT-ON* */ -VLIB_NODE_FUNCTION_MULTIARCH (l2_output_classify_node, - l2_output_classify_node_fn); - +#ifndef CLIB_MARCH_VARIANT /** l2 output classsifier feature initialization. */ clib_error_t * l2_output_classify_init (vlib_main_t * vm) @@ -568,6 +567,7 @@ vnet_l2_output_classify_set_tables (u32 sw_if_index, return 0; } +#endif /* CLIB_MARCH_VARIANT */ static clib_error_t * int_l2_output_classify_command_fn (vlib_main_t * vm, diff --git a/src/vnet/l2/l2_rw.c b/src/vnet/l2/l2_rw.c index ac83483002a..85a53aa06ff 100644 --- a/src/vnet/l2/l2_rw.c +++ b/src/vnet/l2/l2_rw.c @@ -26,9 +26,9 @@ */ +#ifndef CLIB_MARCH_VARIANT l2_rw_main_t l2_rw_main; - -vlib_node_registration_t l2_rw_node; +#endif /* CLIB_MARCH_VARIANT */ typedef struct { @@ -156,9 +156,8 @@ l2_rw_rewrite (l2_rw_entry_t * rwe, u8 * h) } } -static uword -l2_rw_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (l2_rw_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, vlib_frame_t * frame) { l2_rw_main_t *rw = &l2_rw_main; u32 n_left_from, *from, *to_next, next_index; @@ -347,6 +346,7 @@ l2_rw_node_fn (vlib_main_t * vm, return frame->n_vectors; } +#ifndef CLIB_MARCH_VARIANT int l2_rw_mod_entry (u32 * index, u8 * mask, u8 * value, u32 len, u32 skip, u8 is_del) @@ -395,6 +395,7 @@ l2_rw_mod_entry (u32 * index, return 0; } +#endif /* CLIB_MARCH_VARIANT */ static clib_error_t * l2_rw_entry_cli_fn (vlib_main_t * vm, @@ -453,6 +454,7 @@ VLIB_CLI_COMMAND (l2_rw_entry_cli, static) = { }; /* *INDENT-ON* */ +#ifndef CLIB_MARCH_VARIANT int l2_rw_interface_set_table (u32 sw_if_index, u32 table_index, u32 miss_index) { @@ -470,6 +472,7 @@ l2_rw_interface_set_table (u32 sw_if_index, u32 table_index, u32 miss_index) return 0; } +#endif /* CLIB_MARCH_VARIANT */ static clib_error_t * l2_rw_interface_cli_fn (vlib_main_t * vm, @@ -594,7 +597,7 @@ VLIB_CLI_COMMAND (l2_rw_show_entries_cli, static) = { }; /* *INDENT-ON* */ -int +static int l2_rw_enable_disable (u32 bridge_domain, u8 disable) { u32 mask = L2INPUT_FEAT_RW; @@ -686,7 +689,6 @@ static char *l2_rw_error_strings[] = { /* *INDENT-OFF* */ VLIB_REGISTER_NODE (l2_rw_node) = { - .function = l2_rw_node_fn, .name = "l2-rw", .vector_size = sizeof (u32), .format_trace = format_l2_rw_trace, @@ -699,7 +701,6 @@ VLIB_REGISTER_NODE (l2_rw_node) = { }; /* *INDENT-ON* */ -VLIB_NODE_FUNCTION_MULTIARCH (l2_rw_node, l2_rw_node_fn) /* * fd.io coding-style-patch-verification: ON * diff --git a/src/vnet/l2/l2_rw.h b/src/vnet/l2/l2_rw.h index 49aa25fb601..f9b10333f43 100644 --- a/src/vnet/l2/l2_rw.h +++ b/src/vnet/l2/l2_rw.h @@ -84,6 +84,8 @@ int l2_rw_interface_set_table (u32 sw_if_index, int l2_rw_mod_entry (u32 * index, u8 * mask, u8 * value, u32 len, u32 skip, u8 is_del); +extern vlib_node_registration_t l2_rw_node; + #endif /* L2_FW_H_ */ /* diff --git a/src/vnet/l2/l2_uu_fwd.c b/src/vnet/l2/l2_uu_fwd.c index fd79387bbe0..fb3571d159c 100644 --- a/src/vnet/l2/l2_uu_fwd.c +++ b/src/vnet/l2/l2_uu_fwd.c @@ -59,9 +59,9 @@ format_l2_uu_fwd_trace (u8 * s, va_list * args) return s; } -static uword -l2_uu_fwd_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (l2_uu_fwd_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, + vlib_frame_t * frame) { u32 n_left_from, *from, *to_next; l2_uu_fwd_next_t next_index; @@ -212,8 +212,7 @@ l2_uu_fwd_node_fn (vlib_main_t * vm, } /* *INDENT-OFF* */ -VLIB_REGISTER_NODE (l2_uu_fwd_node,static) = { - .function = l2_uu_fwd_node_fn, +VLIB_REGISTER_NODE (l2_uu_fwd_node) = { .name = "l2-uu-fwd", .vector_size = sizeof (u32), .format_trace = format_l2_uu_fwd_trace, @@ -229,8 +228,6 @@ VLIB_REGISTER_NODE (l2_uu_fwd_node,static) = { [L2_UU_FWD_NEXT_L2_OUTPUT] = "l2-output", }, }; - -VLIB_NODE_FUNCTION_MULTIARCH (l2_uu_fwd_node, l2_uu_fwd_node_fn) /* *INDENT-ON* */ /* diff --git a/src/vnet/l2/l2_xcrw.c b/src/vnet/l2/l2_xcrw.c index b7ccd81806f..1280b11e6b9 100644 --- a/src/vnet/l2/l2_xcrw.c +++ b/src/vnet/l2/l2_xcrw.c @@ -57,9 +57,11 @@ format_l2_xcrw_trace (u8 * s, va_list * args) return s; } -l2_xcrw_main_t l2_xcrw_main; +extern l2_xcrw_main_t l2_xcrw_main; -static vlib_node_registration_t l2_xcrw_node; +#ifndef CLIB_MARCH_VARIANT +l2_xcrw_main_t l2_xcrw_main; +#endif /* CLIB_MARCH_VARIANT */ static char *l2_xcrw_error_strings[] = { #define _(sym,string) string, @@ -67,9 +69,8 @@ static char *l2_xcrw_error_strings[] = { #undef _ }; -static uword -l2_xcrw_node_fn (vlib_main_t * vm, - vlib_node_runtime_t * node, vlib_frame_t * frame) +VLIB_NODE_FN (l2_xcrw_node) (vlib_main_t * vm, + vlib_node_runtime_t * node, vlib_frame_t * frame) { u32 n_left_from, *from, *to_next; l2_xcrw_next_t next_index; @@ -238,8 +239,7 @@ l2_xcrw_node_fn (vlib_main_t * vm, } /* *INDENT-OFF* */ -VLIB_REGISTER_NODE (l2_xcrw_node, static) = { - .function = l2_xcrw_node_fn, +VLIB_REGISTER_NODE (l2_xcrw_node) = { .name = "l2-xcrw", .vector_size = sizeof (u32), .format_trace = format_l2_xcrw_trace, @@ -257,8 +257,9 @@ VLIB_REGISTER_NODE (l2_xcrw_node, static) = { }; /* *INDENT-ON* */ -VLIB_NODE_FUNCTION_MULTIARCH (l2_xcrw_node, l2_xcrw_node_fn) - clib_error_t *l2_xcrw_init (vlib_main_t * vm) +#ifndef CLIB_MARCH_VARIANT +clib_error_t * +l2_xcrw_init (vlib_main_t * vm) { l2_xcrw_main_t *mp = &l2_xcrw_main; @@ -514,6 +515,8 @@ VLIB_CLI_COMMAND (set_l2_xcrw_command, static) = { }; /* *INDENT-ON* */ +#endif /* CLIB_MARCH_VARIANT */ + static u8 * format_l2xcrw (u8 * s, va_list * args) { diff --git a/src/vnet/l2/l2_xcrw.h b/src/vnet/l2/l2_xcrw.h index ca80aae9929..e21c884c401 100644 --- a/src/vnet/l2/l2_xcrw.h +++ b/src/vnet/l2/l2_xcrw.h @@ -80,6 +80,8 @@ typedef enum L2_XCRW_N_ERROR, } l2_xcrw_error_t; +extern vlib_node_registration_t l2_xcrw_node; + #endif /* __included_l2_xcrw_h__ */ /* -- cgit 1.2.3-korg