@@ -17,7 +17,13 @@ indirect_headers += files(
'rte_thash_x86_gfni.h',
)
-sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c', 'rte_thash.c')
+sources = files(
+ 'rte_cuckoo_hash.c',
+ 'rte_fbk_hash.c',
+ 'rte_thash.c',
+ 'rte_thash_gfni.c'
+)
+
deps += ['net']
deps += ['ring']
deps += ['rcu']
new file mode 100644
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2021 Intel Corporation
+ */
+
+#include <stdbool.h>
+
+#include <rte_compat.h>
+#include <rte_log.h>
+#include <rte_thash_gfni.h>
+
+#ifndef RTE_THASH_GFNI_DEFINED
+
+uint32_t
+rte_thash_gfni(const uint64_t *mtrx __rte_unused,
+ const uint8_t *key __rte_unused, int len __rte_unused)
+{
+ static bool warned;
+
+ if (!warned) {
+ warned = true;
+ RTE_LOG(ERR, HASH,
+ "%s is undefined under given arch\n", __func__);
+ }
+
+ return 0;
+}
+
+void
+rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused,
+ int len __rte_unused, uint8_t *tuple[] __rte_unused,
+ uint32_t val[], uint32_t num)
+{
+ unsigned int i;
+
+ static bool warned;
+
+ if (!warned) {
+ warned = true;
+ RTE_LOG(ERR, HASH,
+ "%s is undefined under given arch\n", __func__);
+ }
+
+ for (i = 0; i < num; i++)
+ val[i] = 0;
+}
+
+#endif
@@ -9,13 +9,8 @@
extern "C" {
#endif
-#include <rte_compat.h>
-#include <rte_log.h>
-
#ifdef RTE_ARCH_X86
-
#include <rte_thash_x86_gfni.h>
-
#endif
#ifndef RTE_THASH_GFNI_DEFINED
@@ -38,13 +33,8 @@ extern "C" {
* Calculated Toeplitz hash value.
*/
__rte_experimental
-static inline uint32_t
-rte_thash_gfni(const uint64_t *mtrx __rte_unused,
- const uint8_t *key __rte_unused, int len __rte_unused)
-{
- RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__);
- return 0;
-}
+uint32_t
+rte_thash_gfni(const uint64_t *mtrx, const uint8_t *key, int len);
/**
* Bulk implementation for Toeplitz hash.
@@ -67,17 +57,9 @@ rte_thash_gfni(const uint64_t *mtrx __rte_unused,
* Number of tuples to hash.
*/
__rte_experimental
-static inline void
-rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused,
- int len __rte_unused, uint8_t *tuple[] __rte_unused,
- uint32_t val[], uint32_t num)
-{
- unsigned int i;
-
- RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__);
- for (i = 0; i < num; i++)
- val[i] = 0;
-}
+void
+rte_thash_gfni_bulk(const uint64_t *mtrx, int len, uint8_t *tuple[],
+ uint32_t val[], uint32_t num);
#endif /* RTE_THASH_GFNI_DEFINED */
@@ -51,4 +51,8 @@ EXPERIMENTAL {
rte_thash_complete_matrix;
rte_thash_get_gfni_matrices;
rte_thash_gfni_supported;
+
+ # added in 22.07
+ rte_thash_gfni;
+ rte_thash_gfni_bulk;
};