[v1,10/17] mbuf: replace library debug flag with global one

Message ID 20200417215739.23180-11-l.wojciechow@partner.samsung.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series introduce global debug flag |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Lukasz Wojciechowski April 17, 2020, 9:57 p.m. UTC
  Use global debug flag RTE_DEBUG instead of RTE_LIBRTE_MBUF_DEBUG.
The old define is completely removed from source code and config.
Tests and documentation were also updated.

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
---
 app/test/test_mbuf.c               | 2 +-
 config/common_base                 | 1 -
 doc/guides/prog_guide/mbuf_lib.rst | 2 +-
 lib/librte_mbuf/rte_mbuf.h         | 6 +++---
 4 files changed, 5 insertions(+), 6 deletions(-)
  

Patch

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 8200b4f71..0f0036c49 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -994,7 +994,7 @@  test_pktmbuf_free_segment(struct rte_mempool *pktmbuf_pool)
 /*
  * Stress test for rte_mbuf atomic refcnt.
  * Implies that RTE_MBUF_REFCNT_ATOMIC is defined.
- * For more efficiency, recommended to run with RTE_LIBRTE_MBUF_DEBUG defined.
+ * For more efficiency, recommended to run with RTE_DEBUG defined.
  */
 
 #ifdef RTE_MBUF_REFCNT_ATOMIC
diff --git a/config/common_base b/config/common_base
index 310d5ab24..c24086789 100644
--- a/config/common_base
+++ b/config/common_base
@@ -852,7 +852,6 @@  CONFIG_RTE_LIBRTE_OCTEONTX2_MEMPOOL=y
 # Compile librte_mbuf
 #
 CONFIG_RTE_LIBRTE_MBUF=y
-CONFIG_RTE_LIBRTE_MBUF_DEBUG=n
 CONFIG_RTE_MBUF_DEFAULT_MEMPOOL_OPS="ring_mp_mc"
 CONFIG_RTE_MBUF_REFCNT_ATOMIC=y
 CONFIG_RTE_PKTMBUF_HEADROOM=128
diff --git a/doc/guides/prog_guide/mbuf_lib.rst b/doc/guides/prog_guide/mbuf_lib.rst
index 0d3223b08..c04bb45d8 100644
--- a/doc/guides/prog_guide/mbuf_lib.rst
+++ b/doc/guides/prog_guide/mbuf_lib.rst
@@ -243,7 +243,7 @@  can be found in several of the sample applications, for example, the IPv4 Multic
 Debug
 -----
 
-In debug mode (CONFIG_RTE_MBUF_DEBUG is enabled),
+In debug mode (RTE_DEBUG is enabled, e.g. by using "debug" option during meson setup),
 the functions of the mbuf library perform sanity checks before any operation (such as, buffer corruption, bad type, and so on).
 
 Use Cases
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index f8e492e59..2deb309e0 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -341,17 +341,17 @@  rte_pktmbuf_priv_flags(struct rte_mempool *mp)
 #define RTE_MBUF_HAS_PINNED_EXTBUF(mb) \
 	(rte_pktmbuf_priv_flags(mb->pool) & RTE_PKTMBUF_POOL_F_PINNED_EXT_BUF)
 
-#ifdef RTE_LIBRTE_MBUF_DEBUG
+#ifdef RTE_DEBUG
 
 /**  check mbuf type in debug mode */
 #define __rte_mbuf_sanity_check(m, is_h) rte_mbuf_sanity_check(m, is_h)
 
-#else /*  RTE_LIBRTE_MBUF_DEBUG */
+#else /*  RTE_DEBUG */
 
 /**  check mbuf type in debug mode */
 #define __rte_mbuf_sanity_check(m, is_h) do { } while (0)
 
-#endif /*  RTE_LIBRTE_MBUF_DEBUG */
+#endif /*  RTE_DEBUG */
 
 #ifdef RTE_MBUF_REFCNT_ATOMIC