From d881b20a199187904486882ecef2a3d97bd06ae5 Mon Sep 17 00:00:00 2001 From: Shreyansh Jain Date: Thu, 28 Sep 2017 17:59:38 +0530 Subject: [PATCH] bus/dpaa: add DPAA mempool 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 | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 8017df3237..dc2b3ad811 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -70,6 +70,7 @@ #include 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); } diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 853bc47123..a2394b8d60 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -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; diff --git a/drivers/bus/dpaa/rte_dpaa_logs.h b/drivers/bus/dpaa/rte_dpaa_logs.h index cc10937d2c..5335fd86ba 100644 --- a/drivers/bus/dpaa/rte_dpaa_logs.h +++ b/drivers/bus/dpaa/rte_dpaa_logs.h @@ -36,6 +36,7 @@ #include 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_ */ -- 2.20.1