aboutsummaryrefslogtreecommitdiffstats
path: root/lib/librte_efd/rte_efd.c
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2017-08-16 18:42:05 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2017-08-16 18:46:04 +0100
commitf239aed5e674965691846e8ce3f187dd47523689 (patch)
treea153a3125c6e183c73871a8ecaa4b285fed5fbd5 /lib/librte_efd/rte_efd.c
parentbf7567fd2a5b0b28ab724046143c24561d38d015 (diff)
New upstream version 17.08
Change-Id: I288b50990f52646089d6b1f3aaa6ba2f091a51d7 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'lib/librte_efd/rte_efd.c')
-rw-r--r--lib/librte_efd/rte_efd.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c
index f601d62e..4d9a0887 100644
--- a/lib/librte_efd/rte_efd.c
+++ b/lib/librte_efd/rte_efd.c
@@ -53,6 +53,8 @@
#include "rte_efd.h"
#if defined(RTE_ARCH_X86)
#include "rte_efd_x86.h"
+#elif defined(RTE_ARCH_ARM64)
+#include "rte_efd_arm64.h"
#endif
#define EFD_KEY(key_idx, table) (table->keys + ((key_idx) * table->key_len))
@@ -103,6 +105,7 @@ allocated memory
enum efd_lookup_internal_function {
EFD_LOOKUP_SCALAR = 0,
EFD_LOOKUP_AVX2,
+ EFD_LOOKUP_NEON,
EFD_LOOKUP_NUM
};
@@ -674,6 +677,16 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,
table->lookup_fn = EFD_LOOKUP_AVX2;
else
#endif
+#if defined(RTE_ARCH_ARM64)
+ /*
+ * For less than or equal to 16 bits, scalar function performs better
+ * than vectorised version
+ */
+ if (RTE_EFD_VALUE_NUM_BITS > 16 &&
+ rte_cpu_get_flag_enabled(RTE_CPUFLAG_NEON))
+ table->lookup_fn = EFD_LOOKUP_NEON;
+ else
+#endif
table->lookup_fn = EFD_LOOKUP_SCALAR;
/*
@@ -1271,6 +1284,15 @@ efd_lookup_internal(const struct efd_online_group_entry * const group,
group->lookup_table,
hash_val_a,
hash_val_b);
+ break;
+#endif
+#if defined(RTE_ARCH_ARM64)
+ case EFD_LOOKUP_NEON:
+ return efd_lookup_internal_neon(group->hash_idx,
+ group->lookup_table,
+ hash_val_a,
+ hash_val_b);
+ break;
#endif
case EFD_LOOKUP_SCALAR:
/* Fall-through */