From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0089.outbound.protection.outlook.com [104.47.1.89]) by dpdk.org (Postfix) with ESMTP id C5FC9AACE for ; Mon, 2 Apr 2018 15:51:59 +0200 (CEST) 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=qEasZ0Z5dXpZjeaBMnKHqoCqXocdfhbmLX9ypk1TrzxrPYk9TqbPj2lRHzuNlCH2yCLoIr8XBFKMr5I+mVz9x6iNwG7tO0/ifKCo9C0y71EGF95GG+ihn1JliyOGiSwITywIQ4IvxWJ54YY26no25RvtILNk+TjbmNq1qlRmw58= 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.631.10; Mon, 2 Apr 2018 13:51:53 +0000 From: Shreyansh Jain To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, akhil.goyal@nxp.com, Shreyansh Jain Date: Mon, 2 Apr 2018 19:35:58 +0530 Message-Id: <20180402140601.21078-5-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180402140601.21078-1-shreyansh.jain@nxp.com> References: <20180323120456.16920-1-shreyansh.jain@nxp.com> <20180402140601.21078-1-shreyansh.jain@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: KAWPR01CA0081.jpnprd01.prod.outlook.com (2603:1096:402:c::17) 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: 4d3e38a9-1dac-42cd-9f60-08d598a0e708 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:27QaisFbtb5ZrNX7hzl+egEIGDTZ5iA26ZECXGisGsKUezoX02w43mMXCypg8GxoEnA75tXdKGoTJplJTxGdyGziCLUMXGu64z45mIcx0l6akhj7//p9pvLjXbrT4z6uG+US7QREDEVeCbR8QsupjfdDx5MGAVjMqMh5y2uSwzFtOTrFNgiz0mU+NFYQwSYmvYShbEUUwz7pWl4EopyUAkOHwCykglS/ptzF9BvQqux3HipilODacn3fUBQUtWxV; 25:NdBaFvYmLVfpZJskhC4JcZBnfZqY4DHjYVFKgogXzTdxzYoQs2EyOJGEaz3j3AGyara7RpcqaImidahYbukWlT1HumWLPRpn4bnO5+ZX0MyMdq11rg79lMT1vtQ4yaseFHkXH0lylw6F1YXlPVgEtoNmk9JggYdzTreaRpQwZIctqb4+hRir+TrsssCF8Zow+IgEkP8d/Z8X1tdTO8hXicuKlLRy0At7r6jff03cZLLydE8iEk2nw3wduXUdbMgnLYYj3pYHyS5DCIKSLl0KHWbcxh1g5Xd0RvT3B7JbBJRRWotQct0eEeB5W0NuJ7Xajn/xEtIEa9fjOEBT8i3HWw==; 31:vXfHZXHMewQlt6KOab+9P4wGi41DAY9C6GkUdQ8XMo2HnxFwmnhkLOlC9F8OKe1ww/GSEDWmVrhmgjyjxRoLQ4M5912CH351EANc75hnUurESI315WsQjq019ZlgkIks4vaUlxC2m4GVlwgkc84+rGE89wQlIvgNsUgA3XyH6OG8EDCWUG++u/tnwltaXPDPcDrabPJgQawlFK5eoKAG25vhwc5oDjnke7Z55TMwLgQ= X-MS-TrafficTypeDiagnostic: HE1PR0402MB2778: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0402MB2778; 20:XYc3LqK/zGSwHYPXriRV9jOdIxJmnQVqtzbLGhzPEAreoLZvoZMmP48qYsDWvJ0xy/ODj2MBZQr0o7Qo0CiwtWtVSt0ISov0gs6Dnsk+c8iRqSQN8NiDJkix2LZeUiNa0ZGHQxW8OvQ//dvNNbSXF46V5l2RSHKyvv3Xm6bB7BOwdWYfBecz+zXc0cMN6m5L1N188K3jt16ZykW3jgxISK0Ln1VRXJztN/FR8PpCjkXE0XkPFlV37Pno8aHSQGslRNDIYaWjENPgv1tr9Ab37iUnLuphzO78gP+1idYSANoSlTzAzsIsfRDIohpPp93+TnsY6gKXxemXsXkTjBFwfRd2ckVPVXx+q4glI3H3jihDSDI3dIPQUVdoAZZIA5gsCgkW3kPpdtOPdxV1XCFQ6fL6y32j8WKNj808ODAnf2pR+nH5OxeaHvEGgcZ3ooOHptJXzAPLHqt20QXFTwnwngwdLHuQ33IbZmSOtxBhqL7QdmzhVAA3Xy75QWRE1sG1; 4:0ASBbvD9zg/eTNj21Odx9VOqzfAFLBleV2gMoNwzt1E+MoEprObhfw6Qoev/yBT6mjN4R4kI0gkX76liyDCTwEcaIQxZTZVLiHaZ0pY+0BELv59X6gQo274XHvHSuYah8wHV3flHKs8EtnV/7/8sUcOr6OlkEH3EdVgM1KMGOdCNOoif7biyhhrVntRM9sbsA+FQTlF7JNdNCvdfo3OYcyMszfsyfr/bkiH8B2b/B0EtpItCyVt6/AmYqtpNnIijKxgFB3yLyzbaAtCffT0X3KBua4jZnn7/bSTlVaNf9eYNsABMeVDH9Whe0/ai/yaEVX/QqX24L8S7fRmRs0bYLBZd2RQ2IN2d5Dh3jsbQ//k= 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)(10201501046)(93006095)(93001095)(3002001)(3231221)(944501327)(52105095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:HE1PR0402MB2778; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0402MB2778; X-Forefront-PRVS: 0630013541 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(39860400002)(366004)(376002)(39380400002)(396003)(346002)(199004)(189003)(6486002)(5890100001)(8936002)(11346002)(2906002)(8676002)(52116002)(6506007)(106356001)(2351001)(36756003)(5009440100003)(16586007)(105586002)(66066001)(86362001)(386003)(81156014)(81166006)(446003)(50226002)(2361001)(4326008)(6916009)(59450400001)(2616005)(305945005)(68736007)(486005)(5660300001)(6512007)(6116002)(55236004)(97736004)(3846002)(47776003)(50466002)(51416003)(25786009)(476003)(486005)(478600001)(76176011)(16526019)(26005)(956004)(48376002)(7736002)(1076002)(316002)(186003)(53936002)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0402MB2778; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0402MB2778; 23:tGu5E5Do8Ymgc5LrsdGEAR4KIZNwsHeCRisV04E?= =?us-ascii?Q?i64pYXZM/166fMKQSRee7xydPqeNGPSzLdmnedhknmeb4mqxFL7YlPWRz7ff?= =?us-ascii?Q?Rm0lxXj8HrUGt65cyWfszAAEEbBLnt/FyufdVZ32zWLbIRJqM7zECeP2WUOD?= =?us-ascii?Q?1pgEalBj9C45zpAkKINJMFZecJKDuG8TcASW2pYP/Fp4FQWIVC8J/qR5tjfa?= =?us-ascii?Q?cD3ebtcANj65h1P9UUaIYN2rWDPjk9z8F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Bma8eGHNvJxyG5015p9Eg6xe3vnSgwAp+/FELcGg27lOwT0jbnvdDBSRgD74FdA3rq7XEioIDoAcBoWR9KO7v8m3i2GiuUPgExBKx2oI96/IJJluG2cyK0smjXm+ZrCjThAlDd5Pjb8HOkwmubviGvHAdGNIwY=; 24:EUMyTpyLOYN5Uyl9CfbHIqwAf8/h+rdY8b32mPd4tdcEaUzEpgWfeHvH7g4Dewyb6G3ruXh/i7ZSf60gtFM6wyrbwMrkAtkZmiMzphAfUFo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0402MB2778; 7:kja7PFcLkRQEk+VEdyiPm76F6h6Vh2/NHepY/FP0QeBEQHEXwGmRCxIhZcz1OH37lQ9FV6LluxLSXLFZgwhCBHP3Hiqe6UvSb3TNMTM7iFXyApQJINuBHtTz6ILiZ6f33Pfjipfo2v9yA8WMoi4c9dnNbJQw0a8HdUl9B2X8nMX59F7FouEddrzgC77ez5pp6sgj41ga4DqcyEz+NYDvmp0Zgy0e0jDu59MpTL3Ai5jCTUtECE64dQnaVGPS2e6D X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Apr 2018 13:51:53.9365 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d3e38a9-1dac-42cd-9f60-08d598a0e708 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 v4 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, 02 Apr 2018 13:52:00 -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