bus/dpaa: add DPAA PMD logging macros
authorShreyansh Jain <shreyansh.jain@nxp.com>
Thu, 28 Sep 2017 12:29:41 +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 dc2b3ad..7ae5bfa 100644 (file)
@@ -71,6 +71,7 @@
 
 int dpaa_logtype_bus;
 int dpaa_logtype_mempool;
+int dpaa_logtype_pmd;
 
 struct rte_dpaa_bus rte_dpaa_bus;
 struct netcfg_info *dpaa_netcfg;
@@ -457,4 +458,8 @@ dpaa_init_log(void)
        dpaa_logtype_mempool = rte_log_register("mempool.dpaa");
        if (dpaa_logtype_mempool >= 0)
                rte_log_set_level(dpaa_logtype_mempool, RTE_LOG_NOTICE);
+
+       dpaa_logtype_pmd = rte_log_register("pmd.dpaa");
+       if (dpaa_logtype_pmd >= 0)
+               rte_log_set_level(dpaa_logtype_pmd, RTE_LOG_NOTICE);
 }
index a2394b8..64a05a9 100644 (file)
@@ -9,6 +9,7 @@ DPDK_17.11 {
        bman_query_free_buffers;
        bman_release;
        dpaa_logtype_mempool;
+       dpaa_logtype_pmd;
        dpaa_netcfg;
        fman_ccsr_map_fd;
        fman_dealloc_bufs_mask_hi;
index 5335fd8..037c96b 100644 (file)
@@ -37,6 +37,7 @@
 
 extern int dpaa_logtype_bus;
 extern int dpaa_logtype_mempool;
+extern int dpaa_logtype_pmd;
 
 #define DPAA_BUS_LOG(level, fmt, args...) \
        rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "%s(): " fmt "\n", \
@@ -82,4 +83,25 @@ extern int dpaa_logtype_mempool;
 #define DPAA_MEMPOOL_WARN(fmt, args...) \
        DPAA_MEMPOOL_LOG(WARNING, fmt, ## args)
 
+/* PMD related logs */
+
+#define DPAA_PMD_LOG(level, fmt, args...) \
+       rte_log(RTE_LOG_ ## level, dpaa_logtype_pmd, "%s(): " fmt "\n", \
+               __func__, ##args)
+
+#define PMD_INIT_FUNC_TRACE() DPAA_PMD_LOG(DEBUG, " >>")
+
+#define DPAA_PMD_DEBUG(fmt, args...) \
+       DPAA_PMD_LOG(DEBUG, fmt, ## args)
+#define DPAA_PMD_ERR(fmt, args...) \
+       DPAA_PMD_LOG(ERR, fmt, ## args)
+#define DPAA_PMD_INFO(fmt, args...) \
+       DPAA_PMD_LOG(INFO, fmt, ## args)
+#define DPAA_PMD_WARN(fmt, args...) \
+       DPAA_PMD_LOG(WARNING, fmt, ## args)
+
+/* DP Logs, toggled out at compile time if level lower than current level */
+#define DPAA_DP_LOG(level, fmt, args...) \
+       RTE_LOG_DP(level, PMD, fmt, ## args)
+
 #endif /* _DPAA_LOGS_H_ */