Split lpm and lpm6 into separate log types since they
are in different files and user may want to change log
levels for IPv4 vs IPv6.
For rib and fib libraries give them own types as well.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/eal/common/eal_common_log.c | 1 -
lib/eal/include/rte_log.h | 2 +-
lib/fib/fib_log.h | 4 ++++
lib/fib/rte_fib.c | 3 +++
lib/fib/rte_fib6.c | 2 ++
lib/lpm/lpm_log.h | 4 ++++
lib/lpm/rte_lpm.c | 3 +++
lib/lpm/rte_lpm6.c | 1 +
lib/rib/rib_log.h | 4 ++++
lib/rib/rte_rib.c | 3 +++
lib/rib/rte_rib6.c | 3 +++
11 files changed, 28 insertions(+), 2 deletions(-)
create mode 100644 lib/fib/fib_log.h
create mode 100644 lib/lpm/lpm_log.h
create mode 100644 lib/rib/rib_log.h
@@ -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_LPM, "lib.lpm"},
{RTE_LOGTYPE_KNI, "lib.kni"},
{RTE_LOGTYPE_METER, "lib.meter"},
{RTE_LOGTYPE_SCHED, "lib.sched"},
@@ -33,7 +33,7 @@ extern "C" {
/* was RTE_LOGTYPE_TIMER */
#define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */
#define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */
-#define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */
+ /* was RTE_LOGTYPE_LPM */
#define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */
/* was RTE_LOGTYPE_ACL */
/* was RTE_LOGTYPE_POWER */
new file mode 100644
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+
+extern int fib_logtype;
+#define RTE_LOGTYPE_LPM fib_logtype
@@ -16,6 +16,9 @@
#include <rte_fib.h>
#include "dir24_8.h"
+#include "fib_log.h"
+
+RTE_LOG_REGISTER_DEFAULT(fib_logtype, INFO);
TAILQ_HEAD(rte_fib_list, rte_tailq_entry);
static struct rte_tailq_elem rte_fib_tailq = {
@@ -9,6 +9,7 @@
#include <rte_eal_memconfig.h>
#include <rte_tailq.h>
#include <rte_errno.h>
+#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_string_fns.h>
@@ -16,6 +17,7 @@
#include <rte_fib6.h>
#include "trie.h"
+#include "fib_log.h"
TAILQ_HEAD(rte_fib6_list, rte_tailq_entry);
static struct rte_tailq_elem rte_fib6_tailq = {
new file mode 100644
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+
+extern int lpm_logtype;
+#define RTE_LOGTYPE_LPM lpm_logtype
@@ -18,6 +18,9 @@
#include <rte_tailq.h>
#include "rte_lpm.h"
+#include "lpm_log.h"
+
+RTE_LOG_REGISTER_DEFAULT(lpm_logtype, INFO);
TAILQ_HEAD(rte_lpm_list, rte_tailq_entry);
@@ -20,6 +20,7 @@
#include <rte_tailq.h>
#include "rte_lpm6.h"
+#include "lpm_log.h"
#define RTE_LPM6_TBL24_NUM_ENTRIES (1 << 24)
#define RTE_LPM6_TBL8_GROUP_NUM_ENTRIES 256
new file mode 100644
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+
+extern int rib_logtype;
+#define RTE_LOGTYPE_LPM rib_logtype
@@ -15,6 +15,9 @@
#include <rte_rib.h>
+RTE_LOG_REGISTER_DEFAULT(rib_logtype, INFO);
+#define RTE_LOGTYPE_LPM rib_logtype
+
TAILQ_HEAD(rte_rib_list, rte_tailq_entry);
static struct rte_tailq_elem rte_rib_tailq = {
.name = "RTE_RIB",
@@ -8,6 +8,7 @@
#include <rte_eal_memconfig.h>
#include <rte_errno.h>
+#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_mempool.h>
#include <rte_string_fns.h>
@@ -15,6 +16,8 @@
#include <rte_rib6.h>
+#include "rib_log.h"
+
#define RTE_RIB_VALID_NODE 1
#define RIB6_MAXDEPTH 128
/* Maximum length of a RIB6 name. */