aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
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/ip
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/ip')
-rw-r--r--src/vnet/ip/ip4_input.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/src/vnet/ip/ip4_input.c b/src/vnet/ip/ip4_input.c
index 7af2bee187a..b476f95ab8b 100644
--- a/src/vnet/ip/ip4_input.c
+++ b/src/vnet/ip/ip4_input.c
@@ -47,7 +47,7 @@ typedef struct
u8 packet_data[64];
} ip4_input_trace_t;
-#ifndef CLIB_MULTIARCH_VARIANT
+#ifndef CLIB_MARCH_VARIANT
static u8 *
format_ip4_input_trace (u8 * s, va_list * va)
{
@@ -292,22 +292,20 @@ ip4_input_inline (vlib_main_t * vm,
<code> vnet_get_config_data (... &next0 ...); </code>
or @c error-drop
*/
-uword CLIB_CPU_OPTIMIZED
-CLIB_MULTIARCH_FN (ip4_input) (vlib_main_t * vm, vlib_node_runtime_t * node,
+VLIB_NODE_FN (ip4_input_node) (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * frame)
{
return ip4_input_inline (vm, node, frame, /* verify_checksum */ 1);
}
-uword CLIB_CPU_OPTIMIZED
-CLIB_MULTIARCH_FN (ip4_input_no_checksum) (vlib_main_t * vm,
+VLIB_NODE_FN (ip4_input_no_checksum_node) (vlib_main_t * vm,
vlib_node_runtime_t * node,
vlib_frame_t * frame)
{
return ip4_input_inline (vm, node, frame, /* verify_checksum */ 0);
}
-#ifndef CLIB_MULTIARCH_VARIANT
+#ifndef CLIB_MARCH_VARIANT
char *ip4_error_strings[] = {
#define _(sym,string) string,
foreach_ip4_error
@@ -316,7 +314,6 @@ char *ip4_error_strings[] = {
/* *INDENT-OFF* */
VLIB_REGISTER_NODE (ip4_input_node) = {
- .function = ip4_input,
.name = "ip4-input",
.vector_size = sizeof (u32),
@@ -337,8 +334,7 @@ VLIB_REGISTER_NODE (ip4_input_node) = {
.format_trace = format_ip4_input_trace,
};
-VLIB_REGISTER_NODE (ip4_input_no_checksum_node,static) = {
- .function = ip4_input_no_checksum,
+VLIB_REGISTER_NODE (ip4_input_no_checksum_node) = {
.name = "ip4-input-no-checksum",
.vector_size = sizeof (u32),
@@ -357,26 +353,6 @@ VLIB_REGISTER_NODE (ip4_input_no_checksum_node,static) = {
};
/* *INDENT-ON* */
-#if __x86_64__
-vlib_node_function_t __clib_weak ip4_input_avx512;
-vlib_node_function_t __clib_weak ip4_input_avx2;
-vlib_node_function_t __clib_weak ip4_input_no_checksum_avx512;
-vlib_node_function_t __clib_weak ip4_input_no_checksum_avx2;
-static void __clib_constructor
-ip4_input_multiarch_select (void)
-{
- if (ip4_input_no_checksum_avx512 && clib_cpu_supports_avx512f ())
- ip4_input_no_checksum_node.function = ip4_input_no_checksum_avx512;
- else if (ip4_input_no_checksum_avx2 && clib_cpu_supports_avx2 ())
- ip4_input_no_checksum_node.function = ip4_input_no_checksum_avx2;
-
- if (ip4_input_avx512 && clib_cpu_supports_avx512f ())
- ip4_input_node.function = ip4_input_avx512;
- else if (ip4_input_avx2 && clib_cpu_supports_avx2 ())
- ip4_input_node.function = ip4_input_avx2;
-}
-#endif
-
static clib_error_t *
ip4_init (vlib_main_t * vm)
{