DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: david.marchand@redhat.com, dev@dpdk.org
Cc: ferruh.yigit@amd.com, Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: [PATCH] net/dpaa/fmlib: remove new line char from the logs
Date: Tue, 15 Oct 2024 17:35:38 +0530	[thread overview]
Message-ID: <20241015120538.1763051-1-hemant.agrawal@nxp.com> (raw)

This patch remove the new line char from several logs in the
fmlib base driver.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/net/dpaa/fmlib/fm_ext.h | 21 +++++++--
 drivers/net/dpaa/fmlib/fm_lib.c | 76 ++++++++++++++++-----------------
 drivers/net/dpaa/fmlib/fm_vsp.c | 20 ++++-----
 3 files changed, 66 insertions(+), 51 deletions(-)

diff --git a/drivers/net/dpaa/fmlib/fm_ext.h b/drivers/net/dpaa/fmlib/fm_ext.h
index 4666fa3b0b..9a3193674e 100644
--- a/drivers/net/dpaa/fmlib/fm_ext.h
+++ b/drivers/net/dpaa/fmlib/fm_ext.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright 2008-2012 Freescale Semiconductor Inc.
- * Copyright 2017-2020 NXP
+ * Copyright 2017-2024 NXP
  */
 
 #ifndef __FM_EXT_H
@@ -15,8 +15,23 @@
 #define MODULE_FM		0x00010000
 #define __ERR_MODULE__		MODULE_FM
 
-#define _fml_dbg(...)
-#define _fm_ioctl_dbg(...)
+/* #define FM_LIB_DBG */
+
+#if defined(FM_LIB_DBG)
+#define _fml_dbg(...) \
+	RTE_LOG_LINE_PREFIX(DEBUG, DPAA_PMD, "%s: ", __func__, __VA_ARGS__)
+#else
+	#define _fml_dbg(arg...)
+#endif
+
+/*#define FM_IOCTL_DBG*/
+
+#if defined(FM_IOCTL_DBG)
+	#define _fm_ioctl_dbg(...) \
+	RTE_LOG_LINE_PREFIX(DEBUG, DPAA_PMD, "%s: ", __func__, __VA_ARGS__)
+#else
+	#define _fm_ioctl_dbg(arg...)
+#endif
 
 /*
  * @Group	lnx_ioctl_ncsw_grp	NetCommSw Linux User-Space (IOCTL) API
diff --git a/drivers/net/dpaa/fmlib/fm_lib.c b/drivers/net/dpaa/fmlib/fm_lib.c
index 68b519ff8a..b35feba004 100644
--- a/drivers/net/dpaa/fmlib/fm_lib.c
+++ b/drivers/net/dpaa/fmlib/fm_lib.c
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright 2008-2016 Freescale Semiconductor Inc.
- * Copyright 2017-2020 NXP
+ * Copyright 2017-2024 NXP
  */
 
 #include <stdio.h>
@@ -44,7 +44,7 @@ fm_open(uint8_t id)
 	static bool called;
 	ioc_fm_api_version_t ver;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	p_dev = (t_device *)malloc(sizeof(t_device));
 	if (p_dev == NULL)
@@ -75,7 +75,7 @@ fm_open(uint8_t id)
 				ver.version.respin);
 		}
 	}
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return (t_handle)p_dev;
 }
@@ -84,12 +84,12 @@ void fm_close(t_handle h_fm)
 {
 	t_device *p_dev = (t_device *)h_fm;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	close(p_dev->fd);
 	free(p_dev);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 }
 
 uint32_t
@@ -98,7 +98,7 @@ fm_get_api_version(t_handle h_fm, ioc_fm_api_version_t *p_version)
 	t_device *p_dev = (t_device *)h_fm;
 	int ret;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	ret = ioctl(p_dev->fd, FM_IOC_GET_API_VERSION, p_version);
 	if (ret) {
@@ -106,7 +106,7 @@ fm_get_api_version(t_handle h_fm, ioc_fm_api_version_t *p_version)
 			     errno, strerror(errno));
 		RETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);
 	}
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return E_OK;
 }
@@ -118,7 +118,7 @@ fm_pcd_open(t_fm_pcd_params *p_fm_pcd_params)
 	int fd;
 	char dev_name[20];
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	p_dev = (t_device *)malloc(sizeof(t_device));
 	if (p_dev == NULL)
@@ -137,7 +137,7 @@ fm_pcd_open(t_fm_pcd_params *p_fm_pcd_params)
 	p_dev->fd = fd;
 	p_dev->owners = 0;
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return (t_handle)p_dev;
 }
