From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0049.outbound.protection.outlook.com [104.47.33.49]) by dpdk.org (Postfix) with ESMTP id 0ABE81B290 for ; Wed, 17 Jan 2018 06:24:15 +0100 (CET) Received: from BN6PR03CA0067.namprd03.prod.outlook.com (10.173.137.29) by DM5PR03MB2699.namprd03.prod.outlook.com (10.168.197.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Wed, 17 Jan 2018 05:24:14 +0000 Received: from BN1AFFO11FD007.protection.gbl (2a01:111:f400:7c10::153) by BN6PR03CA0067.outlook.office365.com (2603:10b6:404:4c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Wed, 17 Jan 2018 05:24:14 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD007.mail.protection.outlook.com (10.58.52.67) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Wed, 17 Jan 2018 05:24:14 +0000 Received: from b27504-OptiPlex-790.ap.freescale.net (b27504-OptiPlex-790.ap.freescale.net [10.232.132.60]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w0H5O79o027272; Tue, 16 Jan 2018 22:24:11 -0700 From: Nipun Gupta To: CC: , , Nipun Gupta Date: Wed, 17 Jan 2018 17:09:09 +0530 Message-ID: <1516189154-28331-2-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516189154-28331-1-git-send-email-nipun.gupta@nxp.com> References: <1515792181-11836-1-git-send-email-nipun.gupta@nxp.com> <1516189154-28331-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131606402544889862; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(376002)(39380400002)(346002)(396003)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199004)(189003)(51416003)(4326008)(53936002)(2351001)(77096006)(8656006)(50226002)(8936002)(97736004)(26005)(6916009)(305945005)(2950100002)(36756003)(2906002)(5660300001)(5890100001)(50466002)(16586007)(105606002)(54906003)(316002)(356003)(296002)(68736007)(8676002)(81166006)(106466001)(81156014)(104016004)(48376002)(86362001)(59450400001)(508600001)(85426001)(76176011)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB2699; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD007; 1:f7gVGflljmdxWIksXsVdV6uvubanMVbQ+CahO0qzWlQNkLamBekp5ZZYRTe6d+AnvW7aZEpJLnx4BS76BIGUt4sPXB/t+f9hym83FdOTZZ5cLqHpOlneb7ZSNWTyl3cy MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 63940449-607d-4cd5-f006-08d55d6a8c51 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:DM5PR03MB2699; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 3:a6B0b3pKkncpXYTdkJwh0s9/4whR3sgzJGCqwY61Ah4igKACrt5q4sO93GdIozulJGOvM3o4oIsae1l6mZdegAZe7zD9gUnQLsFTu+/lnmxXj/pD1mxUopCzYM03Uld1Lq8ok6dCZK3VeP67Nbsu1pfT2U19cXFBNiWTKMcxuZZHsiiLRrqGTvCeaJdRU6DGb0uu/mQ6X9QcCw0Fn0Ics5IGecQQ4O4MyLSv/3u4UD4EJJwLA4solhc7VBOzh6R+GuIkQ0+qGoS7POIUxCOGEg7Cr57XJVTrlkwGw6exGqPYuwGfnxGYA27NqIwR/iTas9OT3ULTTlnyNL6ryrpCXWMe9hV8u+usMjtvmqvs0ks=; 25:vx6ujKDm0hlqwxnZrmgwgXi1OuyOKo7tRYIZVozKziAam36IrnSuoEafI2UiXjUOQJs1M6DOZHQTtZJahMB9xs7vel5GssBSj9sWc9Im+LkO7uG8Je7/ectLYw2vcgSwaNAOB3b1lwhsU99qOZA7Il5PyNfv1EyUH5oWrJMrz8VdegSZvBhExg7I0mmLv9x6cjhN8YpOj993RDrLCZxqR9YdUngswoJD7+TgfWOiAp5EEWgbWnpBfBZHQ+w9hSloLQDncv+W3IRiKhHq+mHbVk+jlMlQ7CNJwatDr09CkmkC5FOdKUXdWCVzyXlwMaghTkxD/FT7F6j6jEG8Uo9G8g== X-MS-TrafficTypeDiagnostic: DM5PR03MB2699: X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 31:b0AckJob34RGDb8takr/GJ/k7qsHh3knnk8GsFiZh3/PtcBoEh3tU2owBg1N/Bpu1P/g6liyzLxgaWtYFOpSd2aDvIEuSKC5dYbG0mn6rMlzvpdsGmRW+OOgpErptJAb69ezsuu4tmW06FQf9TT66R4PbnHux9aKbxg5aFwUrNd4uFmzxBmZbkZk75Q8q6RA+TA3imFbwSSf6S0wdocUIMpWDRRHK9DyOYFStppndTI=; 4:VAJck0Sxnrkp5747l2OdzirsO0zkz3cPmYM+MjOcoisfXAu0V2wqz/Q2DmNQVS6Rw3TrhLclBZET4weCX82Rg13lyTRhmdVvEiJENVNgPnU6uN5+lFYCEP7LOMhKZBiGwjFoMeMyvgi1rnzfofsY8OHFxo1w6E/EhzHkx6XUSU72Rj0E9268SIQpCbMejBwCpbGdeG+Gt9Cug3N5LGBp+nRCJv1OZbfX3rDOn3pEcOGhNyw6sXYFzN9U+tbvRvHUst57b+0Cyr8C6N+aIRIfUrxeT4V56BjJU01NkXUTzOwjA6TLIOVZJpVNli3F7G/+RU9i/+Ucjdh9qWTwuFRRJYQmeq3nsW4+zF0s255y74z9Yxd9pKkNukBSB8Mnlymq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(788757137089)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3002001)(3231023)(944501161)(10201501046)(93006095)(93001095)(6055026)(6096035)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(201703131430075)(201703131520075)(201703131433075)(201703131441075)(201703131448075)(20161123559100)(201708071742011); SRVR:DM5PR03MB2699; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:DM5PR03MB2699; X-Forefront-PRVS: 0555EC8317 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB2699; 23:zKO2DK64TiNsVitIzjN/s97S6dC7QnWQ227nsDhqj?= =?us-ascii?Q?8KfmLFck1T5ULU6KtiewT7c9gmU+BHFiiHPwm4p/kd+urfzO74x0bAO4s0xS?= =?us-ascii?Q?pgFwFafYGdWOc0AM+qMjqkrbFi2vM20Zmka8TUFukc877jbtNQkijD6tJDUL?= =?us-ascii?Q?3us1560Lf/BlLUAUajz5XY8E6KdGs3oJGpNmlr8cYnmAFFISJNAUkxTYJN+J?= =?us-ascii?Q?zoqKTu26aSjjowoHWB4QPA6OkZU6itR+PdLl0q0txdoXLMk8LKdqlokUr79k?= =?us-ascii?Q?BOyIUFOup5YnDEVeaSkdvhMJnGJZg/MyhcfnLsXgFPk00pvm7w53v7a9aBYN?= =?us-ascii?Q?GRU5yV3p6OhC9TehXg9C1DE+ppOISF9lWe6Hg7YGfR6c6KSiLIw7bigjz9OE?= =?us-ascii?Q?nuH3/SRTEVUYFY1mfHetTJndccAaAj+yz6MSkBvNC24DIDb3xBELcj0jlgmo?= =?us-ascii?Q?ILY9+Rwvs228UbiMy1UhncqrOpwtwcI8IUQdxU1upj0Bk15m8mbXhdXhCTqD?= =?us-ascii?Q?Ckd9HT+h8vMYMrWCFJxITuFZ+AIPKNBMF+BCnr3AYC0RJK7Otg9jGRbxDZ+/?= =?us-ascii?Q?InHPFhIMdZ8LRtwbINkGFkS312EBmyaJ1xzp0W+UAU4nXQoqk+tcsdNJjMGa?= =?us-ascii?Q?7SsT/r7WX9CYkMV4MCkrVuShx/s6t7aeDPI39Qsp+YR8ZkcLkx4ahlHr9Uxp?= =?us-ascii?Q?TBsg6TZNtYh9KShE1bypM7A8Beliw6YFIg8iUNlPCv208GMKHCGrMZkX1iKq?= =?us-ascii?Q?9mTNBt7xaY0bac/WxDDFjLv6Sra2LkLjYUloVinTm9yj/dthoizItEFScxyu?= =?us-ascii?Q?6eXu+JDdrgwP/XTtIE8mCDmLU30mPPCxQvZ3L7g3J41AhcuzAJbklTGdNyMp?= =?us-ascii?Q?OFo3jvq6CoohmrVdDrCTcrz8lTf6t+jHNCUyyF4qCEC317sbKOa3g64qBY31?= =?us-ascii?Q?rsTik1yKnuJTG5iuylRhBR9YiX73TCF6IsISW5NP7mKPzqzubsPTonarOJju?= =?us-ascii?Q?tNe2TGmAIh3UM17hQwqlYoYKse+xFf8yAm5leOcIiP9FnzHpaZAfz01bFvOO?= =?us-ascii?Q?qmVoLadoIC5m91ne/UhZw2rYnA+v1tncre8wBr2fvLl4iK2WFEJcEcvsWtTA?= =?us-ascii?Q?kDfpf5WKr3VMpeBZqfSRODUOxLXKwsk?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB2699; 6:n9LG5hdwg00RW01pMoO46neJOlRZm0rr1XwCLlfMekVqdAIFy5brQCdh+aCSTYixH/BBSOxndJ4Wbx2JEGSJS4S08neTegUDRfVcASZDiazm+lxWcsYcga8m11xEkEoStj41Tx4QKmEtZ9Ya4yiNNgRHNLs8ZXS/mT6vSJP9ohCuaNldvGOCdK0tocF9D1UYrIHT8Mz5xPXDxPVsaotgqggiPgCqukgt94uOyK5APGtgJsjzRdF1Wf3OVqPj7rVjM4WQhfweguJXSuYNvZJnsuGCIP6z7zgbIE9cjonK6EMXJ1SNaYc7n4wlR15hZE7pCGpHzRAc3nkLfDNBVXdZj/Ys0ew9THAJlb7Gdxu5gmQ=; 5:XEi3nUPzHU4Hv9VnXjNSYJ1fPhYnX50N4NPex/wz01JBVbewQeycq/g0WzAVfCicE+qL6eIo4jt7potTdPx0JDzrt1sBUhDoxoj1EIu4yH0f1PXX+kUx2hDrsGiqKHALtf19vj4VoWLgbnyzA0z+8WDrhc+sCaTbuNSGsjrxm1E=; 24:EyDYquT/fDuZlGXu/pp/8mxoj6tf8iUWcgWkZEy908hESEKghg5tLryNvD3D4crPFcryFVc7bClx+BOqmD/AdwbMXD6JbjmZUSnHa0mLyB4=; 7:ij9avkH1fQZI1rEG08AzqgWwgMl4F3x7Nm2xwLDAXo/5bR5VvfzXGN/qTFx6QG53Od+YFzbuXffvssHFoxPRWHeholJJIU/PkrLloa0ZGXU4hUWzU7VbQ+J93zo8yg4sojGN13wdOgIkUC5bbYFaKmXsTwuxv9I2HrffSyuZsyKOVPF2TTrHwIjYtyx/vjst4qo8wH0/UDGV5yMm7axloR2uxPKNLh5GJXK/4VhaRH9+Fv8+8hKVFNXs4e0uKwMq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2018 05:24:14.3173 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63940449-607d-4cd5-f006-08d55d6a8c51 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB2699 Subject: [dpdk-dev] [PATCH 1/6 v3] event/dpaa2: replace static with dynamic logging 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: , X-List-Received-Date: Wed, 17 Jan 2018 05:24:16 -0000 Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/event/dpaa2/dpaa2_eventdev.c | 83 ++++++++++++++++--------------- drivers/event/dpaa2/dpaa2_eventdev.h | 12 ----- drivers/event/dpaa2/dpaa2_eventdev_logs.h | 37 ++++++++++++++ drivers/event/dpaa2/dpaa2_hw_dpcon.c | 1 + 4 files changed, 82 insertions(+), 51 deletions(-) create mode 100644 drivers/event/dpaa2/dpaa2_eventdev_logs.h diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 498d049..542bccc 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -35,6 +35,7 @@ #include #include #include "dpaa2_eventdev.h" +#include "dpaa2_eventdev_logs.h" #include #include @@ -46,6 +47,9 @@ * Soft Event Flow is DPCI Instance */ +/* Dynamic logging identified for mempool */ +int dpaa2_logtype_event; + static uint16_t dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], uint16_t nb_events) @@ -68,7 +72,7 @@ if (unlikely(!DPAA2_PER_LCORE_DPIO)) { ret = dpaa2_affine_qbman_swp(); if (ret) { - PMD_DRV_LOG(ERR, "Failure in affining portal\n"); + DPAA2_EVENTDEV_ERR("Failure in affining portal\n"); return 0; } } @@ -118,7 +122,7 @@ if (!loop) return num_tx; frames_to_send = loop; - PMD_DRV_LOG(ERR, "Unable to allocate memory"); + DPAA2_EVENTDEV_ERR("Unable to allocate memory"); goto send_partial; } rte_memcpy(ev_temp, event, sizeof(struct rte_event)); @@ -163,9 +167,9 @@ static void dpaa2_eventdev_dequeue_wait(uint64_t timeout_ticks) * case to avoid the problem. */ if (errno == EINTR) { - PMD_DRV_LOG(DEBUG, "epoll_wait fails\n"); + DPAA2_EVENTDEV_DEBUG("epoll_wait fails\n"); if (i++ > 10) - PMD_DRV_LOG(DEBUG, "Dequeue burst Failed\n"); + DPAA2_EVENTDEV_DEBUG("Dequeue burst Failed\n"); goto RETRY; } } @@ -223,7 +227,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, if (unlikely(!DPAA2_PER_LCORE_DPIO)) { ret = dpaa2_affine_qbman_swp(); if (ret) { - PMD_DRV_LOG(ERR, "Failure in affining portal\n"); + DPAA2_EVENTDEV_ERR("Failure in affining portal\n"); return 0; } } @@ -259,7 +263,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, rxq->cb(swp, fd, dq, rxq, &ev[num_pkts]); } else { qbman_swp_dqrr_consume(swp, dq); - PMD_DRV_LOG(ERR, "Null Return VQ received\n"); + DPAA2_EVENTDEV_ERR("Null Return VQ received\n"); return 0; } @@ -282,7 +286,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, { struct dpaa2_eventdev *priv = dev->data->dev_private; - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); @@ -320,7 +324,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, struct dpaa2_eventdev *priv = dev->data->dev_private; struct rte_event_dev_config *conf = &dev->data->dev_conf; - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); priv->dequeue_timeout_ns = conf->dequeue_timeout_ns; priv->nb_event_queues = conf->nb_event_queues; @@ -330,14 +334,15 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, priv->nb_event_port_enqueue_depth = conf->nb_event_port_enqueue_depth; priv->event_dev_cfg = conf->event_dev_cfg; - PMD_DRV_LOG(DEBUG, "Configured eventdev devid=%d", dev->data->dev_id); + DPAA2_EVENTDEV_DEBUG("Configured eventdev devid=%d", + dev->data->dev_id); return 0; } static int dpaa2_eventdev_start(struct rte_eventdev *dev) { - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); @@ -347,7 +352,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, static void dpaa2_eventdev_stop(struct rte_eventdev *dev) { - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); } @@ -355,7 +360,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, static int dpaa2_eventdev_close(struct rte_eventdev *dev) { - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); @@ -366,7 +371,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, dpaa2_eventdev_queue_def_conf(struct rte_eventdev *dev, uint8_t queue_id, struct rte_event_queue_conf *queue_conf) { - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); RTE_SET_USED(queue_id); @@ -381,7 +386,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, static void dpaa2_eventdev_queue_release(struct rte_eventdev *dev, uint8_t queue_id) { - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); RTE_SET_USED(queue_id); @@ -395,7 +400,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, struct evq_info_t *evq_info = &priv->evq_info[queue_id]; - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); evq_info->event_queue_cfg = queue_conf->event_queue_cfg; @@ -406,7 +411,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, dpaa2_eventdev_port_def_conf(struct rte_eventdev *dev, uint8_t port_id, struct rte_event_port_conf *port_conf) { - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); RTE_SET_USED(port_id); @@ -424,7 +429,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, static void dpaa2_eventdev_port_release(void *port) { - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(port); } @@ -433,7 +438,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, dpaa2_eventdev_port_setup(struct rte_eventdev *dev, uint8_t port_id, const struct rte_event_port_conf *port_conf) { - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(port_conf); @@ -459,7 +464,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, struct evq_info_t *evq_info; int i; - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); for (i = 0; i < nb_unlinks; i++) { evq_info = &priv->evq_info[queues[i]]; @@ -485,7 +490,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, uint8_t channel_index; int ret, i, n; - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); for (i = 0; i < nb_links; i++) { evq_info = &priv->evq_info[queues[i]]; @@ -497,7 +502,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, CMD_PRI_LOW, dpaa2_portal->dpio_dev->token, evq_info->dpcon->dpcon_id, &channel_index); if (ret < 0) { - PMD_DRV_ERR("Static dequeue cfg failed with ret: %d\n", + DPAA2_EVENTDEV_ERR("Static dequeue cfg failed with ret: %d\n", ret); goto err; } @@ -530,7 +535,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, { uint32_t scale = 1; - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); *timeout_ticks = ns * scale; @@ -541,7 +546,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, static void dpaa2_eventdev_dump(struct rte_eventdev *dev, FILE *f) { - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); RTE_SET_USED(f); @@ -554,7 +559,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, { const char *ethdev_driver = eth_dev->device->driver->name; - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); @@ -576,13 +581,13 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, uint16_t dpcon_id = priv->evq_info[ev_qid].dpcon->dpcon_id; int i, ret; - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); for (i = 0; i < eth_dev->data->nb_rx_queues; i++) { ret = dpaa2_eth_eventq_attach(eth_dev, i, dpcon_id, queue_conf); if (ret) { - PMD_DRV_ERR("dpaa2_eth_eventq_attach failed: ret %d\n", + DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_attach failed: ret %d\n", ret); goto fail; } @@ -606,7 +611,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, uint16_t dpcon_id = priv->evq_info[ev_qid].dpcon->dpcon_id; int ret; - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); if (rx_queue_id == -1) return dpaa2_eventdev_eth_queue_add_all(dev, @@ -615,7 +620,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, ret = dpaa2_eth_eventq_attach(eth_dev, rx_queue_id, dpcon_id, queue_conf); if (ret) { - PMD_DRV_ERR("dpaa2_eth_eventq_attach failed: ret: %d\n", ret); + DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_attach failed: ret: %d\n", ret); return ret; } return 0; @@ -627,14 +632,14 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, { int i, ret; - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); for (i = 0; i < eth_dev->data->nb_rx_queues; i++) { ret = dpaa2_eth_eventq_detach(eth_dev, i); if (ret) { - PMD_DRV_ERR("dpaa2_eth_eventq_detach failed: ret %d\n", + DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_detach failed: ret %d\n", ret); return ret; } @@ -650,14 +655,14 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, { int ret; - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); if (rx_queue_id == -1) return dpaa2_eventdev_eth_queue_del_all(dev, eth_dev); ret = dpaa2_eth_eventq_detach(eth_dev, rx_queue_id); if (ret) { - PMD_DRV_ERR("dpaa2_eth_eventq_detach failed: ret: %d\n", ret); + DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_detach failed: ret: %d\n", ret); return ret; } @@ -668,7 +673,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, dpaa2_eventdev_eth_start(const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev) { - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); RTE_SET_USED(eth_dev); @@ -680,7 +685,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, dpaa2_eventdev_eth_stop(const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev) { - PMD_DRV_FUNC_TRACE(); + EVENTDEV_INIT_FUNC_TRACE(); RTE_SET_USED(dev); RTE_SET_USED(eth_dev); @@ -737,7 +742,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, dpci_dev->token, i, &rx_queue_cfg); if (ret) { - PMD_DRV_LOG(ERR, + DPAA2_EVENTDEV_ERR( "set_rx_q failed with err code: %d", ret); return ret; } @@ -758,7 +763,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, sizeof(struct dpaa2_eventdev), rte_socket_id()); if (eventdev == NULL) { - PMD_DRV_ERR("Failed to create eventdev vdev %s", name); + DPAA2_EVENTDEV_ERR("Failed to create eventdev vdev %s", name); goto fail; } @@ -792,7 +797,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, ret = dpaa2_eventdev_setup_dpci(dpci_dev, dpcon_dev); if (ret) { - PMD_DRV_LOG(ERR, + DPAA2_EVENTDEV_ERR( "dpci setup failed with err code: %d", ret); return ret; } @@ -810,7 +815,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, const char *name; name = rte_vdev_device_name(vdev); - PMD_DRV_LOG(INFO, "Initializing %s", name); + DPAA2_EVENTDEV_INFO("Initializing %s", name); return dpaa2_eventdev_create(name); } @@ -820,7 +825,7 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, const char *name; name = rte_vdev_device_name(vdev); - PMD_DRV_LOG(INFO, "Closing %s", name); + DPAA2_EVENTDEV_INFO("Closing %s", name); return rte_event_pmd_vdev_uninit(name); } diff --git a/drivers/event/dpaa2/dpaa2_eventdev.h b/drivers/event/dpaa2/dpaa2_eventdev.h index 96524fa..91c8f2a 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.h +++ b/drivers/event/dpaa2/dpaa2_eventdev.h @@ -16,18 +16,6 @@ #define EVENTDEV_NAME_DPAA2_PMD event_dpaa2 -#ifdef RTE_LIBRTE_PMD_DPAA2_EVENTDEV_DEBUG -#define PMD_DRV_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) -#define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>") -#else -#define PMD_DRV_LOG(level, fmt, args...) do { } while (0) -#define PMD_DRV_FUNC_TRACE() do { } while (0) -#endif - -#define PMD_DRV_ERR(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args) - #define DPAA2_EVENT_DEFAULT_DPCI_PRIO 0 #define DPAA2_EVENT_MAX_QUEUES 16 diff --git a/drivers/event/dpaa2/dpaa2_eventdev_logs.h b/drivers/event/dpaa2/dpaa2_eventdev_logs.h new file mode 100644 index 0000000..7d250c3 --- /dev/null +++ b/drivers/event/dpaa2/dpaa2_eventdev_logs.h @@ -0,0 +1,37 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * Copyright 2018 NXP + */ + +#ifndef _DPAA2_EVENTDEV_LOGS_H_ +#define _DPAA2_EVENTDEV_LOGS_H_ + +extern int dpaa2_logtype_event; + +#define DPAA2_EVENTDEV_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, dpaa2_logtype_event, "%s(): " fmt "\n", \ + __func__, ##args) + +#define EVENTDEV_INIT_FUNC_TRACE() DPAA2_EVENTDEV_LOG(DEBUG, " >>") + +#define DPAA2_EVENTDEV_DEBUG(fmt, args...) \ + DPAA2_EVENTDEV_LOG(DEBUG, fmt, ## args) +#define DPAA2_EVENTDEV_INFO(fmt, args...) \ + DPAA2_EVENTDEV_LOG(INFO, fmt, ## args) +#define DPAA2_EVENTDEV_ERR(fmt, args...) \ + DPAA2_EVENTDEV_LOG(ERR, fmt, ## args) +#define DPAA2_EVENTDEV_WARN(fmt, args...) \ + DPAA2_EVENTDEV_LOG(WARNING, fmt, ## args) + +/* DP Logs, toggled out at compile time if level lower than current level */ +#define DPAA2_EVENTDEV_DP_LOG(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt, ## args) + +#define DPAA2_EVENTDEV_DP_DEBUG(fmt, args...) \ + DPAA2_EVENTDEV_DP_LOG(DEBUG, fmt, ## args) +#define DPAA2_EVENTDEV_DP_INFO(fmt, args...) \ + DPAA2_EVENTDEV_DP_LOG(INFO, fmt, ## args) +#define DPAA2_EVENTDEV_DP_WARN(fmt, args...) \ + DPAA2_EVENTDEV_DP_LOG(WARNING, fmt, ## args) + +#endif /* _DPAA2_EVENTDEV_LOGS_H_ */ diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c index cdb3f86..c949b2d 100644 --- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c +++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include -- 1.9.1