From patchwork Fri May 15 09:47:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 186823 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp266501ilb; Fri, 15 May 2020 02:52:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTeA7dpEUkACUAjtSBA+BVnQReCK2CoUqEG6Ss06Hemjz5yYn9gW1tDdeQLMxJH4X+UYWW X-Received: by 2002:a5d:404a:: with SMTP id w10mr3325305wrp.265.1589536320131; Fri, 15 May 2020 02:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589536320; cv=none; d=google.com; s=arc-20160816; b=Iqekb2lZqHogi2jpR0Z7Fajlihya1e4rZxJbHc7O6LUNUS87qKgLY9tXu3LzcCJDOX i9MltECpz6abR+RFVHePq5BH6Lw+kPabXOfJ7jhXayVzIeAhDv1tqdPleEq/crNPz2lE AvfOv0ULqHOotvpDNRDGqPvbPgsw5UR+DTrxkmREdaHeod0+HhPOpC5SpbPjLv8rwNey pUbtNz1c5CRTNQ7l3Jwi1sdvsHYsoRbMcN7oxlIA0hf7r6mhh+7lk+r+3k9IFvxiNUxa A2huNt2WD8FNTse+7T6fL2Rla7FIqmdQINTYJcehWM1HmiYoav5GlGgwKGEWKeHcZfVW 1dMA== 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=lQuy13r4i2p7YwFV78Zy4pzgjSwZ6Oie9nr55ZQiS8o=; b=MV/r/RlhQyImAkLear3uIIbH+3fxjaskKbDbBf758jWnkn6yTRN1O61PNzdU1fmEnd LNzVjeg+kumN/1X3TrCx6/P97tx0YBYY/PEisQccQn7gj3c4o1QqHNDV87jpqaSAK0Dz QYVnU7WdQyc+EBN3aDzMSiZuzhxQ+1dhSh8IDzHne4L/UA16QkUw+4Yq9yYzVYpg9Tdp UEWC1iIO11yY3RRv0uXTFqPoTETTDAd2r2x3W3RFanmUKQ2OrKJf2bdOhWA0EOYTJFxe 6ASaJr/m6gX5spi6CfqCPl7mB9wbnehyb6ocDEwlee8L8W9pJIjWvI+5+UtulWWBb+rz zm3Q== 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 v8si1625621wrb.124.2020.05.15.02.51.59; Fri, 15 May 2020 02:52:00 -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 7E8DE1DB0B; Fri, 15 May 2020 11:50:46 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id AF4511DAC8 for ; Fri, 15 May 2020 11:50:28 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6F1E51A06B8; Fri, 15 May 2020 11:50:28 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 3D7FE1A06AD; Fri, 15 May 2020 11:50:26 +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 9DED740314; Fri, 15 May 2020 17:50:23 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, david.marchand@redhat.com, mdr@ashroe.eu Cc: Hemant Agrawal Date: Fri, 15 May 2020 15:17:49 +0530 Message-Id: <20200515094752.28490-11-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200515094752.28490-1-hemant.agrawal@nxp.com> References: <20200514132533.13752-1-hemant.agrawal@nxp.com> <20200515094752.28490-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v8 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 8bb2757e04..e53e8fa222 100644 --- a/drivers/bus/dpaa/rte_bus_dpaa_version.map +++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map @@ -14,10 +14,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