Imported Upstream version 16.07-rc1
[deb_dpdk.git] / drivers / net / ena / base / ena_plat_dpdk.h
index aab2ac8..5f69330 100644 (file)
@@ -93,14 +93,18 @@ typedef uint64_t dma_addr_t;
 #define ENA_GET_SYSTEM_USECS()                                         \
        (rte_get_timer_cycles() * US_PER_S / rte_get_timer_hz())
 
+#if RTE_LOG_LEVEL >= RTE_LOG_DEBUG
 #define ENA_ASSERT(cond, format, arg...)                               \
        do {                                                            \
                if (unlikely(!(cond))) {                                \
-                       printf("Assertion failed on %s:%s:%d: " format, \
-                       __FILE__, __func__, __LINE__, ##arg);           \
-                       rte_exit(EXIT_FAILURE, "ASSERTION FAILED\n");   \
+                       RTE_LOG(ERR, PMD, format, ##arg);               \
+                       rte_panic("line %d\tassert \"" #cond "\""       \
+                                       "failed\n", __LINE__);          \
                }                                                       \
        } while (0)
+#else
+#define ENA_ASSERT(cond, format, arg...) do {} while (0)
+#endif
 
 #define ENA_MAX32(x, y) RTE_MAX((x), (y))
 #define ENA_MAX16(x, y) RTE_MAX((x), (y))