@@ -147,19 +147,19 @@ fm_pcd_close(t_handle h_fm_pcd)
 {
 	t_device *p_dev = (t_device *)h_fm_pcd;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	close(p_dev->fd);
 
 	if (p_dev->owners) {
-		printf("\nTry delete a prev created pcd handler(owners:%u)!\n",
+		printf("\nTry delete a prev created pcd handler(owners:%u)!",
 			p_dev->owners);
 		return;
 	}
 
 	free(p_dev);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 }
 
 uint32_t
@@ -167,12 +167,12 @@ fm_pcd_enable(t_handle h_fm_pcd)
 {
 	t_device *p_dev = (t_device *)h_fm_pcd;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	if (ioctl(p_dev->fd, FM_PCD_IOC_ENABLE))
 		RETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return E_OK;
 }
@@ -182,12 +182,12 @@ fm_pcd_disable(t_handle h_fm_pcd)
 {
 	t_device *p_dev = (t_device *)h_fm_pcd;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	if (ioctl(p_dev->fd, FM_PCD_IOC_DISABLE))
 		RETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return E_OK;
 }
@@ -199,7 +199,7 @@ fm_pcd_net_env_characteristics_set(t_handle h_fm_pcd,
 	t_device *p_pcd_dev = (t_device *)h_fm_pcd;
 	t_device *p_dev = NULL;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	params->id = NULL;
 
@@ -216,7 +216,7 @@ fm_pcd_net_env_characteristics_set(t_handle h_fm_pcd,
 	p_pcd_dev->owners++;
 	p_dev->id = PTR_TO_UINT(params->id);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return (t_handle)p_dev;
 }
@@ -228,7 +228,7 @@ fm_pcd_net_env_characteristics_delete(t_handle h_net_env)
 	t_device *p_pcd_dev = NULL;
 	ioc_fm_obj_t id;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	p_pcd_dev = (t_device *)p_dev->h_user_priv;
 	id.obj = UINT_TO_PTR(p_dev->id);
@@ -240,7 +240,7 @@ fm_pcd_net_env_characteristics_delete(t_handle h_net_env)
 	p_pcd_dev->owners--;
 	free(p_dev);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return E_OK;
 }
@@ -253,7 +253,7 @@ fm_pcd_kg_scheme_set(t_handle h_fm_pcd,
 	t_device *p_dev = NULL;
 	int ret;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	params->id = NULL;
 
@@ -291,7 +291,7 @@ fm_pcd_kg_scheme_set(t_handle h_fm_pcd,
 		p_pcd_dev->owners++;
 	p_dev->id = PTR_TO_UINT(params->id);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return (t_handle)p_dev;
 }
@@ -303,7 +303,7 @@ fm_pcd_kg_scheme_delete(t_handle h_scheme)
 	t_device *p_pcd_dev = NULL;
 	ioc_fm_obj_t id;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	p_pcd_dev =  (t_device *)p_dev->h_user_priv;
 	id.obj = UINT_TO_PTR(p_dev->id);
@@ -317,7 +317,7 @@ fm_pcd_kg_scheme_delete(t_handle h_scheme)
 	p_pcd_dev->owners--;
 	free(p_dev);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return E_OK;
 }
@@ -335,7 +335,7 @@ fm_port_open(t_fm_port_params *p_fm_port_params)
 	char dev_name[30];
 	t_fm_port *p_fm_port;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	p_dev = (t_device *)malloc(sizeof(t_device));
 	if (p_dev == NULL)
@@ -395,7 +395,7 @@ fm_port_open(t_fm_port_params *p_fm_port_params)
 	p_dev->fd = fd;
 	p_dev->h_user_priv = (t_handle)p_fm_port;
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return (t_handle)p_dev;
 }
@@ -405,13 +405,13 @@ fm_port_close(t_handle h_fm_port)
 {
 	t_device *p_dev = (t_device *)h_fm_port;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	close(p_dev->fd);
 	free(p_dev->h_user_priv);
 	free(p_dev);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 }
 
 uint32_t
@@ -419,12 +419,12 @@ fm_port_disable(t_handle h_fm_port)
 {
 	t_device *p_dev = (t_device *)h_fm_port;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	if (ioctl(p_dev->fd, FM_PORT_IOC_DISABLE))
 		RETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return E_OK;
 }
@@ -434,12 +434,12 @@ fm_port_enable(t_handle h_fm_port)
 {
 	t_device *p_dev = (t_device *)h_fm_port;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	if (ioctl(p_dev->fd, FM_PORT_IOC_ENABLE))
 		RETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return E_OK;
 }
