From patchwork Thu May 14 13:25:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 186717 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp1404029ilb; Thu, 14 May 2020 06:29:55 -0700 (PDT) X-Google-Smtp-Source: APiQypIU7DGLrujDX1cJpWKJvsUvIU0b2B+gqex2jHLaYjRxWxfIIyx4TFQ5rNV/CrWjKLFYL7rx X-Received: by 2002:a7b:cf15:: with SMTP id l21mr29560677wmg.172.1589462995038; Thu, 14 May 2020 06:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589462995; cv=none; d=google.com; s=arc-20160816; b=Wgjp4mvJVIGWwIujK5dfa+I0uha9Q2K6WJOxt9kADdcpSkADCSWv9WDU9TGPnA+jMn k1t1oDDzbKpAMixXTko0FRaGnZkSh8jMRh4rzv+5wnop7/uRwIPX5takU5yx7fs99cNr ZmyzA+8A5sGY7xsgiLNH/052SO5z9TDaM9zrRxRZOBDD51Uh6q6LfuLINB1hITnJMRNY j4Haa1TS8sEt34Gwt2rkMP0oURTjJFGsRl2ZmBN03LhrFfPw3rA31VxPj/6ktAV5V0Ws Y+jHqkoQ7HthCwTiZ9ztPgpnL27Wp6nwIpbLIS3Peoqbu/DeLJl219dOV7wGAK+o9J29 GItw== 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=kv0plQhr96TE+wyDfYFKnAzAzluxrENlyNz1erhUDp+4YAFkEN6t1lTMn92MW1PvlC Mq1WLeway4Y+SI9uhuLlRuXGKmR8wcnlOBgOMgGYEHZ8Z1DXH+S6UeETGDN+D1ewDfHA 2UBD9qnH/Xy4obMmouITcL09fega8KUDlsKBWvkJe++AhjbTus6bkkN+DUn7lDGAl+u/ BLmNbjY8yITtx62i/TFKrGVsvFcYm3Cbn3FT07VzHhetuf0ZpCZBbxdEuvWwtCIukz/Y tJdEO79N+RoITt2jd11RY6MA5uix9Y1Q6yCLsnyoIxcBhosIoKGrWyzfD4fIl2hxtF4B Yzbg== 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 h14si2610598wrm.484.2020.05.14.06.29.54; Thu, 14 May 2020 06:29:55 -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 1A5021D980; Thu, 14 May 2020 15:28:22 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 3B5FE1D941 for ; Thu, 14 May 2020 15:28:07 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 1CFD21A163D; Thu, 14 May 2020 15:28:07 +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 E03791A1555; Thu, 14 May 2020 15:28:04 +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 F0EDC402BB; Thu, 14 May 2020 21:28:01 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, david.marchand@redhat.com, mdr@ashroe.eu Cc: Hemant Agrawal Date: Thu, 14 May 2020 18:55:30 +0530 Message-Id: <20200514132533.13752-11-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200514132533.13752-1-hemant.agrawal@nxp.com> References: <20200513132745.9006-1-hemant.agrawal@nxp.com> <20200514132533.13752-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v4 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