bus/dpaa: add DPAA mempool logging macros
authorShreyansh Jain <shreyansh.jain@nxp.com>
Thu, 28 Sep 2017 12:29:38 +0000 (17:59 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:50 +0000 (02:49 +0200)
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
drivers/bus/dpaa/dpaa_bus.c
drivers/bus/dpaa/rte_bus_dpaa_version.map
drivers/bus/dpaa/rte_dpaa_logs.h

index 8017df3..dc2b3ad 100644 (file)
@@ -70,6 +70,7 @@
 #include <netcfg.h>
 
 int dpaa_logtype_bus;
+int dpaa_logtype_mempool;
 
 struct rte_dpaa_bus rte_dpaa_bus;
 struct netcfg_info *dpaa_netcfg;
@@ -452,4 +453,8 @@ dpaa_init_log(void)
        dpaa_logtype_bus = rte_log_register("bus.dpaa");
        if (dpaa_logtype_bus >= 0)
                rte_log_set_level(dpaa_logtype_bus, RTE_LOG_NOTICE);
+
+       dpaa_logtype_mempool = rte_log_register("mempool.dpaa");
+       if (dpaa_logtype_mempool >= 0)
+               rte_log_set_level(dpaa_logtype_mempool, RTE_LOG_NOTICE);
 }
index 853bc47..a2394b8 100644 (file)
@@ -8,6 +8,7 @@ DPDK_17.11 {
        bman_new_pool;
        bman_query_free_buffers;
        bman_release;
+       dpaa_logtype_mempool;
        dpaa_netcfg;
        fman_ccsr_map_fd;
        fman_dealloc_bufs_mask_hi;
index cc10937..5335fd8 100644 (file)
@@ -36,6 +36,7 @@
 #include <rte_log.h>
 
 extern int dpaa_logtype_bus;
+extern int dpaa_logtype_mempool;
 
 #define DPAA_BUS_LOG(level, fmt, args...) \
        rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "%s(): " fmt "\n", \
@@ -62,4 +63,23 @@ extern int dpaa_logtype_bus;
 #define DPAA_BUS_WARN(fmt, args...) \
        DPAA_BUS_LOG(WARNING, fmt, ## args)
 
+/* Mempool related logs */
+
+#define DPAA_MEMPOOL_LOG(level, fmt, args...) \
+       rte_log(RTE_LOG_ ## level, dpaa_logtype_mempool, "%s(): " fmt "\n", \
+               __func__, ##args)
+
+#define MEMPOOL_INIT_FUNC_TRACE() DPAA_MEMPOOL_LOG(DEBUG, " >>")
+
+#define DPAA_MEMPOOL_DPDEBUG(fmt, args...) \
+       RTE_LOG_DP(DEBUG, PMD, fmt, ## args)
+#define DPAA_MEMPOOL_DEBUG(fmt, args...) \
+       DPAA_MEMPOOL_LOG(DEBUG, fmt, ## args)
+#define DPAA_MEMPOOL_ERR(fmt, args...) \
+       DPAA_MEMPOOL_LOG(ERR, fmt, ## args)
+#define DPAA_MEMPOOL_INFO(fmt, args...) \
+       DPAA_MEMPOOL_LOG(INFO, fmt, ## args)
+#define DPAA_MEMPOOL_WARN(fmt, args...) \
+       DPAA_MEMPOOL_LOG(WARNING, fmt, ## args)
+
 #endif /* _DPAA_LOGS_H_ */