@@ -450,7 +450,7 @@ fm_port_set_pcd(t_handle h_fm_port,
 {
 	t_device *p_dev = (t_device *)h_fm_port;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	/* correct h_net_env param from t_fm_portPcdParams */
 	DEV_TO_ID(p->net_env_id);
@@ -509,7 +509,7 @@ fm_port_set_pcd(t_handle h_fm_port,
 	if (ioctl(p_dev->fd, FM_PORT_IOC_SET_PCD, p))
 		RETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return E_OK;
 }
@@ -519,12 +519,12 @@ fm_port_delete_pcd(t_handle h_fm_port)
 {
 	t_device *p_dev = (t_device *)h_fm_port;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	if (ioctl(p_dev->fd, FM_PORT_IOC_DELETE_PCD))
 		RETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return E_OK;
 }
@@ -535,7 +535,7 @@ create_device(t_handle h_user_priv, t_handle h_dev_id)
 	t_device *p_user_priv_dev = (t_device *)h_user_priv;
 	t_device *p_dev = NULL;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	p_dev = (t_device *)malloc(sizeof(t_device));
 	if (p_dev == NULL)
@@ -546,7 +546,7 @@ create_device(t_handle h_user_priv, t_handle h_dev_id)
 	p_user_priv_dev->owners++;
 	p_dev->id = PTR_TO_UINT(h_dev_id);
 
-	_fml_dbg("Finishing.\n");
+	_fml_dbg("Finishing.");
 
 	return (t_handle)p_dev;
 }
diff --git a/drivers/net/dpaa/fmlib/fm_vsp.c b/drivers/net/dpaa/fmlib/fm_vsp.c
index a5901c8f6e..3db652bb64 100644
--- a/drivers/net/dpaa/fmlib/fm_vsp.c
+++ b/drivers/net/dpaa/fmlib/fm_vsp.c
@@ -26,14 +26,14 @@ fm_port_vsp_alloc(t_handle h_fm_port,
 	t_device *p_dev = (t_device *)h_fm_port;
 	ioc_fm_port_vsp_alloc_params_t params;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 	memset(&params, 0, sizeof(ioc_fm_port_vsp_alloc_params_t));
 	memcpy(&params.params, p_params, sizeof(t_fm_port_vspalloc_params));
 
 	if (ioctl(p_dev->fd, FM_PORT_IOC_VSP_ALLOC, &params))
 		RETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);
 
-	_fml_dbg("Called.\n");
+	_fml_dbg("Called.");
 
 	return E_OK;
 }
@@ -47,7 +47,7 @@ fm_vsp_config(t_fm_vsp_params *p_fm_vsp_params)
 
 	p_dev = p_fm_vsp_params->h_fm;
 
-	_fml_dbg("Performing VSP Configuration...\n");
+	_fml_dbg("Performing VSP Configuration...");
 
 	memset(&param, 0, sizeof(ioc_fm_vsp_params_t));
 	memcpy(&param, p_fm_vsp_params, sizeof(t_fm_vsp_params));
@@ -69,7 +69,7 @@ fm_vsp_config(t_fm_vsp_params *p_fm_vsp_params)
 	p_dev->owners++;
 	p_vsp_dev->id = PTR_TO_UINT(param.id);
 
-	_fml_dbg("VSP Configuration completed\n");
+	_fml_dbg("VSP Configuration completed");
 
 	return (t_handle)p_vsp_dev;
 }
@@ -81,7 +81,7 @@ fm_vsp_init(t_handle h_fm_vsp)
 	t_device *p_vsp_dev = (t_device *)h_fm_vsp;
 	ioc_fm_obj_t id;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	p_dev = (t_device *)p_vsp_dev->h_user_priv;
 	id.obj = UINT_TO_PTR(p_vsp_dev->id);
@@ -91,7 +91,7 @@ fm_vsp_init(t_handle h_fm_vsp)
 		RETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);
 	}
 
-	_fml_dbg("Called.\n");
+	_fml_dbg("Called.");
 
 	return E_OK;
 }
@@ -103,7 +103,7 @@ fm_vsp_free(t_handle h_fm_vsp)
 	t_device *p_vsp_dev = (t_device *)h_fm_vsp;
 	ioc_fm_obj_t id;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	p_dev = (t_device *)p_vsp_dev->h_user_priv;
 	id.obj = UINT_TO_PTR(p_vsp_dev->id);
@@ -116,7 +116,7 @@ fm_vsp_free(t_handle h_fm_vsp)
 	p_dev->owners--;
 	free(p_vsp_dev);
 
-	_fml_dbg("Called.\n");
+	_fml_dbg("Called.");
 
 	return E_OK;
 }
@@ -129,7 +129,7 @@ fm_vsp_config_buffer_prefix_content(t_handle h_fm_vsp,
 	t_device *p_vsp_dev = (t_device *)h_fm_vsp;
 	ioc_fm_buffer_prefix_content_params_t params;
 
-	_fml_dbg("Calling...\n");
+	_fml_dbg("Calling...");
 
 	p_dev = (t_device *)p_vsp_dev->h_user_priv;
 	params.p_fm_vsp = UINT_TO_PTR(p_vsp_dev->id);
@@ -142,7 +142,7 @@ fm_vsp_config_buffer_prefix_content(t_handle h_fm_vsp,
 		RETURN_ERROR(MINOR, E_INVALID_OPERATION, NO_MSG);
 	}
 
-	_fml_dbg("Called.\n");
+	_fml_dbg("Called.");
 
 	return E_OK;
 }
-- 
2.25.1


             reply	other threads:[~2024-10-15 12:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-15 12:05 Hemant Agrawal [this message]
2024-10-15 17:05 ` Stephen Hemminger
2024-10-17  0:28   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241015120538.1763051-1-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).