From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0065.outbound.protection.outlook.com [104.47.42.65]) by dpdk.org (Postfix) with ESMTP id 816BC1AEF6 for ; Fri, 12 Jan 2018 16:08:00 +0100 (CET) Received: from CY4PR03CA0019.namprd03.prod.outlook.com (10.168.162.29) by CY1PR03MB2364.namprd03.prod.outlook.com (10.166.207.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Fri, 12 Jan 2018 15:07:59 +0000 Received: from BY2FFO11FD018.protection.gbl (2a01:111:f400:7c0c::118) by CY4PR03CA0019.outlook.office365.com (2603:10b6:903:33::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; Fri, 12 Jan 2018 15:07:58 +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 BY2FFO11FD018.mail.protection.outlook.com (10.1.14.106) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Fri, 12 Jan 2018 15:07:58 +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 w0CF7oOv020468; Fri, 12 Jan 2018 08:07:54 -0700 From: Nipun Gupta To: CC: , , Nipun Gupta Date: Sat, 13 Jan 2018 02:52:56 +0530 Message-ID: <1515792181-11836-2-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515792181-11836-1-git-send-email-nipun.gupta@nxp.com> References: <1515792181-11836-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131602432782552779; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(396003)(39860400002)(39380400002)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(97736004)(51416003)(2906002)(4326008)(53936002)(68736007)(76176011)(47776003)(86362001)(85426001)(81166006)(36756003)(81156014)(498600001)(8676002)(8656006)(5890100001)(2351001)(5660300001)(356003)(48376002)(105606002)(305945005)(106466001)(59450400001)(50466002)(8936002)(77096006)(50226002)(54906003)(16586007)(104016004)(2950100002)(6916009)(296002)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2364; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD018; 1:mrbyIS6ghSSIdtr6Nk7PwLJjlxrRKnb2kIc7Xd+BiE57TIhwgW1+nFSOpetFDO7vx/upzrmuyTFYtWClyrjnEvr+GCJQzVQoiuWg18BLa6qok/r20jWNIJHoNyNsasy4 MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 70c1c21d-d5cb-44b2-cecb-08d559ce440b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020083)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB2364; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 3:NfH6kRycJYw+UklNQyaJwU4lZlzpIyjBSnRdyqsLDYi2PknmEC44RdOMc/eunFkBZeXHCxjZemTuah+Psf5I3/RrvZSuFiE/qrJg3NR1e0X0TrGhj5u/LlE3X6q5Y6KbodkshaoJnBp9PjGT9GfeoorfcGiayLI0tJtLt2CGGLPx8zVHFPB3A/thF7X4vG5fzM5nkuEoAEO8YeBW/wT0DrMHzFOWKArU4WaxKKzDRo+VJSDc4R+3ZrgTDbwIW4qTbpMNrY8EKvAmcuMSg8dRP9XKOJcuD48PCI3blAiGLd3UmD2HzEkUJcqbnLHh/u4Iwr1Lj9ZQEO6Rq4GJoDDhxgjax9PsHnOy7qEWN6n/qrk=; 25:XoaScM81SAftm5sVx7GfsD0wfiplNKu06JBX/ZOQJNu/tZfrJhJ912eJdQshc1ecq63CQkQiOqAjvWZImDYrzBXPKMNlp94ce42JcWvp2CJk3PoEr39UCBjHNsS3Ep+74gKHkcTrrWJ/Fw6fJte6gyCUD6NdYOvvQ6JQXnnD66XY8b+wl7i0rDukPWkXCNC6K8IFmQOSRbdgTGC+bjWYk7TAmjA+CngSv8hiB7YnK6xL8+5O3Oq1fZ2Yb2nNRRZ9c47sCraMOG85yy9PA3Y1REpmLklTBgMlSBq1iN2NEOZ7Bn8N5J8gmeEu0/P2cFYzXyHvXIiFntOh3j0gLsoN2w== X-MS-TrafficTypeDiagnostic: CY1PR03MB2364: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 31:G8iIL2KVfu1f/MJR+Mn7TYqVqiPWaD649ycysL7NmDWddIdCwhLQe4Jk8yiGPpWMJENUz3UxkUNUoM66k3sFWqXE/vRXHSmpwivWsLcizBev173xqU6eIPQ3Cm8RgiopoLU204s3nAUiDqno9I8Wel6UXLf8c6qKysuf0hpnDL4kMd+p5Y11/t1C+Kb+HwyezROBX6J75fZmVSA/im6eX5V3ctDVPMlzjdCVv0h1Avs=; 4:DwY1H2Hemgu2TSvPZUHfTKmjeR5eM/4/RRqvn54Ss3K4rHY5aPW828n+KBE0cR93rxHmMIr187D1fnttDK0DAJAd8IPYJj+AkTN+1O/gO9lhEMjRBIs3242C644fsEY6Lk9dFA9ErDg2O7Fj9zmQITCW/PIBldrwh63HIkc0mqVTVRdnb17Ej4dF/Wr/N6ziA2o+D3JmWIYRtyG36eV/DVyZJqU3zynGWxuvGI7MFYXEOMV7MH7+W63wsuaSuewXvcTV5UXeoSg2ihlWRnM6a+7C5+9tnkJgUjwAfnlnm2HrJt8lhNtCCnoiSGZmFEi5Yk5r6Hb2TAis8C8iwvx7owgQWmMbEF+kBSkGken2F54yA6f7j7Iu9ok7x9mFstMQ 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)(93006095)(93001095)(3231023)(944501144)(3002001)(10201501046)(6055026)(6096035)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703151042153)(20161123559100)(201708071742011); SRVR:CY1PR03MB2364; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2364; X-Forefront-PRVS: 0550778858 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2364; 23:DMjBf/iDjauRE1tlth/dOG6MgngAVLLYj06QHghvb?= =?us-ascii?Q?LddJPtmUANsqKHacE0Gd7GQAuPEUHu9oFYFzUj3q8gT9WZ58lvo7EYT12aum?= =?us-ascii?Q?oQTE4wAAw+P4m0qtrfebIkhho+C3UWvlU1yogQd5xaQZt4XN4j87jNUbc3UO?= =?us-ascii?Q?YyMlbK5ZHC1L7TGWlrrtQqCOD9VpL0t5sDEY3daMrF6zgGV1r0j1uDSwxqK8?= =?us-ascii?Q?0MzQCS/lQwN3uEscYcy2xa8QAn7TtHXEM6CtNuMbXluzGeHS3ujCGwPmLrIu?= =?us-ascii?Q?IrFYnjnqEU60GkNnWn2Pw4mKg1XTe9Ss8xgQX45/t48Cp6NirolRPKr1UR1J?= =?us-ascii?Q?lLdZzKVCqnZTxewxZBLuHIRMfAI56JGdE3J2F4/fKUD6xdd77rumCDQQ/v3y?= =?us-ascii?Q?8G9i4N2qkLflFMD4GZtZeZEBqOK0duKqKOiJHWL+XsS1VuFuZMMwYzHrB+a1?= =?us-ascii?Q?jNe3U49IFDjmjvVVXnw3QT4ZcKlWm/NIm/SGxtPgBBYIRSFFdmiragEQ5/0w?= =?us-ascii?Q?gbb4crLel0nlvW5mzmhFdBzza5HWI8vuHJtChQrv7cfkTGrEsxD0jerKMU9+?= =?us-ascii?Q?TtUOuBAxTdtNW4XrG6a3sx44EJzvQrASTQ129cI5hPxuaUg2IVCjvMm5zSt7?= =?us-ascii?Q?HNMcAYn4n2odIp5uri/evHTAtI3dUufm+FY21tr54WQ9ODMSzQfy/xNKOZbS?= =?us-ascii?Q?F69D2obDpaz67krdDe5o49mgxljXlVCXOii4PcOEj+XRPdBHBnwV7Ll8/lCZ?= =?us-ascii?Q?qkh8oLDG7OHIy6vNIV7Wbks75Onx+0zYb8Yk5UHmhI3uOK8uSD4He0hqlp8e?= =?us-ascii?Q?/DtelZ62h4lkPk9wuhdS3yCUW+Pn5Iwma5TX+Bgr/ZcKOCJ9rGgUknfZV24l?= =?us-ascii?Q?cC2noTUTAgaOU7shKzNt7wuyxTRCFJ5wMU8UDzYzwMNMjPudH0feukt9yDJw?= =?us-ascii?Q?mrBGaAEJee3ch4HC4ZKsTkp+PBYboYJJdGBaCIWqq0NSnq4MhOUXHDErc27H?= =?us-ascii?Q?bvdHuK36JlhUCPTPMKOugcFSfAPN3WCeMai0EsgcG0lpxhGd/7a39Q/ZRBuW?= =?us-ascii?Q?FJABP4blsNVdGzO9OYYe2ypD4xFVoR0thxWkmgzk4tDjOv46vOJf6spf/3EE?= =?us-ascii?Q?yTDNl0OLu8=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2364; 6:SIHk162hJIfC9j93khhfH6emf6+mqECutRFVdzUJJfTu3TLpMvY1CXfDl2x0vvp2EwYGOE1YGvMN6IVRLyysf4MLkRwZDwd3RQas6Nrkrkrre64ZHd8A4kCd2ZBGsmwdvnagxd25QdzZFcyOqLx4IoGG0szcDWOo4xGnBNFpCpYdVM9o/TXbIcfsuEwjPfDHwxfSfxRU4flVyLUb/ygVhnJEZ9OoY+oaFgpew8OJKcHQ2M5gTALN/P92/XldX9Y4ufulUEBvNLcC6sg/eRc/rMS5thELFuHRb0qmIwhbRlBKWM2ME3832KonqrqEIGZmqe4I9Nuo0E8cE8LWzkJot4RpaI95eWHipFyBgCeEKHg=; 5:zn+Hs4OCzNFa8TEgaiH89/CK+FeOL9Pei8kuxQnDLPx9IFhtOqLi225nOoGbqK6XLEesYn6RPEAyaaxNSdU/+UuCqfomtGRzl+ft2bxadTaCSZxImhY+z+ydkY+DNhtjm491A9V7pBAD4IDrBFc/rr4WpeMrYhHqdyjZv2XAp/M=; 24:JcJqm8rkYTw52m5pA10aNQ5noY7us/QJAEOSyCpMQvOYismnpHSvPbsGgFqa2qR8ablj18jU/J+jwhhQAlQnQelfvGZPYKqxF5xc4rLEL/o=; 7:OC2kSN4dE6stu74Z+jLvwuXhDLAW2JdkJpaOX7M63zjMijEultYz3PErHrYITWB+waRpHcvg4+juK0v4CHiCvpTbxUItDTV0bfnBblyUaUVhVytgK3ImK3KXhWkoWc7VzWIBuRDH52TjYqq0ltCXlmo73qCeDGb0skXIkozG00z8h+lXR7oAmj3SGgn/P2xvWdC/tNO6gxap5UwO9e1KPjHp9cok5IXtL/P1fih35LEjZ0x7xbFKrnnSZoqsVMW2 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 15:07:58.0524 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 70c1c21d-d5cb-44b2-cecb-08d559ce440b 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: CY1PR03MB2364 Subject: [dpdk-dev] [PATCH 1/6 v2] 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: Fri, 12 Jan 2018 15:08:01 -0000 Signed-off-by: Nipun Gupta --- 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 ba7e514..83b572f 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); @@ -316,7 +320,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; @@ -326,14 +330,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); @@ -343,7 +348,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); } @@ -351,7 +356,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); @@ -362,7 +367,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); @@ -377,7 +382,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); @@ -391,7 +396,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; @@ -402,7 +407,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); @@ -419,7 +424,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); } @@ -428,7 +433,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); @@ -454,7 +459,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]]; @@ -480,7 +485,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]]; @@ -492,7 +497,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; } @@ -525,7 +530,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; @@ -536,7 +541,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); @@ -549,7 +554,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); @@ -571,13 +576,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; } @@ -601,7 +606,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, @@ -610,7 +615,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; @@ -622,14 +627,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; } @@ -645,14 +650,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; } @@ -663,7 +668,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); @@ -675,7 +680,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); @@ -732,7 +737,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; } @@ -753,7 +758,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; } @@ -787,7 +792,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; } @@ -805,7 +810,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); } @@ -815,7 +820,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