diff options
author | Damjan Marion <damarion@cisco.com> | 2018-05-28 21:26:47 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2018-05-29 17:00:26 +0000 |
commit | 812b32dd8f637118bf65de2cdff0e95b421a963b (patch) | |
tree | 184d57889b841958875d57c6503d8bfb96cdaec7 /src/plugins/dpdk/device | |
parent | 04e0bb2ff0f39dab45da01ecdbc7914035a36897 (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/plugins/dpdk/device')
-rw-r--r-- | src/plugins/dpdk/device/device.c | 6 | ||||
-rw-r--r-- | src/plugins/dpdk/device/node.c | 22 |
2 files changed, 6 insertions, 22 deletions
diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c index 5409fe4f50e..fe659fbeaf1 100644 --- a/src/plugins/dpdk/device/device.c +++ b/src/plugins/dpdk/device/device.c @@ -37,7 +37,7 @@ typedef enum DPDK_TX_FUNC_N_ERROR, } dpdk_tx_func_error_t; -#ifndef CLIB_MULTIARCH_VARIANT +#ifndef CLIB_MARCH_VARIANT static char *dpdk_tx_func_error_strings[] = { #define _(n,s) s, foreach_dpdk_tx_func_error @@ -517,7 +517,7 @@ CLIB_MULTIARCH_FN (dpdk_interface_tx) (vlib_main_t * vm, return tx_pkts; } -#ifndef CLIB_MULTIARCH_VARIANT +#ifndef CLIB_MARCH_VARIANT static void dpdk_clear_hw_interface_counters (u32 instance) { @@ -695,7 +695,7 @@ dpdk_interface_tx_multiarch_select (void) #define UP_DOWN_FLAG_EVENT 1 -#ifndef CLIB_MULTIARCH_VARIANT +#ifndef CLIB_MARCH_VARIANT uword admin_up_down_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f) diff --git a/src/plugins/dpdk/device/node.c b/src/plugins/dpdk/device/node.c index daccf733372..7f4b2cb8145 100644 --- a/src/plugins/dpdk/device/node.c +++ b/src/plugins/dpdk/device/node.c @@ -28,7 +28,7 @@ #include <dpdk/device/dpdk_priv.h> -#ifndef CLIB_MULTIARCH_VARIANT +#ifndef CLIB_MARCH_VARIANT static char *dpdk_error_strings[] = { #define _(n,s) s, foreach_dpdk_error @@ -636,8 +636,7 @@ dpdk_device_input (vlib_main_t * vm, dpdk_main_t * dm, dpdk_device_t * xd, return n_rx_packets; } -uword CLIB_CPU_OPTIMIZED -CLIB_MULTIARCH_FN (dpdk_input) (vlib_main_t * vm, vlib_node_runtime_t * node, +VLIB_NODE_FN (dpdk_input_node) (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * f) { dpdk_main_t *dm = &dpdk_main; @@ -666,10 +665,9 @@ CLIB_MULTIARCH_FN (dpdk_input) (vlib_main_t * vm, vlib_node_runtime_t * node, return n_rx_packets; } -#ifndef CLIB_MULTIARCH_VARIANT +#ifndef CLIB_MARCH_VARIANT /* *INDENT-OFF* */ VLIB_REGISTER_NODE (dpdk_input_node) = { - .function = dpdk_input, .type = VLIB_NODE_TYPE_INPUT, .name = "dpdk-input", .sibling_of = "device-input", @@ -684,20 +682,6 @@ VLIB_REGISTER_NODE (dpdk_input_node) = { .error_strings = dpdk_error_strings, }; /* *INDENT-ON* */ - -vlib_node_function_t __clib_weak dpdk_input_avx512; -vlib_node_function_t __clib_weak dpdk_input_avx2; - -#if __x86_64__ -static void __clib_constructor -dpdk_input_multiarch_select (void) -{ - if (dpdk_input_avx512 && clib_cpu_supports_avx512f ()) - dpdk_input_node.function = dpdk_input_avx512; - else if (dpdk_input_avx2 && clib_cpu_supports_avx2 ()) - dpdk_input_node.function = dpdk_input_avx2; -} -#endif #endif /* |