From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0073.outbound.protection.outlook.com [104.47.2.73]) by dpdk.org (Postfix) with ESMTP id 5E9905F39 for ; Fri, 23 Mar 2018 12:50:45 +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=jNMeh8Nn6uv43ZHxjqRTl7hUvwr+56vBKrlCx3trj18=; b=pweo7SuqO8KhtlsOZ3baf+0L0LpE/NJSfgZludzN4llum0Y2gW+8YBYUYzE+PKOYyHwhLw7CNqc4gTTiaPLoW1ftftqZJeTkflzJSHu9YNIT0KVu4lfYoYjeZlCI+yf6WpgGo6pnP9n34g7k/QGJU8xttnCfa3JtA1b/f/jfn6Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; Received: from localhost.localdomain (14.142.187.166) by HE1PR0402MB2778.eurprd04.prod.outlook.com (2603:10a6:3:d4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.14; Fri, 23 Mar 2018 11:50:40 +0000 From: Shreyansh Jain To: dev@dpdk.org Cc: ferruh.yigit@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, akhil.goyal@nxp.com, Shreyansh Jain Date: Fri, 23 Mar 2018 17:34:53 +0530 Message-Id: <20180323120456.16920-5-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180323120456.16920-1-shreyansh.jain@nxp.com> References: <20180313054431.19556-1-shreyansh.jain@nxp.com> <20180323120456.16920-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0016.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::26) To HE1PR0402MB2778.eurprd04.prod.outlook.com (2603:10a6:3:d4::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9ac47308-2294-45f2-579b-08d590b44e4e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0402MB2778; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0402MB2778; 3:OZOPMgTBSijyHTk+6yACyqtJSuykbpL1re6wfZD00xOicz4bDZUoEnXqZCNuWzp1bMxwYvOQDfkp6tjI6silfsmmsqL9bk1GdqykD6xxzFoEyo8bMD2Zc5q5fCxt+UevdSJF663fkQtDrCL0xYM0Oa7MCeqMMxfV1k5MREqICcIGyu2SKFQxGooEYdwsEnFVvdxoug9Zzl3L4vX4N55QqVggAOVOi2LDAXlmXjnW5lxhrl82pa3l3SkhDslw0PY/; 25:4bwoeduk94y2Pdu1cFhcc/dTQRryhRlM2VNDQqR7YwCMqAtB3ltuIHqoySTZRfwNnlWDzaBBoca66Lbxc/0wNWJ7SDrp8gOe859eh0BVYp8SHApRYmF0NvKNRjQLhrUesLpFp3sgLJW1TBMFOewjQl7/KgwBh2yzAF6/EhO9aAZEMhnpkmbuFhiv9E/4beowe71gQimjjOQxf2xA1C1zz92sIpxzu2g2aXj5aRilFsDdbLnyaN4WDv68oxCwVxh8Frv/rTN0/6/MR2C36/U4QVsDOs7Lb36XhaE8UGxKJEjTxGy7ImUpUtMSwXSaV5+aooFNIrYubgah9UDJGWP+Pw==; 31:iXVf4sa8qZaxaE4sl7d6gwQREGF3ySRGPjjmilZFc69W9LkIqSy0V7sVTvcPpNrBiOFupCiSEaj9ViNGowWurTZxojJhDvL4UkhpSf4Qfz1MvdZlqh1YTRcLUKL1LGUbdZ4YEg40NTax9pd3MT25llo5l50DV8rISGf6Vna9L9icpejV4YDOE1ABhaqzK+rSUvUEkIyOKWaKXCAHXAw5TM1/G0nJ9YOYDRYIHDb3o0Q= X-MS-TrafficTypeDiagnostic: HE1PR0402MB2778: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0402MB2778; 20:LIW2oZ9YFtrorgDSmqd17y9kJHTF8Pcn9Ph30yCbbSSAzAKdOTB7Ddvn3836aRXKB6fEyNfED5lvtwWoirvofz++gqpOkrE7uw54VD9jcFZTwIlklPRahvnwyjBZty0BXQShskS2VCMNzoz4pShVlBem4MeNUEDs4npj0mHV7QXpz1GK+j6/4qiCeXqVDlef//2QpQh7fkAcf2wDuxMBOZf/GzI2eKnx5s+v/ib3tMKe38n2QwoKglPVe/0CGmB+oXealdMeIDZchaWyoRjGEGkMEaDvjjUj1IhVomJFFWm6ZJ/3ENXWOj15wxe1iBmpBzxtsUyRecbiIvtmIVe8ztmHKfeJAQ8EsaBa6M14IS5wcP0v6DRdHeOWJjmkgCsSrR8ScN5I6pLRGw1r5CDdrbG1zPs8G1tJk00qMySIubX9JSpWux1eqlivLlAzSGtiaRQ6HWXII/c760da6lDsAfY5KSyI2B2L2d19oudIdlsK6zUcIJN5oJv8uLIDrPhn; 4:ifvrh4Uth2Dl3fKjsHJamElyHIWfP5bxmM9lmZB0E8DcVfIAjT1B0KITuMKdsRXyD/kFOTAM4ZO9HI2nlLUVfroejkIEvsgrXaXWw6bF8Ef2eGngIen7K4tNrLLFs5rZ9WogrPqTU6gGMDuEr2Pl3QAZdHCw6L/tQwsiSiwhTdzJtYw4HfGXJmNCiV+cQTEcgtWXbmQbndAuS2KUKstBo5yyip7lPrmEeTV8bBPNlZWrdHf5RbS/SCZJW0JFKgZMNuuFj/gXKFSrQg1o2fAR6PyRIyqgwVpIWCgHfIzhySB1uLf9mQJWoZ2Vae4N/zPayDQeioQL8Mlkg1ic5OcS2jWnayk8sNZnSXgEwr4Jzws= 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)(5005006)(8121501046)(3231221)(944501327)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041310)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:HE1PR0402MB2778; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0402MB2778; X-Forefront-PRVS: 0620CADDF3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(396003)(376002)(39380400002)(39860400002)(366004)(189003)(199004)(6666003)(59450400001)(105586002)(50226002)(52116002)(25786009)(97736004)(316002)(2361001)(6512007)(51416003)(2351001)(86362001)(6916009)(6486002)(2906002)(16586007)(26005)(3846002)(68736007)(11346002)(106356001)(4326008)(1076002)(5660300001)(6116002)(16526019)(6506007)(386003)(186003)(446003)(36756003)(7736002)(478600001)(5890100001)(305945005)(48376002)(66066001)(47776003)(5009440100003)(55236004)(8676002)(81166006)(53936002)(81156014)(50466002)(8936002)(76176011)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0402MB2778; 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; HE1PR0402MB2778; 23:7kltSfdD5bnmmgPn3nqBrAnjyT+JywuUKCsJrcI?= =?us-ascii?Q?viiDVj4DEQrhcJ6VTj/9i7WGYXCUV6P7D4nKEMFftxAAx2VtvX44tkLJmDDl?= =?us-ascii?Q?2x3tU8H+2T2tkatyvMIwkc+Z/vDssUqCvarIbP2HVFv9xaSRTO1cyLkUlEoN?= =?us-ascii?Q?QF3JPJHkhh2Dd4cAS9f+hEzJesp6KkAtBHPec4ECv2ONgbAT3FODhUnUSmHU?= =?us-ascii?Q?kc+VXLVNU8rP9W/WpfYoiB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NLtavP2qI+3GtxnhJwlx3T6/6f3Ca81ng6ek83KsJvmV7TbkXm4wHpnjknV+nddiW4euQ/tGdsRtoK4fzT7A=; 7:jhR9Jh9q8aBiGzaoz44OyE8eVg2hjFygRRaN0FLNZFT0uPmxuFiwk9EA4UtCV4s1gnRE1ZQGo6Yq8d76U5xJJyogNBnesotzx21HBEYORKL8ylw8LqA9Uw+9q9pR7Z4cw9DgqUlvzF0laou06yNkgShLzZYUaxQaa2s15w2tEnKX9O6ICJnwminJeKMgkbzE+0AL2Y64CPkAFMkfasfNzJneFUelrv3k0/DGp+xKAy6eTYhjHSEiiKCRUD1JpL9M SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2018 11:50:40.9438 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ac47308-2294-45f2-579b-08d590b44e4e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0402MB2778 Subject: [dpdk-dev] [PATCH v3 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: Fri, 23 Mar 2018 11:50:45 -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 Acked-by: Nipun Gupta --- 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..ad94f24be 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=pmd.event.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..9d9c8d3db 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("pmd.event.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