summaryrefslogtreecommitdiff
path: root/examples/ipv4_multicast
diff options
context:
space:
mode:
authorThomas Monjalon <thomas.monjalon@6wind.com>2016-04-22 14:21:26 +0200
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-05-02 15:31:17 +0200
commit50705e8e3cdd261c1333ede1f449feb9c2c69893 (patch)
tree24d06db5c709c44c5975e18f23f1f637463bae17 /examples/ipv4_multicast
parent1f49ec153c8f91ee34c23e58c7443eb87f566b60 (diff)
downloaddpdk-50705e8e3cdd261c1333ede1f449feb9c2c69893.zip
dpdk-50705e8e3cdd261c1333ede1f449feb9c2c69893.tar.gz
dpdk-50705e8e3cdd261c1333ede1f449feb9c2c69893.tar.xz
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>
Diffstat (limited to 'examples/ipv4_multicast')
-rw-r--r--examples/ipv4_multicast/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 96b4157..f013d92 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -321,7 +321,7 @@ mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr,
/* Construct Ethernet header. */
ethdr = (struct ether_hdr *)rte_pktmbuf_prepend(pkt, (uint16_t)sizeof(*ethdr));
- RTE_MBUF_ASSERT(ethdr != NULL);
+ RTE_ASSERT(ethdr != NULL);
ether_addr_copy(dest_addr, &ethdr->d_addr);
ether_addr_copy(&ports_eth_addr[port], &ethdr->s_addr);
@@ -353,7 +353,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf)
/* Remove the Ethernet header from the input packet */
iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr));
- RTE_MBUF_ASSERT(iphdr != NULL);
+ RTE_ASSERT(iphdr != NULL);
dest_addr = rte_be_to_cpu_32(iphdr->dst_addr);