From a960306c0681b0e7d8514e073af9144054c8c317 Mon Sep 17 00:00:00 2001 From: Shreyansh Jain Date: Thu, 28 Sep 2017 17:59:41 +0530 Subject: [PATCH] bus/dpaa: add DPAA PMD logging macros Signed-off-by: Shreyansh Jain --- drivers/bus/dpaa/dpaa_bus.c | 5 +++++ drivers/bus/dpaa/rte_bus_dpaa_version.map | 1 + drivers/bus/dpaa/rte_dpaa_logs.h | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index dc2b3ad811..7ae5bfae80 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -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); } diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index a2394b8d60..64a05a9c81 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -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; diff --git a/drivers/bus/dpaa/rte_dpaa_logs.h b/drivers/bus/dpaa/rte_dpaa_logs.h index 5335fd86ba..037c96b031 100644 --- a/drivers/bus/dpaa/rte_dpaa_logs.h +++ b/drivers/bus/dpaa/rte_dpaa_logs.h @@ -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_ */