Skip to content

Commit

Permalink
hash: use dynamic logtypes
Browse files Browse the repository at this point in the history
Use dynamic type for hash and add subtypes for crc and gfni.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
  • Loading branch information
shemminger authored and david-marchand committed Dec 6, 2023
1 parent 8f9c928 commit 1acf14c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/hash/rte_cuckoo_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
3 changes: 3 additions & 0 deletions lib/hash/rte_fbk_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
3 changes: 3 additions & 0 deletions lib/hash/rte_thash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions lib/hash/rte_thash_gfni.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion lib/log/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
2 changes: 1 addition & 1 deletion lib/log/rte_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 1acf14c

Please sign in to comment.