[PATCH v13 19/21] table: convert RTE_LOGTYPE_TABLE to dynamic type
Stephen Hemminger
stephen at networkplumber.org
Mon Aug 21 18:09:19 CEST 2023
Make an alias for RTE_LOGTYPE_TABLE in rte_table.h
and use it.
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
lib/log/log.c | 1 -
lib/log/rte_log.h | 2 +-
lib/table/meson.build | 1 +
lib/table/rte_table.c | 8 ++++++++
lib/table/rte_table.h | 4 ++++
5 files changed, 14 insertions(+), 2 deletions(-)
create mode 100644 lib/table/rte_table.c
diff --git a/lib/log/log.c b/lib/log/log.c
index 3ce9300754dd..1ad2f80e67cc 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -353,7 +353,6 @@ struct logtype {
static const struct logtype logtype_strings[] = {
{RTE_LOGTYPE_EAL, "lib.eal"},
{RTE_LOGTYPE_PMD, "pmd"},
- {RTE_LOGTYPE_TABLE, "lib.table"},
{RTE_LOGTYPE_PIPELINE, "lib.pipeline"},
{RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"},
{RTE_LOGTYPE_EVENTDEV, "lib.eventdev"},
diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h
index 4d1b892ab689..6418479ee266 100644
--- a/lib/log/rte_log.h
+++ b/lib/log/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/meson.build b/lib/table/meson.build
index f8cef24b5918..e753b6fb23d8 100644
--- a/lib/table/meson.build
+++ b/lib/table/meson.build
@@ -7,6 +7,7 @@ sources = files(
'rte_swx_table_learner.c',
'rte_swx_table_selector.c',
'rte_swx_table_wm.c',
+ 'rte_table.c',
'rte_table_acl.c',
'rte_table_array.c',
'rte_table_hash_cuckoo.c',
diff --git a/lib/table/rte_table.c b/lib/table/rte_table.c
new file mode 100644
index 000000000000..4a083f4aaf0c
--- /dev/null
+++ b/lib/table/rte_table.c
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2014 Intel Corporation
+ */
+
+#include <rte_log.h>
+#include <rte_table.h>
+
+RTE_LOG_REGISTER_DEFAULT(table_logtype, INFO);
diff --git a/lib/table/rte_table.h b/lib/table/rte_table.h
index 9a5faf0e323a..39654e51e8b2 100644
--- a/lib/table/rte_table.h
+++ b/lib/table/rte_table.h
@@ -264,6 +264,10 @@ struct rte_table_ops {
rte_table_op_stats_read f_stats; /**< Stats */
};
+/** Internal Logtype used */
+extern int table_logtype;
+#define RTE_LOGTYPE_TABLE table_logtype
+
#ifdef __cplusplus
}
#endif
--
2.39.2
More information about the dev
mailing list