From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30052.outbound.protection.outlook.com [40.107.3.52]) by dpdk.org (Postfix) with ESMTP id 2A2734F9A for ; Mon, 12 Mar 2018 10:11:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=HkIBP9UkOqS7trvvtp5q4MJOwRPUFjAlDWqFu0gfQB8=; b=jc3W4jvdvBE+bL2O8vF7UT3A0QefOHHurObBwUntG/RYTozzISz6ZN4BgZAUYC0KhLk9gplUzadUcTRpPb7h2WjHZB1MhacpEktoIn7VOrjnivqpjg7eXgFa8Qw6P4SYr2dkV21ezUTmyKrJFCg78DC0YEFnG3FlfmVKKSGEQlY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from localhost.localdomain (14.142.187.166) by DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:96::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Mon, 12 Mar 2018 09:11:12 +0000 From: Shreyansh Jain To: ferruh.yigit@intel.com Cc: dev@dpdk.org, hemant.agrawal@nxp.com, akhil.goyal@nxp.com, nipun.gupta@nxp.com, Shreyansh Jain Date: Mon, 12 Mar 2018 14:55:44 +0530 Message-Id: <20180312092547.18472-5-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180312092547.18472-1-shreyansh.jain@nxp.com> References: <20180312092547.18472-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR01CA0098.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::14) To DB6PR0402MB2773.eurprd04.prod.outlook.com (2603:10a6:4:96::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d285c314-a982-4d28-d938-08d587f93459 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0402MB2773; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0402MB2773; 3:Wnfu/V33ILv2Xjf8oxVZ4euhWsVEDwA19IVUG8nwlUv9fr5nI8r3oJ6NUWwKRzHxhbGK4VF/FluZ0NaLcC3+G66GNwSho3KCOJNU5t/D1CCBt73zzScPbkXe5zyZzDneucMVmhv1z/mAAn7aOEg33ph1I2ig6Svw8J7JZQlPRwwBPmO1X2X50BgkHvtZFqsDbfBb/6/txdG9V7ARHNp+pRgDIgaL+2aV8KcfHVU8F0nrWmrye9Fe6pKzweZ0Q9Xg; 25:4N5J0yEJSsLq43pqskWNSdEpJCW32mGMxnj7qBRUlI0AcgX9bU45gZtR3L9byc+rgeEGGpf3FBm+vG+HcNv+RX84QloqZtXpbR+H5c9j+V2Q33pqF40rcPmzlFducOOsYife6wThsurql8i8ulj1J0btB0F9Q9iXA5x6LuQdC/GnXWi+AAu83ZzFmRl5ji42US96x2fTUFhFH96WAGSc70rHzM7NCoNTLTJScoK0Oagtbt730F8CKn4jotyZ39F1CpK8iWidqThhMVzXwL7yF+2aJWlUfHSsy6M6tAwMV9Ez/YSt/GGeAApl+dF3UOVXbFL97tHpVTVweE50K2gu5A==; 31:ncAnkktoHbep/v+bsriBF7J+8atNyqRpeHRZJBvXdy/4jP42JQMC3LRJOOvX+iwDz1t3r6BCX7hNsUivFcmmIDftbYjFz2yiWVPEZeU07dVjyF54W8u4AEeSZkTfj+WMK+98NhEmzRS9S6WT0oudtEvg+EIqqjPbYVfHYhiatLP/LLxTMHoabHWSRPFzQjXXEV5AsiMh8PrnEgjO+UjZT7btyGxZfiPC3DL1712pZOQ= X-MS-TrafficTypeDiagnostic: DB6PR0402MB2773: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0402MB2773; 20:KkaM3qSOo+J3YfWVw+YmayDQlvL/SVLNVNjODlte1bu3Qr4xhp2sG7xH4juBL0JWzpOV/4zMJV0IbkTWJmsMjPPm97CkXqvR1wyhtWQvsCFHunJ+mP1hmgY2J6q3M0zDbVjGvhnnoTZuF7zUJDvK6AMfdtv36+V8Qp4Nol4J/psCybyTdsC7giG2oWV9NmdyfIY8jDUlAUb5K9atheudskoH+1W7wMgKwMDGESgPGSGvcLOQLTB9gPzPzPFIg2+aS5TjZ8f4vdsah2DDzMcwhqT8YRv5kWzrW3uplZmgWCXb9alCkEANZHBgyAx1UohZBe1LYAywAZ5NxHrTqKMpowqmtSjOc111ZPKN+SvLkHjRHsu98zd1NXQ14Qg8A2FGvDAj9bSlTdbCt56W5r8hUEs8n3dtYfPMAiJ5ye4/uNnVEflhMnIcziY3C50AlEzhsLyW842t05w489DEl9GjnvWkhMhLuXS9ad3NcCsjje9k2kE1vhCTRnrUAJ3lPEWW; 4:ecPuhbLf77HGeKLchglQA6z4R+FUfnQM2996YUZGXT1pKwdc5qBvl6HH87tm6JqbbXwaDy0wArVsizEVTnUlvkx9VqDQauYKjzpuhbkJfZv62cvHewDBY+drKfTN6FSFlnsBnsBy8oWN7unJfeiYDqw8UEvQY2XPV5cbydZ0t/CIHLhlnpgNneL/xGRE6O58UFEEP4/n0vdWhPh32TxAH/mQ3s59awdiHxf76dAgttkTKVEAXI7zVWeuAS/f2fH0l+ZkqaI6W//jc8hxzxSQqzy1TQpsVzd/t88FSMfgzKDZCPIA4NL5amqZSDOJSF+okViFglUgREv3y6fhR5P1C8wb9Lt9EmDN/w5xaqV6WhA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(6055026)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:DB6PR0402MB2773; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0402MB2773; X-Forefront-PRVS: 06098A2863 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(39380400002)(39860400002)(376002)(366004)(346002)(189003)(199004)(5660300001)(186003)(16526019)(26005)(47776003)(8676002)(66066001)(8936002)(81156014)(81166006)(6916009)(2950100002)(2906002)(36756003)(2361001)(2351001)(86362001)(6512007)(50226002)(52116002)(5890100001)(51416003)(76176011)(97736004)(6486002)(25786009)(6116002)(68736007)(4326008)(7736002)(6506007)(386003)(478600001)(305945005)(106356001)(53936002)(50466002)(1076002)(59450400001)(16586007)(3846002)(316002)(105586002)(5009440100003)(48376002)(6666003)(55236004)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0402MB2773; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0402MB2773; 23:JsfG3fYwHUGV8L+Aw2B8JcJ9TK3yygBtRzw+FCh?= =?us-ascii?Q?OeK25qsGK7aSS4mrMNEFFyHQNp5izsMli/KYRz7JpcKwJX541oFQyMXCGlUh?= =?us-ascii?Q?qko+YNrogZTr0SOR6NEKcl3Oc9r/ZXve9vfCFjgLb7bPx+Yg+r/rQhFc7N0z?= =?us-ascii?Q?jQ847j6IbJQJmGce+v4qbNAw4CM/EsUf+JEk8eqwUom7PaY4TCsQ9Xp/l1J5?= =?us-ascii?Q?KbPPCu0mKSDTpn3FypsZf+VStp1YKZXwyseEt1akFysYVyBw/79loCJKH5yq?= =?us-ascii?Q?7R6VhcVWVaedyjL8/urzYtmc/ZryVa/5q6i9dj0fVZD4h/Sr7IaDBf6ML8mc?= =?us-ascii?Q?NbQZ7vPYIWVpktZqV9BRWRl+rkfGJ53CfEJMVJIGkOWfnkEbAvq1ZkeFPpjY?= =?us-ascii?Q?V8r+xipBel1ziACro4BHb9cNRtAFvnvtELXEhms56fR4A4aXwHJdFpoE11LU?= =?us-ascii?Q?isxyqyPuiOkG7HYwMDPm3mbKE5MglmZV+eKEgejlgm2s3aIWUL2qblQ+ki6z?= =?us-ascii?Q?8jdeczuT1QnhNC/oiFPB0qjQTthybZa2MJtVhbxoBbhBJ235pTETxV6jZCU3?= =?us-ascii?Q?Em9QSF3id895oXoEPQgWWSRCsSY/0M7/VxnmHhxbbUnP2YTEcg2p2Mo3NR1L?= =?us-ascii?Q?2KprK5CNeJ1e8X6nVEUpy27dTe7SpNe14S/SqTIJ2Skh1cHauSZ7jF/87uHk?= =?us-ascii?Q?sZbSAZNxKMauq3Pnptjxjb65Y49F4Rg+mMmmcYq5qqR5P7zQ0IYw7FCIOnC0?= =?us-ascii?Q?cafbqulz4atW2wwK/0nZwLB0ggxFdz1sgW10PaGJyvdf7gCSflPZyVE1sdjU?= =?us-ascii?Q?IT0idee4E0CbSwImjfDmAbakpjs1rEV2c1cxIpMfudlzh9PycZWBAJM7U4Dl?= =?us-ascii?Q?4HHLNBabbqqk3oUbtmBwigNco/dEMy/0LwvBkgUtDprdWdpVf9uEGBpiU8HX?= =?us-ascii?Q?i8cqs+4Ao/UhTR1KOkCcIaP7o2+hO/aPkUOR0Llp0HW9uaY40B6u4Q5yi6vG?= =?us-ascii?Q?R/MHQUFozhAu/OxtKeuH28mCSqEqh5fH1onwWYsCxz6syBHpgnEFfFjpCzZL?= =?us-ascii?Q?07zy5Ao9ZOzcZY/FnNWGI7Erg3iHpbnt8LF77tTajJAZqcNkdXuSz/887EAb?= =?us-ascii?Q?UeCNeSl4qc//AkC1zme13KUyTYMGL1jUouQLk96BdjJmIdyxjz8xWh0cC6IC?= =?us-ascii?Q?Oey0S9M/IgrfgS/mT4qlnsA/Z7gLGeedJ+/fxaynE9wewohxAU5I+2Eyd3x9?= =?us-ascii?Q?mDFKGOWzPYOav/J/kBUeQOgAZRHaxtmlmyaoXJcUyxKdC25/Ap3C0NG8qG2l?= =?us-ascii?Q?DYcjOZkWsNrEGZjwE00o8wvk=3D?= X-Microsoft-Antispam-Message-Info: VviKl8DzYMADwTJjdJwEGqgUHKwielrogqDtpFzKj3gnFE62QxQKH0IznDwMY7xmKGnBMmBmq/GGWAcZH1kckPhhjhhCsy9FYXLvBnMaWxQgx37vbSpJdRrESkANSrqOdY11Le6uxfij8grrgKRYScREqjUR5+aWVXiTAgd7Rtkl0syta9u+a1yKAZ4tvj0b X-Microsoft-Exchange-Diagnostics: 1; DB6PR0402MB2773; 6:gIYUew95qcoFHi9pLgLqwN3xw7TJStqECJMONb7jaXYloES0DGpNNie6zh5aEQdcR/QWQaNCPCpjpEx10Yy5Ajc41Lp0mnD04W2CUeImBdM8OXpLfCDsU1ezo50f0gP09l6pGEMJ/2gfffFaROcg3acxA+qd/dRaCvN501B4jpaAF48gA58r9PoJqSL+qi7ScQuwCGiLx0vL2fBXy4GytkZobrd45wCr6Qi6o8hSzwA/OIug7XSBqPOMtZIqNAFmURULQ1nwSn3kok6N/hKaKc8R+udW/AbEMs5Elo70pACaVX6koi3JK7iZgO22EBEKCsyorZDMeI8W1rNzL9wQOfaT6wJK0z6vLq+dWq/eWwg=; 5:ewkVgBx9DtQDRQyYJ03HhsHNgkiVYvgUvi4sl/noFEQO3DKL+tV4+DmzKLP4+YrMt5LS0h4bS8H8rtQgYhEj2I/89Zwm1szS3h3r/03ThQKbSdwKnAbfKONSvTBcLz6gTxu588Rs5FQaDByTBVfUYbMauTbfp7QVt3StDOUX/bQ=; 24:3hcayb5oNOSt2t2UyhZZ2AgmJFUme3G0FG8D8uPVjrp2gxitG/H6G0g+YtMOPfXrsfYBxMYWvs2yr4hIP/awKXOKaPONOU+PLtXF2Zg2d6g=; 7:kxH53OIKCWbmqnzgoEg9XizvLUzQj3eeY7tDacmGBES5UOFR0+Z65HzUeAmis+0DRC1jDrh1jMoZVql4MPKqq/FITGAiyiKzNQPHUXS0zsjxinsDveNwrK++MDY7d+VhTx9fPtPKl3H30DvARxK3n71id/0a4gmALVDel0iWZdaonzq4iXBAd902kV9xWVAjSEYefBb8AliZjXiD/lspwBcuH02her74xBCAqo9zaDmfz1UfIZXp8FOsUqJDnWuh SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2018 09:11:12.3484 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d285c314-a982-4d28-d938-08d587f93459 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0402MB2773 Subject: [dpdk-dev] [PATCH 4/7] event/dpaa2: change to 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: Mon, 12 Mar 2018 09:11:15 -0000 Some changes had already been pushed via SHA:72654f090a11 patch. This patch updates them. Cc: nipun.gupta@nxp.com Signed-off-by: Shreyansh Jain --- doc/guides/eventdevs/dpaa2.rst | 14 ++++++++- drivers/event/dpaa2/dpaa2_eventdev.c | 49 +++++++++++++++++++------------ drivers/event/dpaa2/dpaa2_eventdev_logs.h | 10 ++++--- drivers/event/dpaa2/dpaa2_hw_dpcon.c | 15 +++++----- 4 files changed, 57 insertions(+), 31 deletions(-) diff --git a/doc/guides/eventdevs/dpaa2.rst b/doc/guides/eventdevs/dpaa2.rst index 5b8da95d7..e8089b532 100644 --- a/doc/guides/eventdevs/dpaa2.rst +++ b/doc/guides/eventdevs/dpaa2.rst @@ -129,7 +129,19 @@ Example: .. code-block:: console - ./your_eventdev_application --vdev="event_dpaa2" + ./your_eventdev_application --vdev="event_dpaa2" + +Enabling logs +------------- + +For enabling logs, use the following EAL parameter: + +.. code-block:: console + + ./your_eventdev_application --log-level=eventdev.dpaa2, + +Using ``eventdev.dpaa2`` as log matching criteria, all Event PMD logs can be +enabled which are lower than logging ``level``. Limitations ----------- diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 8800b47f5..750aac9ef 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -72,7 +72,7 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], if (unlikely(!DPAA2_PER_LCORE_DPIO)) { ret = dpaa2_affine_qbman_swp(); if (ret) { - DPAA2_EVENTDEV_ERR("Failure in affining portal\n"); + DPAA2_EVENTDEV_ERR("Failure in affining portal"); return 0; } } @@ -122,7 +122,8 @@ dpaa2_eventdev_enqueue_burst(void *port, const struct rte_event ev[], if (!loop) return num_tx; frames_to_send = loop; - DPAA2_EVENTDEV_ERR("Unable to allocate memory"); + DPAA2_EVENTDEV_ERR( + "Unable to allocate event object"); goto send_partial; } rte_memcpy(ev_temp, event, sizeof(struct rte_event)); @@ -167,9 +168,9 @@ static void dpaa2_eventdev_dequeue_wait(uint64_t timeout_ticks) * case to avoid the problem. */ if (errno == EINTR) { - DPAA2_EVENTDEV_DEBUG("epoll_wait fails\n"); + DPAA2_EVENTDEV_DEBUG("epoll_wait fails"); if (i++ > 10) - DPAA2_EVENTDEV_DEBUG("Dequeue burst Failed\n"); + DPAA2_EVENTDEV_DEBUG("Dequeue burst Failed"); goto RETRY; } } @@ -227,7 +228,7 @@ dpaa2_eventdev_dequeue_burst(void *port, struct rte_event ev[], if (unlikely(!DPAA2_PER_LCORE_DPIO)) { ret = dpaa2_affine_qbman_swp(); if (ret) { - DPAA2_EVENTDEV_ERR("Failure in affining portal\n"); + DPAA2_EVENTDEV_ERR("Failure in affining portal"); return 0; } } @@ -263,7 +264,7 @@ dpaa2_eventdev_dequeue_burst(void *port, struct rte_event ev[], rxq->cb(swp, fd, dq, rxq, &ev[num_pkts]); } else { qbman_swp_dqrr_consume(swp, dq); - DPAA2_EVENTDEV_ERR("Null Return VQ received\n"); + DPAA2_EVENTDEV_ERR("Null Return VQ received"); return 0; } @@ -335,7 +336,7 @@ dpaa2_eventdev_configure(const struct rte_eventdev *dev) priv->event_dev_cfg = conf->event_dev_cfg; DPAA2_EVENTDEV_DEBUG("Configured eventdev devid=%d", - dev->data->dev_id); + dev->data->dev_id); return 0; } @@ -502,8 +503,8 @@ dpaa2_eventdev_port_link(struct rte_eventdev *dev, void *port, CMD_PRI_LOW, dpaa2_portal->dpio_dev->token, evq_info->dpcon->dpcon_id, &channel_index); if (ret < 0) { - DPAA2_EVENTDEV_ERR("Static dequeue cfg failed with ret: %d\n", - ret); + DPAA2_EVENTDEV_ERR( + "Static dequeue config failed: err(%d)", ret); goto err; } @@ -587,8 +588,8 @@ dpaa2_eventdev_eth_queue_add_all(const struct rte_eventdev *dev, ret = dpaa2_eth_eventq_attach(eth_dev, i, dpcon_id, queue_conf); if (ret) { - DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_attach failed: ret %d\n", - ret); + DPAA2_EVENTDEV_ERR( + "Event queue attach failed: err(%d)", ret); goto fail; } } @@ -620,7 +621,8 @@ dpaa2_eventdev_eth_queue_add(const struct rte_eventdev *dev, ret = dpaa2_eth_eventq_attach(eth_dev, rx_queue_id, dpcon_id, queue_conf); if (ret) { - DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_attach failed: ret: %d\n", ret); + DPAA2_EVENTDEV_ERR( + "Event queue attach failed: err(%d)", ret); return ret; } return 0; @@ -639,8 +641,8 @@ dpaa2_eventdev_eth_queue_del_all(const struct rte_eventdev *dev, for (i = 0; i < eth_dev->data->nb_rx_queues; i++) { ret = dpaa2_eth_eventq_detach(eth_dev, i); if (ret) { - DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_detach failed: ret %d\n", - ret); + DPAA2_EVENTDEV_ERR( + "Event queue detach failed: err(%d)", ret); return ret; } } @@ -662,7 +664,8 @@ dpaa2_eventdev_eth_queue_del(const struct rte_eventdev *dev, ret = dpaa2_eth_eventq_detach(eth_dev, rx_queue_id); if (ret) { - DPAA2_EVENTDEV_ERR("dpaa2_eth_eventq_detach failed: ret: %d\n", ret); + DPAA2_EVENTDEV_ERR( + "Event queue detach failed: err(%d)", ret); return ret; } @@ -743,7 +746,8 @@ dpaa2_eventdev_setup_dpci(struct dpaa2_dpci_dev *dpci_dev, &rx_queue_cfg); if (ret) { DPAA2_EVENTDEV_ERR( - "set_rx_q failed with err code: %d", ret); + "DPCI Rx queue setup failed: err(%d)", + ret); return ret; } } @@ -763,7 +767,7 @@ dpaa2_eventdev_create(const char *name) sizeof(struct dpaa2_eventdev), rte_socket_id()); if (eventdev == NULL) { - DPAA2_EVENTDEV_ERR("Failed to create eventdev vdev %s", name); + DPAA2_EVENTDEV_ERR("Failed to create Event device %s", name); goto fail; } @@ -798,7 +802,7 @@ dpaa2_eventdev_create(const char *name) ret = dpaa2_eventdev_setup_dpci(dpci_dev, dpcon_dev); if (ret) { DPAA2_EVENTDEV_ERR( - "dpci setup failed with err code: %d", ret); + "DPCI setup failed: err(%d)", ret); return ret; } priv->max_event_queues++; @@ -836,3 +840,12 @@ static struct rte_vdev_driver vdev_eventdev_dpaa2_pmd = { }; RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_DPAA2_PMD, vdev_eventdev_dpaa2_pmd); + +RTE_INIT(dpaa2_eventdev_init_log); +static void +dpaa2_eventdev_init_log(void) +{ + dpaa2_logtype_event = rte_log_register("eventdev.dpaa2"); + if (dpaa2_logtype_event >= 0) + rte_log_set_level(dpaa2_logtype_event, RTE_LOG_NOTICE); +} diff --git a/drivers/event/dpaa2/dpaa2_eventdev_logs.h b/drivers/event/dpaa2/dpaa2_eventdev_logs.h index 7d250c3f1..48f1abd1f 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev_logs.h +++ b/drivers/event/dpaa2/dpaa2_eventdev_logs.h @@ -9,13 +9,15 @@ 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) + rte_log(RTE_LOG_ ## level, dpaa2_logtype_event, "dpaa2_event: " \ + fmt "\n", ##args) + +#define DPAA2_EVENTDEV_DEBUG(fmt, args...) \ + rte_log(RTE_LOG_DEBUG, dpaa2_logtype_event, "dpaa2_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...) \ diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c index f2377b983..d64e588aa 100644 --- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c +++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c @@ -20,11 +20,11 @@ #include #include -#include #include #include #include #include "dpaa2_eventdev.h" +#include "dpaa2_eventdev_logs.h" TAILQ_HEAD(dpcon_dev_list, dpaa2_dpcon_dev); static struct dpcon_dev_list dpcon_dev_list @@ -42,7 +42,8 @@ rte_dpaa2_create_dpcon_device(int dev_fd __rte_unused, /* Allocate DPAA2 dpcon handle */ dpcon_node = rte_malloc(NULL, sizeof(struct dpaa2_dpcon_dev), 0); if (!dpcon_node) { - PMD_DRV_LOG(ERR, "Memory allocation failed for DPCON Device"); + DPAA2_EVENTDEV_ERR( + "Memory allocation failed for dpcon device"); return -1; } @@ -51,8 +52,8 @@ rte_dpaa2_create_dpcon_device(int dev_fd __rte_unused, ret = dpcon_open(&dpcon_node->dpcon, CMD_PRI_LOW, dpcon_id, &dpcon_node->token); if (ret) { - PMD_DRV_LOG(ERR, "Resource alloc failure with err code: %d", - ret); + DPAA2_EVENTDEV_ERR("Unable to open dpcon device: err(%d)", + ret); rte_free(dpcon_node); return -1; } @@ -61,8 +62,8 @@ rte_dpaa2_create_dpcon_device(int dev_fd __rte_unused, ret = dpcon_get_attributes(&dpcon_node->dpcon, CMD_PRI_LOW, dpcon_node->token, &attr); if (ret != 0) { - PMD_DRV_LOG(ERR, "Reading device failed with err code: %d", - ret); + DPAA2_EVENTDEV_ERR("dpcon attribute fetch failed: err(%d)", + ret); rte_free(dpcon_node); return -1; } @@ -75,8 +76,6 @@ rte_dpaa2_create_dpcon_device(int dev_fd __rte_unused, TAILQ_INSERT_TAIL(&dpcon_dev_list, dpcon_node, next); - RTE_LOG(DEBUG, PMD, "DPAA2: Added [dpcon.%d]\n", dpcon_id); - return 0; } -- 2.14.1