[PATCH v10 17/22] table: convert RTE_LOGTYPE_TABLE to dynamic logtype
Stephen Hemminger
stephen at networkplumber.org
Wed Feb 22 17:07:57 CET 2023
Use logtype suffixes for various components of this library.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
lib/eal/common/eal_common_log.c | 1 -
lib/eal/include/rte_log.h | 2 +-
lib/table/rte_table_acl.c | 3 +++
lib/table/rte_table_array.c | 3 +++
lib/table/rte_table_hash_cuckoo.c | 3 +++
lib/table/rte_table_hash_ext.c | 3 +++
lib/table/rte_table_hash_key16.c | 3 +++
lib/table/rte_table_hash_key32.c | 5 ++++-
lib/table/rte_table_hash_key8.c | 5 ++++-
lib/table/rte_table_hash_lru.c | 3 +++
lib/table/rte_table_lpm.c | 3 +++
lib/table/rte_table_lpm_ipv6.c | 3 +++
lib/table/rte_table_stub.c | 3 +++
13 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c
index 7f1d2c8a256d..d640ed3c88b9 100644
--- a/lib/eal/common/eal_common_log.c
+++ b/lib/eal/common/eal_common_log.c
@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = {
{RTE_LOGTYPE_EAL, "lib.eal"},
{RTE_LOGTYPE_PMD, "pmd"},
{RTE_LOGTYPE_HASH, "lib.hash"},
- {RTE_LOGTYPE_TABLE, "lib.table"},
{RTE_LOGTYPE_PIPELINE, "lib.pipeline"},
{RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"},
{RTE_LOGTYPE_EVENTDEV, "lib.eventdev"},
diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h
index b11aec69af78..934bddff9dfa 100644
--- a/lib/eal/include/rte_log.h
+++ b/lib/eal/include/rte_log.h
@@ -40,7 +40,7 @@ extern "C" {
/* was RTE_LOGTYPE_METER */
/* was RTE_LOGTYPE_SCHED */
/* was RTE_LOGTYPE_PORT */
-#define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */
+ /* was RTE_LOGTYPE_TABLE */
#define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */
/* was RTE_LOGTYPE_MBUF */
#define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */
diff --git a/lib/table/rte_table_acl.c b/lib/table/rte_table_acl.c
index 53fd5c66adb5..f44a25a89405 100644
--- a/lib/table/rte_table_acl.c
+++ b/lib/table/rte_table_acl.c
@@ -11,6 +11,9 @@
#include "rte_table_acl.h"
+RTE_LOG_REGISTER_SUFFIX(table_acl_logtype, acl, INFO);
+#define RTE_LOGTYPE_TABLE table_acl_logtype
+
#ifdef RTE_TABLE_STATS_COLLECT
#define RTE_TABLE_ACL_STATS_PKTS_IN_ADD(table, val) \
diff --git a/lib/table/rte_table_array.c b/lib/table/rte_table_array.c
index 54a0c42f7dd2..a7849beaecd6 100644
--- a/lib/table/rte_table_array.c
+++ b/lib/table/rte_table_array.c
@@ -11,6 +11,9 @@
#include "rte_table_array.h"
+RTE_LOG_REGISTER_SUFFIX(table_array_logtype, array, INFO);
+#define RTE_LOGTYPE_TABLE table_array_logtype
+
#ifdef RTE_TABLE_STATS_COLLECT
#define RTE_TABLE_ARRAY_STATS_PKTS_IN_ADD(table, val) \
diff --git a/lib/table/rte_table_hash_cuckoo.c b/lib/table/rte_table_hash_cuckoo.c
index c77eccf52722..12db0b84142f 100644
--- a/lib/table/rte_table_hash_cuckoo.c
+++ b/lib/table/rte_table_hash_cuckoo.c
@@ -10,6 +10,9 @@
#include "rte_table_hash_cuckoo.h"
+RTE_LOG_REGISTER_SUFFIX(table_hash_logtype, hash, INFO);
+#define RTE_LOGTYPE_TABLE table_hash_logtype
+
#ifdef RTE_TABLE_STATS_COLLECT
#define RTE_TABLE_HASH_CUCKOO_STATS_PKTS_IN_ADD(table, val) \
diff --git a/lib/table/rte_table_hash_ext.c b/lib/table/rte_table_hash_ext.c
index 70ea84fa2e51..147ecdf082cb 100644
--- a/lib/table/rte_table_hash_ext.c
+++ b/lib/table/rte_table_hash_ext.c
@@ -11,6 +11,9 @@
#include "rte_table_hash.h"
+RTE_LOG_REGISTER_SUFFIX(table_hash_ext_logtype, hash.ext, INFO);
+#define RTE_LOGTYPE_TABLE table_hash_ext_logtype
+
#define KEYS_PER_BUCKET 4
struct bucket {
diff --git a/lib/table/rte_table_hash_key16.c b/lib/table/rte_table_hash_key16.c
index 04d7fd64bd97..09fef5f14ce7 100644
--- a/lib/table/rte_table_hash_key16.c
+++ b/lib/table/rte_table_hash_key16.c
@@ -11,6 +11,9 @@
#include "rte_table_hash.h"
#include "rte_lru.h"
+RTE_LOG_REGISTER_SUFFIX(table_hash16_logtype, hash16, INFO);
+#define RTE_LOGTYPE_TABLE table_hash16_logtype
+
#define KEY_SIZE 16
#define KEYS_PER_BUCKET 4
diff --git a/lib/table/rte_table_hash_key32.c b/lib/table/rte_table_hash_key32.c
index 88d8f69c72ed..1abc459eee87 100644
--- a/lib/table/rte_table_hash_key32.c
+++ b/lib/table/rte_table_hash_key32.c
@@ -11,7 +11,10 @@
#include "rte_table_hash.h"
#include "rte_lru.h"
-#define KEY_SIZE 32
+RTE_LOG_REGISTER_SUFFIX(table_hash32_logtype, hash32, INFO);
+#define RTE_LOGTYPE_TABLE table_hash32_logtype
+
+#define KEY_SIZE 32
#define KEYS_PER_BUCKET 4
diff --git a/lib/table/rte_table_hash_key8.c b/lib/table/rte_table_hash_key8.c
index 035d24276946..d4ccccbcdf9e 100644
--- a/lib/table/rte_table_hash_key8.c
+++ b/lib/table/rte_table_hash_key8.c
@@ -11,7 +11,10 @@
#include "rte_table_hash.h"
#include "rte_lru.h"
-#define KEY_SIZE 8
+RTE_LOG_REGISTER_SUFFIX(table_hash8_logtype, hash8, INFO);
+#define RTE_LOGTYPE_TABLE table_hash8_logtype
+
+#define KEY_SIZE 8
#define KEYS_PER_BUCKET 4
diff --git a/lib/table/rte_table_hash_lru.c b/lib/table/rte_table_hash_lru.c
index c31acc11cf23..d0d2c8ba44df 100644
--- a/lib/table/rte_table_hash_lru.c
+++ b/lib/table/rte_table_hash_lru.c
@@ -14,6 +14,9 @@
#define KEYS_PER_BUCKET 4
+RTE_LOG_REGISTER_SUFFIX(table_hash_lru_logtype, hash_lru, INFO);
+#define RTE_LOGTYPE_TABLE table_hash_lru_logtype
+
#ifdef RTE_TABLE_STATS_COLLECT
#define RTE_TABLE_HASH_LRU_STATS_PKTS_IN_ADD(table, val) \
diff --git a/lib/table/rte_table_lpm.c b/lib/table/rte_table_lpm.c
index 9de9e8a20d77..4a5c4a343c77 100644
--- a/lib/table/rte_table_lpm.c
+++ b/lib/table/rte_table_lpm.c
@@ -13,6 +13,9 @@
#include "rte_table_lpm.h"
+RTE_LOG_REGISTER_SUFFIX(table_lpm_logtype, lpm, INFO);
+#define RTE_LOGTYPE_TABLE table_lpm_logtype
+
#ifndef RTE_TABLE_LPM_MAX_NEXT_HOPS
#define RTE_TABLE_LPM_MAX_NEXT_HOPS 65536
#endif
diff --git a/lib/table/rte_table_lpm_ipv6.c b/lib/table/rte_table_lpm_ipv6.c
index 8fde2c012f7c..236eac4238d9 100644
--- a/lib/table/rte_table_lpm_ipv6.c
+++ b/lib/table/rte_table_lpm_ipv6.c
@@ -12,6 +12,9 @@
#include "rte_table_lpm_ipv6.h"
+RTE_LOG_REGISTER_SUFFIX(table_lpm6_logtype, lpm6, INFO);
+#define RTE_LOGTYPE_TABLE table_lpm6_logtype
+
#define RTE_TABLE_LPM_MAX_NEXT_HOPS 256
#ifdef RTE_TABLE_STATS_COLLECT
diff --git a/lib/table/rte_table_stub.c b/lib/table/rte_table_stub.c
index 23d0de5c79b0..e74044032f7d 100644
--- a/lib/table/rte_table_stub.c
+++ b/lib/table/rte_table_stub.c
@@ -8,6 +8,9 @@
#include "rte_table_stub.h"
+RTE_LOG_REGISTER_SUFFIX(table_stub_logtype, stub, INFO);
+#define RTE_LOGTYPE_TABLE table_stub_logtype
+
#ifdef RTE_TABLE_STATS_COLLECT
#define RTE_TABLE_LPM_STATS_PKTS_IN_ADD(table, val) \
--
2.39.1
More information about the dev
mailing list