From patchwork Tue Sep 25 07:02:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 147399 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp373275lji; Tue, 25 Sep 2018 00:04:41 -0700 (PDT) X-Google-Smtp-Source: ACcGV635Z0DwhasDgXkOHIJYcQ2TVWxLd49tpXKC3NPybZi0J+aMXSlcVnubIX9v4OoGyoP4IeWy X-Received: by 2002:a1c:1bca:: with SMTP id b193-v6mr733130wmb.6.1537859081540; Tue, 25 Sep 2018 00:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537859081; cv=none; d=google.com; s=arc-20160816; b=gT6ABMo8Ho9EDjsrwWrpUv2+bh5fR5/846iznHfPHUMFq7l/jQrqxnx5g4sadwQsfR PQIFTOtORooFLzfPvHBijx7SpcpOPv11z4pq0q2D0OYKZ2SH3aSEyD2g89+lRmzy6zfg UKB9VOA0giRUt7vSGtEzWCXkiH6vUmy40eeg6riwBEJfaansf6jPtxxC4+knR11wipfV gLECC0yMjQXza3BFIzNz7/pxwyxLDcCAGEMp3RJj0xZBkUBtc10ZptdZUddxWrFxVxmL dJCPgrJjET4+GGSdYXMI8WbT8pFq42YywCxRu2mpYDXvDX9+6BNqAQAWRgkwYKmHp2lm qqNQ== 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=bslINFZMqGbfDjQZFSNq12hVMpiG+bmi1CvljQ3+eq0=; b=BK00U2+qZwjMKY+JAAV6eZqzkZQ+j5rpFybe1F2ncnHTJMA9w2sEk/vPQgNCm2lpAO 9iirWaY7OnMTZHHykFgPhp9BK8eAfqaGE+65H521Ici/CS8m8KvpZZm0XYLah1vfvbpw AgIZsVfQ2bp+7muD+G19br9MF/AIxpNe8thPDdgosJl8mKsvE69JXkY1hWZYkSHxeI+4 taT3lgRDN8DKMJLF5rk3/5Bo6aMLcD4xLdxU5kYixr8Mc7sP6OTt2K/4pMy/FoL1POF5 b2iNY+HOAkhTenp8O1uWur2J9Loga18iaQHRQe44ytK3KM9U5HoIJcZcnFBPmWeicvOv s95A== 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 i14-v6si1403523wrq.178.2018.09.25.00.04.41; Tue, 25 Sep 2018 00:04:41 -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 6FBA81E34; Tue, 25 Sep 2018 09:04:40 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 231F51AFF for ; Tue, 25 Sep 2018 09:04:39 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 994341A0099; Tue, 25 Sep 2018 09:04:38 +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 BC4DD1A006A; Tue, 25 Sep 2018 09:04:36 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 3AC32402D8; Tue, 25 Sep 2018 15:04:34 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: jerin.jacob@caviumnetworks.com Date: Tue, 25 Sep 2018 12:32:34 +0530 Message-Id: <1537858955-6884-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535607196-26782-1-git-send-email-hemant.agrawal@nxp.com> References: <1535607196-26782-1-git-send-email-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 1/2] event/dpaa: remove duplicate log macros 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" align and cleanup the debug log prints Signed-off-by: Hemant Agrawal --- Note: This patch has a dependency on following patch series: http://mails.dpdk.org/archives/dev/2018-September/112433.html which is now part of dpdk-next-net tree. drivers/event/dpaa/dpaa_eventdev.c | 58 +++++++++++++++++++------------------- drivers/event/dpaa/dpaa_eventdev.h | 7 ----- 2 files changed, 29 insertions(+), 36 deletions(-) -- 2.7.4 diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c index 5443ef5..9ddaf30 100644 --- a/drivers/event/dpaa/dpaa_eventdev.c +++ b/drivers/event/dpaa/dpaa_eventdev.c @@ -49,7 +49,7 @@ dpaa_event_dequeue_timeout_ticks(struct rte_eventdev *dev, uint64_t ns, { uint64_t cycles_per_second; - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); @@ -175,7 +175,7 @@ static void dpaa_event_dev_info_get(struct rte_eventdev *dev, struct rte_event_dev_info *dev_info) { - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); dev_info->driver_name = "event_dpaa"; @@ -220,8 +220,7 @@ dpaa_event_dev_configure(const struct rte_eventdev *dev) int ret, i; uint32_t *ch_id; - EVENTDEV_DRV_FUNC_TRACE(); - + EVENTDEV_INIT_FUNC_TRACE(); priv->dequeue_timeout_ns = conf->dequeue_timeout_ns; priv->nb_events_limit = conf->nb_events_limit; priv->nb_event_queues = conf->nb_event_queues; @@ -244,13 +243,14 @@ dpaa_event_dev_configure(const struct rte_eventdev *dev) sizeof(uint32_t) * priv->nb_event_queues, RTE_CACHE_LINE_SIZE); if (ch_id == NULL) { - EVENTDEV_DRV_ERR("Fail to allocate memory for dpaa channels\n"); + DPAA_EVENTDEV_ERR("Fail to allocate memory for dpaa channels\n"); return -ENOMEM; } /* Create requested event queues within the given event device */ ret = qman_alloc_pool_range(ch_id, priv->nb_event_queues, 1, 0); if (ret < 0) { - EVENTDEV_DRV_ERR("Failed to create internal channel\n"); + DPAA_EVENTDEV_ERR("qman_alloc_pool_range %u, err =%d\n", + priv->nb_event_queues, ret); rte_free(ch_id); return ret; } @@ -283,7 +283,7 @@ dpaa_event_dev_configure(const struct rte_eventdev *dev) * can be created equals to number of lcore. */ rte_free(ch_id); - EVENTDEV_DRV_LOG("Configured eventdev devid=%d", dev->data->dev_id); + DPAA_EVENTDEV_INFO("Configured eventdev devid=%d", dev->data->dev_id); return 0; } @@ -291,7 +291,7 @@ dpaa_event_dev_configure(const struct rte_eventdev *dev) static int dpaa_event_dev_start(struct rte_eventdev *dev) { - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); return 0; @@ -300,14 +300,14 @@ dpaa_event_dev_start(struct rte_eventdev *dev) static void dpaa_event_dev_stop(struct rte_eventdev *dev) { - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); } static int dpaa_event_dev_close(struct rte_eventdev *dev) { - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); return 0; @@ -317,7 +317,7 @@ static void dpaa_event_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id, struct rte_event_queue_conf *queue_conf) { - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); RTE_SET_USED(queue_id); @@ -334,14 +334,14 @@ dpaa_event_queue_setup(struct rte_eventdev *dev, uint8_t queue_id, struct dpaa_eventdev *priv = dev->data->dev_private; struct dpaa_eventq *evq_info = &priv->evq_info[queue_id]; - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); switch (queue_conf->schedule_type) { case RTE_SCHED_TYPE_PARALLEL: case RTE_SCHED_TYPE_ATOMIC: break; case RTE_SCHED_TYPE_ORDERED: - EVENTDEV_DRV_ERR("Schedule type is not supported."); + DPAA_EVENTDEV_ERR("Schedule type is not supported."); return -1; } evq_info->event_queue_cfg = queue_conf->event_queue_cfg; @@ -353,7 +353,7 @@ dpaa_event_queue_setup(struct rte_eventdev *dev, uint8_t queue_id, static void dpaa_event_queue_release(struct rte_eventdev *dev, uint8_t queue_id) { - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); RTE_SET_USED(queue_id); @@ -363,7 +363,7 @@ static void dpaa_event_port_default_conf_get(struct rte_eventdev *dev, uint8_t port_id, struct rte_event_port_conf *port_conf) { - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); RTE_SET_USED(port_id); @@ -379,7 +379,7 @@ dpaa_event_port_setup(struct rte_eventdev *dev, uint8_t port_id, { struct dpaa_eventdev *eventdev = dev->data->dev_private; - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(port_conf); dev->data->ports[port_id] = &eventdev->ports[port_id]; @@ -390,7 +390,7 @@ dpaa_event_port_setup(struct rte_eventdev *dev, uint8_t port_id, static void dpaa_event_port_release(void *port) { - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(port); } @@ -466,7 +466,7 @@ dpaa_event_eth_rx_adapter_caps_get(const struct rte_eventdev *dev, { const char *ethdev_driver = eth_dev->device->driver->name; - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); @@ -491,14 +491,14 @@ dpaa_event_eth_rx_adapter_queue_add( struct dpaa_if *dpaa_intf = eth_dev->data->dev_private; int ret, i; - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); if (rx_queue_id == -1) { for (i = 0; i < dpaa_intf->nb_rx_queues; i++) { ret = dpaa_eth_eventq_attach(eth_dev, i, ch_id, queue_conf); if (ret) { - EVENTDEV_DRV_ERR( + DPAA_EVENTDEV_ERR( "Event Queue attach failed:%d\n", ret); goto detach_configured_queues; } @@ -508,7 +508,7 @@ dpaa_event_eth_rx_adapter_queue_add( ret = dpaa_eth_eventq_attach(eth_dev, rx_queue_id, ch_id, queue_conf); if (ret) - EVENTDEV_DRV_ERR("dpaa_eth_eventq_attach failed:%d\n", ret); + DPAA_EVENTDEV_ERR("dpaa_eth_eventq_attach failed:%d\n", ret); return ret; detach_configured_queues: @@ -527,14 +527,14 @@ dpaa_event_eth_rx_adapter_queue_del(const struct rte_eventdev *dev, int ret, i; struct dpaa_if *dpaa_intf = eth_dev->data->dev_private; - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); if (rx_queue_id == -1) { for (i = 0; i < dpaa_intf->nb_rx_queues; i++) { ret = dpaa_eth_eventq_detach(eth_dev, i); if (ret) - EVENTDEV_DRV_ERR( + DPAA_EVENTDEV_ERR( "Event Queue detach failed:%d\n", ret); } @@ -543,7 +543,7 @@ dpaa_event_eth_rx_adapter_queue_del(const struct rte_eventdev *dev, ret = dpaa_eth_eventq_detach(eth_dev, rx_queue_id); if (ret) - EVENTDEV_DRV_ERR("dpaa_eth_eventq_detach failed:%d\n", ret); + DPAA_EVENTDEV_ERR("dpaa_eth_eventq_detach failed:%d\n", ret); return ret; } @@ -551,7 +551,7 @@ static int dpaa_event_eth_rx_adapter_start(const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev) { - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); RTE_SET_USED(eth_dev); @@ -563,7 +563,7 @@ static int dpaa_event_eth_rx_adapter_stop(const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev) { - EVENTDEV_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); RTE_SET_USED(eth_dev); @@ -603,7 +603,7 @@ dpaa_event_dev_create(const char *name) sizeof(struct dpaa_eventdev), rte_socket_id()); if (eventdev == NULL) { - EVENTDEV_DRV_ERR("Failed to create eventdev vdev %s", name); + DPAA_EVENTDEV_ERR("Failed to create eventdev vdev %s", name); goto fail; } @@ -631,7 +631,7 @@ dpaa_event_dev_probe(struct rte_vdev_device *vdev) const char *name; name = rte_vdev_device_name(vdev); - EVENTDEV_DRV_LOG("Initializing %s", name); + DPAA_EVENTDEV_INFO("Initializing %s", name); return dpaa_event_dev_create(name); } @@ -642,7 +642,7 @@ dpaa_event_dev_remove(struct rte_vdev_device *vdev) const char *name; name = rte_vdev_device_name(vdev); - EVENTDEV_DRV_LOG("Closing %s", name); + DPAA_EVENTDEV_INFO("Closing %s", name); return rte_event_pmd_vdev_uninit(name); } diff --git a/drivers/event/dpaa/dpaa_eventdev.h b/drivers/event/dpaa/dpaa_eventdev.h index 583e46c..3994bd6 100644 --- a/drivers/event/dpaa/dpaa_eventdev.h +++ b/drivers/event/dpaa/dpaa_eventdev.h @@ -12,13 +12,6 @@ #define EVENTDEV_NAME_DPAA_PMD event_dpaa1 -#define EVENTDEV_DRV_LOG(fmt, args...) \ - DPAA_EVENTDEV_INFO(fmt, ## args) -#define EVENTDEV_DRV_FUNC_TRACE() \ - DPAA_EVENTDEV_DEBUG("%s() Called:\n", __func__) -#define EVENTDEV_DRV_ERR(fmt, args...) \ - DPAA_EVENTDEV_ERR("%s(): " fmt "\n", __func__, ## args) - #define DPAA_EVENT_MAX_PORTS 8 #define DPAA_EVENT_MAX_QUEUES 16 #define DPAA_EVENT_MIN_DEQUEUE_TIMEOUT 1