From patchwork Thu May 14 14:29:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 186752 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1457864ilb; Thu, 14 May 2020 07:34:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsGsd8RiEwE4mfT43DezPllUlXAo5CPzAu1vVaWOqOFSi/S6myWg4CQs939+2bBy1VWgUP X-Received: by 2002:a05:6000:1009:: with SMTP id a9mr6223916wrx.403.1589466856733; Thu, 14 May 2020 07:34:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589466856; cv=none; d=google.com; s=arc-20160816; b=AOzvu44ZFo5Xshzf8zihq1y1mRKKgIihTrfnIeQk0I6eyEbWKevRbznM+JND1cEpXB 9P5unTxP3syPxVd/Qe6ENFaHOa0O+cCn9uKdbCTCL1A1zZpZzCf73itTGD4gTFiNuOtl /ENA+FAnFOxVur2uxe+dPiJWfeuO4Rxiu9ej6eBYWK90Y6GCVUO2T2M/C4xgkEHny7qT taKCPhDsQziWZdc8wkAxXTZYRJb9VzF9zV7/aFLnvw28tQj0qpQYmEFWLuSwiW4ZLZTf gxmX2zfDYVSgIpUsYEN5umQ18gxQF46ffHrHXV4Qox3DcYkB//931uG+NeOR4VpvoqwK qGeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=JhzOUBHl76wAiLDSvI+jFzNZ9Wil8r2yBGWK6WL5k1E=; b=hbr8RgXDVLGsx/QiSbfbpDC8P1jccuBQO1dmDxOKuwtX8PlmM7xvbR9bjDiT72gSZY 2P9W5uaUNq5vyCAdJYIqu5WCK4mVsIkCiDj5w6MQ/UNpd06ugQa7z0Bopth9w2y9jPC3 qAWxBDHDUYJLx0Pe4/p3uguTU97+4r/F4+P+RnZ5XykV2HOUEUIbpNl4ZpGYMaSeeLwa BR39ce5UG51d+3qUxyl2RLdTqVXP9p+AvXsw2NpE0BcxE+Wl8+lVwX03JNPe9+aVva0y 5qZM7BG6fcSO9IUgco+XPMRqqyv0JlO3YZeVbVTUXuRwtEIqi07V1kyI5w01KsILMt1r Gs4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id d19si2663471wre.472.2020.05.14.07.34.16; Thu, 14 May 2020 07:34:16 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B34761DA06; Thu, 14 May 2020 16:32:38 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id AFBDC1D9B9 for ; Thu, 14 May 2020 16:32:24 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 955BE2003BE; Thu, 14 May 2020 16:32:24 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5799F200E33; Thu, 14 May 2020 16:32:22 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id BF616402E0; Thu, 14 May 2020 22:32:19 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, david.marchand@redhat.com, mdr@ashroe.eu Cc: Hemant Agrawal Date: Thu, 14 May 2020 19:59:48 +0530 Message-Id: <20200514142951.31801-11-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200514142951.31801-1-hemant.agrawal@nxp.com> References: <20200514132533.13752-1-hemant.agrawal@nxp.com> <20200514142951.31801-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v6 10/13] bus/dpaa: move log into to respective dpaa drivers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This is to reduce the number of variables getting exposed from the dpaa bus. They are not required to be in bus. Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/dpaa_bus.c | 19 +------- drivers/bus/dpaa/rte_bus_dpaa_version.map | 4 -- drivers/bus/dpaa/rte_dpaa_logs.h | 58 ----------------------- drivers/event/dpaa/dpaa_eventdev.c | 7 +++ drivers/event/dpaa/dpaa_eventdev.h | 16 +++++++ drivers/mempool/dpaa/dpaa_mempool.c | 8 ++++ drivers/mempool/dpaa/dpaa_mempool.h | 19 ++++++++ drivers/net/dpaa/dpaa_ethdev.c | 10 +++- drivers/net/dpaa/dpaa_ethdev.h | 22 +++++++++ 9 files changed, 83 insertions(+), 80 deletions(-) -- 2.17.1 diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index f27820db37..41d42b0c30 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -43,9 +43,6 @@ #include int dpaa_logtype_bus; -int dpaa_logtype_mempool; -int dpaa_logtype_pmd; -int dpaa_logtype_eventdev; static struct rte_dpaa_bus rte_dpaa_bus; struct netcfg_info *dpaa_netcfg; @@ -567,13 +564,13 @@ rte_dpaa_bus_probe(void) /* One time load of Qman/Bman drivers */ ret = qman_global_init(); if (ret) { - DPAA_PMD_ERR("QMAN initialization failed: %d", + DPAA_BUS_ERR("QMAN initialization failed: %d", ret); return ret; } ret = bman_global_init(); if (ret) { - DPAA_PMD_ERR("BMAN initialization failed: %d", + DPAA_BUS_ERR("BMAN initialization failed: %d", ret); return ret; } @@ -752,16 +749,4 @@ RTE_INIT(dpaa_init_log) 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); - - dpaa_logtype_pmd = rte_log_register("pmd.net.dpaa"); - if (dpaa_logtype_pmd >= 0) - rte_log_set_level(dpaa_logtype_pmd, RTE_LOG_NOTICE); - - dpaa_logtype_eventdev = rte_log_register("pmd.event.dpaa"); - if (dpaa_logtype_eventdev >= 0) - rte_log_set_level(dpaa_logtype_eventdev, RTE_LOG_NOTICE); } diff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map index 220fc32da1..9b02cc674c 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -10,10 +10,6 @@ INTERNAL { bman_thread_irq; dpaa_get_qm_channel_caam; dpaa_get_qm_channel_pool; - dpaa_logtype_eventdev; - dpaa_logtype_mempool; - dpaa_logtype_pmd; - dpaa_netcfg; dpaa_svr_family; fman_dealloc_bufs_mask_hi; fman_dealloc_bufs_mask_lo; diff --git a/drivers/bus/dpaa/rte_dpaa_logs.h b/drivers/bus/dpaa/rte_dpaa_logs.h index e414354320..149b127434 100644 --- a/drivers/bus/dpaa/rte_dpaa_logs.h +++ b/drivers/bus/dpaa/rte_dpaa_logs.h @@ -10,9 +10,6 @@ #include extern int dpaa_logtype_bus; -extern int dpaa_logtype_mempool; -extern int dpaa_logtype_pmd; -extern int dpaa_logtype_eventdev; #define DPAA_BUS_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, dpaa_logtype_bus, "dpaa: " fmt "\n", ##args) @@ -40,59 +37,4 @@ extern int dpaa_logtype_eventdev; #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) - -/* 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) - -#define DPAA_EVENTDEV_LOG(level, fmt, args...) \ - rte_log(RTE_LOG_ ## level, dpaa_logtype_eventdev, "%s(): " fmt "\n", \ - __func__, ##args) - -#define EVENTDEV_INIT_FUNC_TRACE() DPAA_EVENTDEV_LOG(DEBUG, " >>") - -#define DPAA_EVENTDEV_DEBUG(fmt, args...) \ - DPAA_EVENTDEV_LOG(DEBUG, fmt, ## args) -#define DPAA_EVENTDEV_ERR(fmt, args...) \ - DPAA_EVENTDEV_LOG(ERR, fmt, ## args) -#define DPAA_EVENTDEV_INFO(fmt, args...) \ - DPAA_EVENTDEV_LOG(INFO, fmt, ## args) -#define DPAA_EVENTDEV_WARN(fmt, args...) \ - DPAA_EVENTDEV_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_ */ diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c index a7d57edce7..5a018d4871 100644 --- a/drivers/event/dpaa/dpaa_eventdev.c +++ b/drivers/event/dpaa/dpaa_eventdev.c @@ -46,6 +46,7 @@ * Eventqueue = Channel Instance * 1 Eventdev can have N Eventqueue */ +int dpaa_logtype_eventdev; #define DISABLE_INTR_MODE "disable_intr" @@ -1068,3 +1069,9 @@ static struct rte_vdev_driver vdev_eventdev_dpaa_pmd = { RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_DPAA_PMD, vdev_eventdev_dpaa_pmd); RTE_PMD_REGISTER_PARAM_STRING(EVENTDEV_NAME_DPAA_PMD, DISABLE_INTR_MODE "="); +RTE_INIT(dpaa_event_init_log) +{ + dpaa_logtype_eventdev = rte_log_register("pmd.event.dpaa"); + if (dpaa_logtype_eventdev >= 0) + rte_log_set_level(dpaa_logtype_eventdev, RTE_LOG_NOTICE); +} diff --git a/drivers/event/dpaa/dpaa_eventdev.h b/drivers/event/dpaa/dpaa_eventdev.h index 5ce15a3db9..0b3da83a4f 100644 --- a/drivers/event/dpaa/dpaa_eventdev.h +++ b/drivers/event/dpaa/dpaa_eventdev.h @@ -76,4 +76,20 @@ struct dpaa_eventdev { uint32_t nb_event_port_enqueue_depth; uint32_t event_dev_cfg; }; + +#define DPAA_EVENTDEV_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, dpaa_logtype_eventdev, "%s(): " fmt "\n", \ + __func__, ##args) + +#define EVENTDEV_INIT_FUNC_TRACE() DPAA_EVENTDEV_LOG(DEBUG, " >>") + +#define DPAA_EVENTDEV_DEBUG(fmt, args...) \ + DPAA_EVENTDEV_LOG(DEBUG, fmt, ## args) +#define DPAA_EVENTDEV_ERR(fmt, args...) \ + DPAA_EVENTDEV_LOG(ERR, fmt, ## args) +#define DPAA_EVENTDEV_INFO(fmt, args...) \ + DPAA_EVENTDEV_LOG(INFO, fmt, ## args) +#define DPAA_EVENTDEV_WARN(fmt, args...) \ + DPAA_EVENTDEV_LOG(WARNING, fmt, ## args) + #endif /* __DPAA_EVENTDEV_H__ */ diff --git a/drivers/mempool/dpaa/dpaa_mempool.c b/drivers/mempool/dpaa/dpaa_mempool.c index 3a2528331c..451e2d5d56 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.c +++ b/drivers/mempool/dpaa/dpaa_mempool.c @@ -36,6 +36,7 @@ struct dpaa_memseg_list rte_dpaa_memsegs = TAILQ_HEAD_INITIALIZER(rte_dpaa_memsegs); struct dpaa_bp_info *rte_dpaa_bpid_info; +int dpaa_logtype_mempool; static int dpaa_mbuf_create_pool(struct rte_mempool *mp) @@ -356,3 +357,10 @@ static const struct rte_mempool_ops dpaa_mpool_ops = { }; MEMPOOL_REGISTER_OPS(dpaa_mpool_ops); + +RTE_INIT(dpaa_mp_init_log) +{ + 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/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h index f69e11f011..dc0058e6dd 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.h +++ b/drivers/mempool/dpaa/dpaa_mempool.h @@ -58,4 +58,23 @@ extern struct dpaa_bp_info *rte_dpaa_bpid_info; #define DPAA_BPID_TO_POOL_INFO(__bpid) (&rte_dpaa_bpid_info[__bpid]) +/* 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 diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 56eb5ec47c..c97f3042be 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -46,6 +46,8 @@ #include #include +int dpaa_logtype_pmd; + /* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = DEV_RX_OFFLOAD_JUMBO_FRAME | @@ -1058,7 +1060,7 @@ static int dpaa_dev_queue_intr_disable(struct rte_eth_dev *dev, temp1 = read(rxq->q_fd, &temp, sizeof(temp)); if (temp1 != sizeof(temp)) - DPAA_EVENTDEV_ERR("irq read error"); + DPAA_PMD_ERR("irq read error"); qman_fq_portal_thread_irq(rxq->qp); @@ -1664,3 +1666,9 @@ static struct rte_dpaa_driver rte_dpaa_pmd = { }; RTE_PMD_REGISTER_DPAA(net_dpaa, rte_dpaa_pmd); +RTE_INIT(dpaa_net_init_log) +{ + dpaa_logtype_pmd = rte_log_register("pmd.net.dpaa"); + if (dpaa_logtype_pmd >= 0) + rte_log_set_level(dpaa_logtype_pmd, RTE_LOG_NOTICE); +} diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 7393a9df05..6a6477ac87 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -185,4 +185,26 @@ dpaa_rx_cb_atomic(void *event, const struct qm_dqrr_entry *dqrr, void **bufs); +/* PMD related logs */ +extern int dpaa_logtype_pmd; + +#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