From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: [PATCH v2 1/3] common/dpaax: reduce logging level Date: Wed, 17 Oct 2018 10:10:34 +0000 Message-ID: <20181017100954.18284-2-shreyansh.jain@nxp.com> References: <20181017091151.15017-1-shreyansh.jain@nxp.com> <20181017100954.18284-1-shreyansh.jain@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , Shreyansh Jain To: "thomas@monjalon.net" Return-path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30073.outbound.protection.outlook.com [40.107.3.73]) by dpdk.org (Postfix) with ESMTP id 24FA25F2C for ; Wed, 17 Oct 2018 12:10:36 +0200 (CEST) In-Reply-To: <20181017100954.18284-1-shreyansh.jain@nxp.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" DPAAX is a library used by various NXP drivers. In case of non-NXP environment, this start spewing message about unavailability of necessary environment. This patch reduces the log level for certain messages as well as reduces overall log-level. As a library, these message are not necessarily relevant at higher log level, either. Signed-off-by: Shreyansh Jain --- drivers/common/dpaax/dpaax_iova_table.c | 35 +++++++++++++------------ 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax= /dpaax_iova_table.c index 075053b1a..213f75dff 100644 --- a/drivers/common/dpaax/dpaax_iova_table.c +++ b/drivers/common/dpaax/dpaax_iova_table.c @@ -69,8 +69,8 @@ read_memory_node(unsigned int *count) =20 ret =3D glob(MEM_NODE_PATH_GLOB, 0, NULL, &result); if (ret !=3D 0) { - DPAAX_ERR("Unable to glob device-tree memory node: (%s)(%d)", - MEM_NODE_PATH_GLOB, ret); + DPAAX_DEBUG("Unable to glob device-tree memory node: (%s)(%d)", + MEM_NODE_PATH_GLOB, ret); goto out; } =20 @@ -78,8 +78,8 @@ read_memory_node(unsigned int *count) /* Either more than one memory@ node found, or none. * In either case, cannot work ahead. */ - DPAAX_ERR("Found (%zu) entries in device-tree. Not supported!", - result.gl_pathc); + DPAAX_DEBUG("Found (%zu) entries in device-tree. Not supported!", + result.gl_pathc); goto out; } =20 @@ -87,28 +87,29 @@ read_memory_node(unsigned int *count) result.gl_pathv[0]); fd =3D open(result.gl_pathv[0], O_RDONLY); if (fd < 0) { - DPAAX_ERR("Unable to open the device-tree node: (%s)(fd=3D%d)", - MEM_NODE_PATH_GLOB, fd); + DPAAX_DEBUG("Unable to open the device-tree node: (%s)(fd=3D%d)", + MEM_NODE_PATH_GLOB, fd); goto cleanup; } =20 /* Stat to get the file size */ ret =3D fstat(fd, &statbuf); if (ret !=3D 0) { - DPAAX_ERR("Unable to get device-tree memory node size."); + DPAAX_DEBUG("Unable to get device-tree memory node size."); goto cleanup; } =20 DPAAX_DEBUG("Size of device-tree mem node: %lu", statbuf.st_size); if (statbuf.st_size > MEM_NODE_FILE_LEN) { - DPAAX_WARN("More memory nodes available than assumed."); - DPAAX_WARN("System may not work properly!"); + DPAAX_DEBUG("More memory nodes available than assumed."); + DPAAX_DEBUG("System may not work properly!"); } =20 ret =3D read(fd, file_data, statbuf.st_size > MEM_NODE_FILE_LEN ? MEM_NODE_FILE_LEN : statbuf.st_size); if (ret <=3D 0) { - DPAAX_ERR("Unable to read device-tree memory node: (%d)", ret); + DPAAX_DEBUG("Unable to read device-tree memory node: (%d)", + ret); goto cleanup; } =20 @@ -117,15 +118,15 @@ read_memory_node(unsigned int *count) */ *count =3D (statbuf.st_size / 16); if ((*count) <=3D 0 || (statbuf.st_size % 16 !=3D 0)) { - DPAAX_ERR("Invalid memory node values or count. (size=3D%lu)", - statbuf.st_size); + DPAAX_DEBUG("Invalid memory node values or count. (size=3D%lu)", + statbuf.st_size); goto cleanup; } =20 /* each entry is of 16 bytes, and size/16 is total count of entries */ nodes =3D malloc(sizeof(struct reg_node) * (*count)); if (!nodes) { - DPAAX_ERR("Failure in allocating working memory."); + DPAAX_DEBUG("Failure in allocating working memory."); goto cleanup; } memset(nodes, 0, sizeof(struct reg_node) * (*count)); @@ -420,9 +421,9 @@ dpaax_memevent_cb(enum rte_mem_event type, const void *= addr, size_t len, ret =3D dpaax_iova_table_update(phys_addr, 0, map_len); =20 if (ret !=3D 0) { - DPAAX_ERR("PA-Table entry update failed. " - "Map=3D%d, addr=3D%p, len=3D%zu, err:(%d)", - type, va, map_len, ret); + DPAAX_DEBUG("PA-Table entry update failed. " + "Map=3D%d, addr=3D%p, len=3D%zu, err:(%d)", + type, va, map_len, ret); return; } =20 @@ -460,5 +461,5 @@ RTE_INIT(dpaax_log) { dpaax_logger =3D rte_log_register("pmd.common.dpaax"); if (dpaax_logger >=3D 0) - rte_log_set_level(dpaax_logger, RTE_LOG_NOTICE); + rte_log_set_level(dpaax_logger, RTE_LOG_ERR); } --=20 2.17.1