aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/bonding/node.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-05-28 21:26:47 +0200
committerFlorin Coras <florin.coras@gmail.com>2018-05-29 17:00:26 +0000
commit812b32dd8f637118bf65de2cdff0e95b421a963b (patch)
tree184d57889b841958875d57c6503d8bfb96cdaec7 /src/vnet/bonding/node.c
parent04e0bb2ff0f39dab45da01ecdbc7914035a36897 (diff)
Add VLIB_NODE_FN() macro to simplify multiversioning of node functions
Change-Id: Ibab5e27277f618ceb2d543b9d6a1a5f191e7d1db Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/bonding/node.c')
-rw-r--r--src/vnet/bonding/node.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/vnet/bonding/node.c b/src/vnet/bonding/node.c
index df2da5c66fc..7d2acf7d0f7 100644
--- a/src/vnet/bonding/node.c
+++ b/src/vnet/bonding/node.c
@@ -36,7 +36,7 @@ typedef enum
BOND_INPUT_N_ERROR,
} bond_input_error_t;
-#ifndef CLIB_MULTIARCH_VARIANT
+#ifndef CLIB_MARCH_VARIANT
static char *bond_input_error_strings[] = {
#define _(n,s) s,
foreach_bond_input_error
@@ -172,10 +172,9 @@ bond_update_next (vlib_main_t * vm, vlib_node_runtime_t * node,
vnet_feature_next ( /* not used */ 0, next_index, b);
}
-uword CLIB_CPU_OPTIMIZED
-CLIB_MULTIARCH_FN (bond_input_fn) (vlib_main_t * vm,
- vlib_node_runtime_t * node,
- vlib_frame_t * frame)
+VLIB_NODE_FN (bond_input_node) (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
{
u16 thread_index = vlib_get_thread_index ();
u32 *from, n_left;
@@ -367,7 +366,7 @@ CLIB_MULTIARCH_FN (bond_input_fn) (vlib_main_t * vm,
return frame->n_vectors;
}
-#ifndef CLIB_MULTIARCH_VARIANT
+#ifndef CLIB_MARCH_VARIANT
static clib_error_t *
bond_input_init (vlib_main_t * vm)
{
@@ -376,7 +375,6 @@ bond_input_init (vlib_main_t * vm)
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (bond_input_node) = {
- .function = bond_input_fn,
.name = "bond-input",
.vector_size = sizeof (u32),
.format_buffer = format_ethernet_header_with_length,
@@ -391,20 +389,6 @@ VLIB_REGISTER_NODE (bond_input_node) = {
}
};
-#if __x86_64__
-vlib_node_function_t __clib_weak bond_input_fn_avx512;
-vlib_node_function_t __clib_weak bond_input_fn_avx2;
-static void __clib_constructor
-bond_input_multiarch_select (void)
-{
- if (bond_input_fn_avx512 && clib_cpu_supports_avx512f ())
- bond_input_node.function = bond_input_fn_avx512;
- else if (bond_input_fn_avx2 && clib_cpu_supports_avx2 ())
- bond_input_node.function = bond_input_fn_avx2;
-}
-#endif
-
-
VLIB_INIT_FUNCTION (bond_input_init);
VNET_FEATURE_INIT (bond_input, static) =