summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2023-12-04 18:09:56 -0800
committerDavid Marchand <david.marchand@redhat.com>2023-12-06 10:11:52 +0100
commit1acf14ca726d3441e5bfe2acfe82b1744e72e507 (patch)
tree2546b55bd1e4649ef78d2b97c4ce026290222c42 /lib
parent8f9c9288500ec216aa8b61ad42192298c5f08c21 (diff)
hash: use dynamic logtypes
Use dynamic type for hash and add subtypes for crc and gfni. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/hash/rte_cuckoo_hash.c5
-rw-r--r--lib/hash/rte_fbk_hash.c3
-rw-r--r--lib/hash/rte_thash.c3
-rw-r--r--lib/hash/rte_thash_gfni.c3
-rw-r--r--lib/log/log.c1
-rw-r--r--lib/log/rte_log.h2
6 files changed, 15 insertions, 2 deletions
diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index ccdc3b9894..8e4364f060 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -24,6 +24,11 @@
#include <rte_tailq.h>
#include "rte_hash.h"
+
+/* needs to be before rte_cuckoo_hash.h */
+RTE_LOG_REGISTER_DEFAULT(hash_logtype, INFO);
+#define RTE_LOGTYPE_HASH hash_logtype
+
#include "rte_cuckoo_hash.h"
/* Mask of all flags supported by this version */
diff --git a/lib/hash/rte_fbk_hash.c b/lib/hash/rte_fbk_hash.c
index c46bf3f8b9..faeb50cd89 100644
--- a/lib/hash/rte_fbk_hash.c
+++ b/lib/hash/rte_fbk_hash.c
@@ -19,6 +19,9 @@
#include "rte_fbk_hash.h"
+RTE_LOG_REGISTER_SUFFIX(fbk_hash_logtype, fbk, INFO);
+#define RTE_LOGTYPE_HASH fbk_hash_logtype
+
TAILQ_HEAD(rte_fbk_hash_list, rte_tailq_entry);
static struct rte_tailq_elem rte_fbk_hash_tailq = {
diff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c
index 4ff567ee5a..d819dddd84 100644
--- a/lib/hash/rte_thash.c
+++ b/lib/hash/rte_thash.c
@@ -13,6 +13,9 @@
#include <rte_log.h>
#include <rte_malloc.h>
+RTE_LOG_REGISTER_SUFFIX(thash_logtype, thash, INFO);
+#define RTE_LOGTYPE_HASH thash_logtype
+
#define THASH_NAME_LEN 64
#define TOEPLITZ_HASH_LEN 32
diff --git a/lib/hash/rte_thash_gfni.c b/lib/hash/rte_thash_gfni.c
index e148fada62..c863789b51 100644
--- a/lib/hash/rte_thash_gfni.c
+++ b/lib/hash/rte_thash_gfni.c
@@ -9,6 +9,9 @@
#ifndef RTE_THASH_GFNI_DEFINED
+RTE_LOG_REGISTER_SUFFIX(hash_gfni_logtype, gfni, INFO);
+#define RTE_LOGTYPE_HASH hash_gfni_logtype
+
uint32_t
rte_thash_gfni(const uint64_t *mtrx __rte_unused,
const uint8_t *key __rte_unused, int len __rte_unused)
diff --git a/lib/log/log.c b/lib/log/log.c
index 06486a00fa..5404c790dd 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -356,7 +356,6 @@ static const struct logtype logtype_strings[] = {
{RTE_LOGTYPE_MEMPOOL, "lib.mempool"},
{RTE_LOGTYPE_TIMER, "lib.timer"},
{RTE_LOGTYPE_PMD, "pmd"},
- {RTE_LOGTYPE_HASH, "lib.hash"},
{RTE_LOGTYPE_LPM, "lib.lpm"},
{RTE_LOGTYPE_POWER, "lib.power"},
{RTE_LOGTYPE_METER, "lib.meter"},
diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 679fd2fd86..529ec729a8 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/rte_log.h
@@ -32,7 +32,7 @@ extern "C" {
#define RTE_LOGTYPE_MEMPOOL 3 /**< Log related to mempool. */
#define RTE_LOGTYPE_TIMER 4 /**< Log related to timers. */
#define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */
-#define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */
+ /* was RTE_LOGTYPE_HASH */
#define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */
/* was RTE_LOGTYPE_KNI */
/* was RTE_LOGTYPE_ACL */