eal: add assert macro for debug
authorThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 22 Apr 2016 12:21:26 +0000 (14:21 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 2 May 2016 13:31:17 +0000 (15:31 +0200)
commit50705e8e3cdd261c1333ede1f449feb9c2c69893
tree24d06db5c709c44c5975e18f23f1f637463bae17
parent1f49ec153c8f91ee34c23e58c7443eb87f566b60
eal: add assert macro for debug

The macro RTE_VERIFY always checks a condition.
It is optimized with "unlikely" hint.
While this macro is well suited for test applications, it is preferred
in libraries and examples to enable such check in debug mode.
That's why the macro RTE_ASSERT is introduced to call RTE_VERIFY only
if built with debug logs enabled.

A lot of assert macros were duplicated and enabled with a specific flag.
Removing these #ifdef allows to test these code branches more easily
and avoid dead code pitfalls.

The ENA_ASSERT is kept (in debug mode only) because it has more
parameters to log.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
31 files changed:
doc/guides/sample_app_ug/ipv4_multicast.rst
drivers/net/bonding/rte_eth_bond_8023ad.c
drivers/net/bonding/rte_eth_bond_api.c
drivers/net/bonding/rte_eth_bond_pmd.c
drivers/net/ena/base/ena_plat_dpdk.h
drivers/net/enic/enic.h
drivers/net/enic/enic_rx.c
drivers/net/vmxnet3/vmxnet3_ethdev.h
drivers/net/vmxnet3/vmxnet3_rxtx.c
drivers/net/xenvirt/rte_mempool_gntalloc.c
examples/ipsec-secgw/esp.c
examples/ipsec-secgw/ipip.h
examples/ipsec-secgw/ipsec.c
examples/ipsec-secgw/ipsec.h
examples/ipv4_multicast/main.c
examples/performance-thread/common/lthread.c
examples/performance-thread/common/lthread_int.h
examples/performance-thread/common/lthread_mutex.c
examples/performance-thread/common/lthread_pool.h
examples/performance-thread/common/lthread_queue.h
examples/performance-thread/common/lthread_sched.c
examples/performance-thread/common/lthread_tls.c
lib/librte_eal/common/include/rte_debug.h
lib/librte_ip_frag/ip_frag_common.h
lib/librte_ip_frag/rte_ipv4_fragmentation.c
lib/librte_ip_frag/rte_ipv6_fragmentation.c
lib/librte_mbuf/rte_mbuf.c
lib/librte_mbuf/rte_mbuf.h
lib/librte_mempool/rte_mempool.c
lib/librte_sched/rte_red.c
lib/librte_sched/rte_red.h