[dpdk-dev] [PATCH v1 09/17] lpm: replace library debug flag with global one

Lukasz Wojciechowski l.wojciechow at partner.samsung.com
Fri Apr 17 23:57:31 CEST 2020


Use global debug flag RTE_DEBUG instead of RTE_LIBRTE_LPM_DEBUG.
The old define is completely removed from source code and config.
Application of the flag in tests was also adjusted.

Signed-off-by: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
---
 app/test/test_lpm.c      | 2 +-
 config/common_base       | 1 -
 lib/librte_lpm/rte_lpm.c | 2 +-
 lib/librte_lpm/rte_lpm.h | 2 +-
 4 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c
index 3a3fd097f..339999e04 100644
--- a/app/test/test_lpm.c
+++ b/app/test/test_lpm.c
@@ -234,7 +234,7 @@ test4(void)
 int32_t
 test5(void)
 {
-#if defined(RTE_LIBRTE_LPM_DEBUG)
+#ifdef RTE_DEBUG
 	struct rte_lpm *lpm = NULL;
 	struct rte_lpm_config config;
 
diff --git a/config/common_base b/config/common_base
index 44a9ab75c..310d5ab24 100644
--- a/config/common_base
+++ b/config/common_base
@@ -933,7 +933,6 @@ CONFIG_RTE_LIBRTE_FIB=y
 # Compile librte_lpm
 #
 CONFIG_RTE_LIBRTE_LPM=y
-CONFIG_RTE_LIBRTE_LPM_DEBUG=n
 
 #
 # Compile librte_acl
diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
index 268756419..0907cf11c 100644
--- a/lib/librte_lpm/rte_lpm.c
+++ b/lib/librte_lpm/rte_lpm.c
@@ -40,7 +40,7 @@ enum valid_flag {
 };
 
 /* Macro to enable/disable run-time checks. */
-#if defined(RTE_LIBRTE_LPM_DEBUG)
+#ifdef RTE_DEBUG
 #include <rte_debug.h>
 #define VERIFY_DEPTH(depth) do {                                \
 	if ((depth == 0) || (depth > RTE_LPM_MAX_DEPTH))        \
diff --git a/lib/librte_lpm/rte_lpm.h b/lib/librte_lpm/rte_lpm.h
index b9d49ac87..350fa6bc8 100644
--- a/lib/librte_lpm/rte_lpm.h
+++ b/lib/librte_lpm/rte_lpm.h
@@ -48,7 +48,7 @@ extern "C" {
 					RTE_LPM_TBL8_GROUP_NUM_ENTRIES)
 
 /** @internal Macro to enable/disable run-time checks. */
-#if defined(RTE_LIBRTE_LPM_DEBUG)
+#ifdef RTE_DEBUG
 #define RTE_LPM_RETURN_IF_TRUE(cond, retval) do { \
 	if (cond) return (retval);                \
 } while (0)
-- 
2.17.1



More information about the dev mailing list