[2/2] drivers: replace printf with fprintf for debug functions

Message ID 20230215102905.22767-2-hemant.agrawal@nxp.com (mailing list archive)
State Changes Requested
Delegated to: Thomas Monjalon
Headers
Series [1/2] drivers: replace printf with log macros |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Hemant Agrawal Feb. 15, 2023, 10:29 a.m. UTC
  This patch replaces simple printf with fprintf for debug dump
related functions for various NXP dpaaX related drivers.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 drivers/bus/dpaa/base/fman/netcfg_layer.c   | 20 ++++----
 drivers/crypto/caam_jr/caam_jr.c            |  4 +-
 drivers/crypto/caam_jr/caam_jr_desc.h       |  2 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 20 ++++----
 drivers/crypto/dpaa_sec/dpaa_sec.c          | 52 ++++++++++-----------
 drivers/net/dpaa2/dpaa2_flow.c              | 40 ++++++++--------
 6 files changed, 69 insertions(+), 69 deletions(-)
  

Comments

Thomas Monjalon Feb. 15, 2023, 3:16 p.m. UTC | #1
15/02/2023 11:29, Hemant Agrawal:
> This patch replaces simple printf with fprintf for debug dump
> related functions for various NXP dpaaX related drivers.

Why replacing with fprintf(stdout)?

Would it be better to provide a FILE* parameter to the functions?
  
Stephen Hemminger Feb. 15, 2023, 5:17 p.m. UTC | #2
On Wed, 15 Feb 2023 15:59:05 +0530
Hemant Agrawal <hemant.agrawal@nxp.com> wrote:

> diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c
> index 6a405c984d..69cee08fb9 100644
> --- a/drivers/bus/dpaa/base/fman/netcfg_layer.c
> +++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c
> @@ -33,33 +33,33 @@ dump_netcfg(struct netcfg_info *cfg_ptr)
>  {
>  	int i;
>  
> -	printf("..........  DPAA Configuration  ..........\n\n");
> +	fprintf(stdout, "..........  DPAA Configuration  ..........\n\n");
>  

If you only do "printf -> fprintf(stdout," then it doesn't make sense.
Ideally change debug interface to take a user supplied output FILE *
like other dump routines.
  
Hemant Agrawal Feb. 16, 2023, 9:27 a.m. UTC | #3
On 15-Feb-23 8:46 PM, Thomas Monjalon wrote:
> 15/02/2023 11:29, Hemant Agrawal:
>> This patch replaces simple printf with fprintf for debug dump
>> related functions for various NXP dpaaX related drivers.
> Why replacing with fprintf(stdout)?
>
> Would it be better to provide a FILE* parameter to the functions?
yes, I will update.
>
>
>
  
David Marchand July 2, 2024, 9:31 a.m. UTC | #4
Hello Hemant,

On Thu, Feb 16, 2023 at 10:28 AM Hemant Agrawal
<hemant.agrawal@oss.nxp.com> wrote:
> On 15-Feb-23 8:46 PM, Thomas Monjalon wrote:
> > 15/02/2023 11:29, Hemant Agrawal:
> >> This patch replaces simple printf with fprintf for debug dump
> >> related functions for various NXP dpaaX related drivers.
> > Why replacing with fprintf(stdout)?
> >
> > Would it be better to provide a FILE* parameter to the functions?
> yes, I will update.

Any news for this series?
At least a rebase is needed, I marked it as changes requested.
  
Hemant Agrawal July 2, 2024, 9:59 a.m. UTC | #5
On 02-07-2024 15:01, David Marchand wrote:
> Hello Hemant,
>
> On Thu, Feb 16, 2023 at 10:28 AM Hemant Agrawal
> <hemant.agrawal@oss.nxp.com> wrote:
>> On 15-Feb-23 8:46 PM, Thomas Monjalon wrote:
>>> 15/02/2023 11:29, Hemant Agrawal:
>>>> This patch replaces simple printf with fprintf for debug dump
>>>> related functions for various NXP dpaaX related drivers.
>>> Why replacing with fprintf(stdout)?
>>>
>>> Would it be better to provide a FILE* parameter to the functions?
>> yes, I will update.
> Any news for this series?
> At least a rebase is needed, I marked it as changes requested.

I missed it. i will send it.


>
>
  

Patch

diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c
index 6a405c984d..69cee08fb9 100644
--- a/drivers/bus/dpaa/base/fman/netcfg_layer.c
+++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c
@@ -33,33 +33,33 @@  dump_netcfg(struct netcfg_info *cfg_ptr)
 {
 	int i;
 
-	printf("..........  DPAA Configuration  ..........\n\n");
+	fprintf(stdout, "..........  DPAA Configuration  ..........\n\n");
 
 	/* Network interfaces */
-	printf("Network interfaces: %d\n", cfg_ptr->num_ethports);
+	fprintf(stdout, "Network interfaces: %d\n", cfg_ptr->num_ethports);
 	for (i = 0; i < cfg_ptr->num_ethports; i++) {
 		struct fman_if_bpool *bpool;
 		struct fm_eth_port_cfg *p_cfg = &cfg_ptr->port_cfg[i];
 		struct fman_if *__if = p_cfg->fman_if;
 
-		printf("\n+ Fman %d, MAC %d (%s);\n",
+		fprintf(stdout, "\n+ Fman %d, MAC %d (%s);\n",
 		       __if->fman_idx, __if->mac_idx,
 		       (__if->mac_type == fman_mac_1g) ? "1G" :
 		       (__if->mac_type == fman_mac_2_5g) ? "2.5G" : "10G");
 
-		printf("\tmac_addr: " RTE_ETHER_ADDR_PRT_FMT "\n",
+		fprintf(stdout, "\tmac_addr: " RTE_ETHER_ADDR_PRT_FMT "\n",
 		       RTE_ETHER_ADDR_BYTES(&__if->mac_addr));
 
-		printf("\ttx_channel_id: 0x%02x\n",
+		fprintf(stdout, "\ttx_channel_id: 0x%02x\n",
 		       __if->tx_channel_id);
 
-		printf("\tfqid_rx_def: 0x%x\n", p_cfg->rx_def);
-		printf("\tfqid_rx_err: 0x%x\n", __if->fqid_rx_err);
+		fprintf(stdout, "\tfqid_rx_def: 0x%x\n", p_cfg->rx_def);
+		fprintf(stdout, "\tfqid_rx_err: 0x%x\n", __if->fqid_rx_err);
 
-		printf("\tfqid_tx_err: 0x%x\n", __if->fqid_tx_err);
-		printf("\tfqid_tx_confirm: 0x%x\n", __if->fqid_tx_confirm);
+		fprintf(stdout, "\tfqid_tx_err: 0x%x\n", __if->fqid_tx_err);
+		fprintf(stdout, "\tfqid_tx_confirm: 0x%x\n", __if->fqid_tx_confirm);
 		fman_if_for_each_bpool(bpool, __if)
-			printf("\tbuffer pool: (bpid=%d, count=%"PRId64
+			fprintf(stdout, "\tbuffer pool: (bpid=%d, count=%"PRId64
 			       " size=%"PRId64", addr=0x%"PRIx64")\n",
 			       bpool->bpid, bpool->count, bpool->size,
 			       bpool->addr);
diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index 9373cee57d..d19738b7bf 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -1410,9 +1410,9 @@  caam_jr_enqueue_op(struct rte_crypto_op *op, struct caam_jr_qp *qp)
 			rte_pktmbuf_mtod(op->sym->m_src, void *),
 			rte_pktmbuf_data_len(op->sym->m_src));
 
-	printf("\n JD before conversion\n");
+	fprintf(stdout, "\n JD before conversion\n");
 	for (i = 0; i < 12; i++)
-		printf("\n 0x%08x", ctx->jobdes.desc[i]);
+		fprintf(stdout, "\n 0x%08x", ctx->jobdes.desc[i]);
 #endif
 
 	CAAM_JR_DP_DEBUG("Jr[%p] pi[%d] ci[%d].Before sending desc",
diff --git a/drivers/crypto/caam_jr/caam_jr_desc.h b/drivers/crypto/caam_jr/caam_jr_desc.h
index 135d51c392..1b6a8f9efa 100644
--- a/drivers/crypto/caam_jr/caam_jr_desc.h
+++ b/drivers/crypto/caam_jr/caam_jr_desc.h
@@ -116,7 +116,7 @@ 
 	for (__i = 0;						\
 		__i < SEC_GET_DESC_LEN(descriptor);			\
 		__i++) {						\
-		printf("0x%08x: 0x%08x\n",			\
+		fprintf(stdout, "0x%08x: 0x%08x\n",			\
 			(uint32_t)(((uint32_t *)(descriptor)) + __i),	\
 			*(((uint32_t *)(descriptor)) + __i));		\
 	}								\
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index c25e40030b..c707666f35 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -1685,7 +1685,7 @@  dpaa2_sec_dump(struct rte_crypto_op *op)
 		goto mbuf_dump;
 
 	priv = (struct ctxt_priv *)sess->ctxt;
-	printf("\n****************************************\n"
+	fprintf(stdout, "\n****************************************\n"
 		"session params:\n\tContext type:\t%d\n\tDirection:\t%s\n"
 		"\tCipher alg:\t%d\n\tAuth alg:\t%d\n\tAead alg:\t%d\n"
 		"\tCipher key len:\t%zd\n", sess->ctxt_type,
@@ -1696,7 +1696,7 @@  dpaa2_sec_dump(struct rte_crypto_op *op)
 				sess->cipher_key.length);
 		rte_hexdump(stdout, "auth key", sess->auth_key.data,
 				sess->auth_key.length);
-	printf("\tAuth key len:\t%zd\n\tIV len:\t\t%d\n\tIV offset:\t%d\n"
+	fprintf(stdout, "\tAuth key len:\t%zd\n\tIV len:\t\t%d\n\tIV offset:\t%d\n"
 		"\tdigest length:\t%d\n\tstatus:\t\t%d\n\taead auth only"
 		" len:\t%d\n\taead cipher text:\t%d\n",
 		sess->auth_key.length, sess->iv.length, sess->iv.offset,
@@ -1704,7 +1704,7 @@  dpaa2_sec_dump(struct rte_crypto_op *op)
 		sess->ext_params.aead_ctxt.auth_only_len,
 		sess->ext_params.aead_ctxt.auth_cipher_text);
 #ifdef RTE_LIBRTE_SECURITY
-	printf("PDCP session params:\n"
+	fprintf(stdout, "PDCP session params:\n"
 		"\tDomain:\t\t%d\n\tBearer:\t\t%d\n\tpkt_dir:\t%d\n\thfn_ovd:"
 		"\t%d\n\tsn_size:\t%d\n\thfn_ovd_offset:\t%d\n\thfn:\t\t%d\n"
 		"\thfn_threshold:\t0x%x\n", sess->pdcp.domain,
@@ -1714,29 +1714,29 @@  dpaa2_sec_dump(struct rte_crypto_op *op)
 
 #endif
 	bufsize = (uint8_t)priv->flc_desc[0].flc.word1_sdl;
-	printf("Descriptor Dump:\n");
+	fprintf(stdout, "Descriptor Dump:\n");
 	for (i = 0; i < bufsize; i++)
-		printf("\tDESC[%d]:0x%x\n", i, priv->flc_desc[0].desc[i]);
+		fprintf(stdout, "\tDESC[%d]:0x%x\n", i, priv->flc_desc[0].desc[i]);
 
-	printf("\n");
+	fprintf(stdout, "\n");
 mbuf_dump:
 	sym_op = op->sym;
 	if (sym_op->m_src) {
-		printf("Source mbuf:\n");
+		fprintf(stdout, "Source mbuf:\n");
 		rte_pktmbuf_dump(stdout, sym_op->m_src, sym_op->m_src->data_len);
 	}
 	if (sym_op->m_dst) {
-		printf("Destination mbuf:\n");
+		fprintf(stdout, "Destination mbuf:\n");
 		rte_pktmbuf_dump(stdout, sym_op->m_dst, sym_op->m_dst->data_len);
 	}
 
-	printf("Session address = %p\ncipher offset: %d, length: %d\n"
+	fprintf(stdout, "Session address = %p\ncipher offset: %d, length: %d\n"
 		"auth offset: %d, length:  %d\n aead offset: %d, length: %d\n"
 		, sym_op->session,
 		sym_op->cipher.data.offset, sym_op->cipher.data.length,
 		sym_op->auth.data.offset, sym_op->auth.data.length,
 		sym_op->aead.data.offset, sym_op->aead.data.length);
-	printf("\n");
+	fprintf(stdout, "\n");
 
 }
 
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c
index db52683847..0a47c5c8ad 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -676,16 +676,16 @@  dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp)
 		sess = SECURITY_GET_SESS_PRIV(op->sym->session);
 #endif
 	if (sess == NULL) {
-		printf("session is NULL\n");
+		fprintf(stdout, "session is NULL\n");
 		goto mbuf_dump;
 	}
 
 	cdb = &sess->cdb;
 	rte_memcpy(&c_cdb, cdb, sizeof(struct sec_cdb));
 #ifdef RTE_LIBRTE_SECURITY
-	printf("\nsession protocol type = %d\n", sess->proto_alg);
+	fprintf(stdout, "\nsession protocol type = %d\n", sess->proto_alg);
 #endif
-	printf("\n****************************************\n"
+	fprintf(stdout, "\n****************************************\n"
 		"session params:\n\tContext type:\t%d\n\tDirection:\t%s\n"
 		"\tCipher alg:\t%d\n\tAuth alg:\t%d\n\tAead alg:\t%d\n"
 		"\tCipher key len:\t%"PRIu64"\n\tCipher alg:\t%d\n"
@@ -698,7 +698,7 @@  dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp)
 				sess->cipher_key.length);
 		rte_hexdump(stdout, "auth key", sess->auth_key.data,
 				sess->auth_key.length);
-	printf("\tAuth key len:\t%"PRIu64"\n\tAuth alg:\t%d\n"
+	fprintf(stdout, "\tAuth key len:\t%"PRIu64"\n\tAuth alg:\t%d\n"
 		"\tAuth algmode:\t%d\n\tIV len:\t\t%d\n\tIV offset:\t%d\n"
 		"\tdigest length:\t%d\n\tauth only len:\t\t%d\n"
 		"\taead cipher text:\t%d\n",
@@ -708,7 +708,7 @@  dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp)
 		sess->digest_length, sess->auth_only_len,
 		sess->auth_cipher_text);
 #ifdef RTE_LIBRTE_SECURITY
-	printf("PDCP session params:\n"
+	fprintf(stdout, "PDCP session params:\n"
 		"\tDomain:\t\t%d\n\tBearer:\t\t%d\n\tpkt_dir:\t%d\n\thfn_ovd:"
 		"\t%d\n\tsn_size:\t%d\n\tsdap_enabled:\t%d\n\thfn_ovd_offset:"
 		"\t%d\n\thfn:\t\t%d\n"
@@ -722,63 +722,63 @@  dpaa_sec_dump(struct dpaa_sec_op_ctx *ctx, struct dpaa_sec_qp *qp)
 	c_cdb.sh_hdr.lo.word = rte_be_to_cpu_32(c_cdb.sh_hdr.lo.word);
 	bufsize = c_cdb.sh_hdr.hi.field.idlen;
 
-	printf("cdb = %p\n\n", cdb);
-	printf("Descriptor size = %d\n", bufsize);
+	fprintf(stdout, "cdb = %p\n\n", cdb);
+	fprintf(stdout, "Descriptor size = %d\n", bufsize);
 	int m;
 	for (m = 0; m < bufsize; m++)
-		printf("0x%x\n", rte_be_to_cpu_32(c_cdb.sh_desc[m]));
+		fprintf(stdout, "0x%x\n", rte_be_to_cpu_32(c_cdb.sh_desc[m]));
 
-	printf("\n");
+	fprintf(stdout, "\n");
 mbuf_dump:
 	sym_op = op->sym;
 	if (sym_op->m_src) {
-		printf("Source mbuf:\n");
+		fprintf(stdout, "Source mbuf:\n");
 		rte_pktmbuf_dump(stdout, sym_op->m_src,
 				 sym_op->m_src->data_len);
 	}
 	if (sym_op->m_dst) {
-		printf("Destination mbuf:\n");
+		fprintf(stdout, "Destination mbuf:\n");
 		rte_pktmbuf_dump(stdout, sym_op->m_dst,
 				 sym_op->m_dst->data_len);
 	}
 
-	printf("Session address = %p\ncipher offset: %d, length: %d\n"
+	fprintf(stdout, "Session address = %p\ncipher offset: %d, length: %d\n"
 		"auth offset: %d, length:  %d\n aead offset: %d, length: %d\n",
 		sym_op->session, sym_op->cipher.data.offset,
 		sym_op->cipher.data.length,
 		sym_op->auth.data.offset, sym_op->auth.data.length,
 		sym_op->aead.data.offset, sym_op->aead.data.length);
-	printf("\n");
+	fprintf(stdout, "\n");
 
-	printf("******************************************************\n");
-	printf("ctx info:\n");
-	printf("job->sg[0] output info:\n");
+	fprintf(stdout, "******************************************************\n");
+	fprintf(stdout, "ctx info:\n");
+	fprintf(stdout, "job->sg[0] output info:\n");
 	memcpy(&sg[0], &job->sg[0], sizeof(sg[0]));
-	printf("\taddr = %"PRIx64",\n\tlen = %d,\n\tfinal = %d,\n\textension = %d"
+	fprintf(stdout, "\taddr = %"PRIx64",\n\tlen = %d,\n\tfinal = %d,\n\textension = %d"
 		"\n\tbpid = %d\n\toffset = %d\n",
 		(uint64_t)sg[0].addr, sg[0].length, sg[0].final,
 		sg[0].extension, sg[0].bpid, sg[0].offset);
-	printf("\njob->sg[1] input info:\n");
+	fprintf(stdout, "\njob->sg[1] input info:\n");
 	memcpy(&sg[1], &job->sg[1], sizeof(sg[1]));
 	hw_sg_to_cpu(&sg[1]);
-	printf("\taddr = %"PRIx64",\n\tlen = %d,\n\tfinal = %d,\n\textension = %d"
+	fprintf(stdout, "\taddr = %"PRIx64",\n\tlen = %d,\n\tfinal = %d,\n\textension = %d"
 		"\n\tbpid = %d\n\toffset = %d\n",
 		(uint64_t)sg[1].addr, sg[1].length, sg[1].final,
 		sg[1].extension, sg[1].bpid, sg[1].offset);
 
-	printf("\nctx pool addr = %p\n", ctx->ctx_pool);
+	fprintf(stdout, "\nctx pool addr = %p\n", ctx->ctx_pool);
 	if (ctx->ctx_pool)
-		printf("ctx pool available counts = %d\n",
+		fprintf(stdout, "ctx pool available counts = %d\n",
 			rte_mempool_avail_count(ctx->ctx_pool));
 
-	printf("\nop pool addr = %p\n", op->mempool);
+	fprintf(stdout, "\nop pool addr = %p\n", op->mempool);
 	if (op->mempool)
-		printf("op pool available counts = %d\n",
+		fprintf(stdout, "op pool available counts = %d\n",
 			rte_mempool_avail_count(op->mempool));
 
-	printf("********************************************************\n");
-	printf("Queue data:\n");
-	printf("\tFQID = 0x%x\n\tstate = %d\n\tnb_desc = %d\n"
+	fprintf(stdout, "********************************************************\n");
+	fprintf(stdout, "Queue data:\n");
+	fprintf(stdout, "\tFQID = 0x%x\n\tstate = %d\n\tnb_desc = %d\n"
 		"\tctx_pool = %p\n\trx_pkts = %d\n\ttx_pkts"
 	       "= %d\n\trx_errs = %d\n\ttx_errs = %d\n\n",
 		qp->outq.fqid, qp->outq.state, qp->outq.nb_desc,
diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c
index df06c3862e..4d9fad1596 100644
--- a/drivers/net/dpaa2/dpaa2_flow.c
+++ b/drivers/net/dpaa2/dpaa2_flow.c
@@ -244,7 +244,7 @@  static inline void dpaa2_flow_qos_table_extracts_log(
 	if (!dpaa2_flow_control_log)
 		return;
 
-	printf("Setup QoS table: number of extracts: %d\r\n",
+	fprintf(stdout, "Setup QoS table: number of extracts: %d\r\n",
 			priv->extract.qos_key_extract.dpkg.num_extracts);
 	for (idx = 0; idx < priv->extract.qos_key_extract.dpkg.num_extracts;
 		idx++) {
@@ -253,11 +253,11 @@  static inline void dpaa2_flow_qos_table_extracts_log(
 			priv->extract.qos_key_extract.dpkg.extracts[idx]
 			.extract.from_hdr.field,
 			string);
-		printf("%s", string);
+		fprintf(stdout, "%s", string);
 		if ((idx + 1) < priv->extract.qos_key_extract.dpkg.num_extracts)
-			printf(" / ");
+			fprintf(stdout, " / ");
 	}
-	printf("\r\n");
+	fprintf(stdout, "\r\n");
 }
 
 static inline void dpaa2_flow_fs_table_extracts_log(
@@ -269,7 +269,7 @@  static inline void dpaa2_flow_fs_table_extracts_log(
 	if (!dpaa2_flow_control_log)
 		return;
 
-	printf("Setup FS table: number of extracts of TC[%d]: %d\r\n",
+	fprintf(stdout, "Setup FS table: number of extracts of TC[%d]: %d\r\n",
 			tc_id, priv->extract.tc_key_extract[tc_id]
 			.dpkg.num_extracts);
 	for (idx = 0; idx < priv->extract.tc_key_extract[tc_id]
@@ -279,12 +279,12 @@  static inline void dpaa2_flow_fs_table_extracts_log(
 			priv->extract.tc_key_extract[tc_id].dpkg.extracts[idx]
 			.extract.from_hdr.field,
 			string);
-		printf("%s", string);
+		fprintf(stdout, "%s", string);
 		if ((idx + 1) < priv->extract.tc_key_extract[tc_id]
 			.dpkg.num_extracts)
-			printf(" / ");
+			fprintf(stdout, " / ");
 	}
-	printf("\r\n");
+	fprintf(stdout, "\r\n");
 }
 
 static inline void dpaa2_flow_qos_entry_log(
@@ -296,21 +296,21 @@  static inline void dpaa2_flow_qos_entry_log(
 	if (!dpaa2_flow_control_log)
 		return;
 
-	printf("\r\n%s QoS entry[%d] for TC[%d], extracts size is %d\r\n",
+	fprintf(stdout, "\r\n%s QoS entry[%d] for TC[%d], extracts size is %d\r\n",
 		log_info, qos_index, flow->tc_id, flow->qos_real_key_size);
 
 	key = (uint8_t *)(size_t)flow->qos_rule.key_iova;
 	mask = (uint8_t *)(size_t)flow->qos_rule.mask_iova;
 
-	printf("key:\r\n");
+	fprintf(stdout, "key:\r\n");
 	for (idx = 0; idx < flow->qos_real_key_size; idx++)
-		printf("%02x ", key[idx]);
+		fprintf(stdout, "%02x ", key[idx]);
 
-	printf("\r\nmask:\r\n");
+	fprintf(stdout, "\r\nmask:\r\n");
 	for (idx = 0; idx < flow->qos_real_key_size; idx++)
-		printf("%02x ", mask[idx]);
+		fprintf(stdout, "%02x ", mask[idx]);
 
-	printf("\r\n%s QoS ipsrc: %d, ipdst: %d\r\n", log_info,
+	fprintf(stdout, "\r\n%s QoS ipsrc: %d, ipdst: %d\r\n", log_info,
 		flow->ipaddr_rule.qos_ipsrc_offset,
 		flow->ipaddr_rule.qos_ipdst_offset);
 }
@@ -324,21 +324,21 @@  static inline void dpaa2_flow_fs_entry_log(
 	if (!dpaa2_flow_control_log)
 		return;
 
-	printf("\r\n%s FS/TC entry[%d] of TC[%d], extracts size is %d\r\n",
+	fprintf(stdout, "\r\n%s FS/TC entry[%d] of TC[%d], extracts size is %d\r\n",
 		log_info, flow->tc_index, flow->tc_id, flow->fs_real_key_size);
 
 	key = (uint8_t *)(size_t)flow->fs_rule.key_iova;
 	mask = (uint8_t *)(size_t)flow->fs_rule.mask_iova;
 
-	printf("key:\r\n");
+	fprintf(stdout, "key:\r\n");
 	for (idx = 0; idx < flow->fs_real_key_size; idx++)
-		printf("%02x ", key[idx]);
+		fprintf(stdout, "%02x ", key[idx]);
 
-	printf("\r\nmask:\r\n");
+	fprintf(stdout, "\r\nmask:\r\n");
 	for (idx = 0; idx < flow->fs_real_key_size; idx++)
-		printf("%02x ", mask[idx]);
+		fprintf(stdout, "%02x ", mask[idx]);
 
-	printf("\r\n%s FS ipsrc: %d, ipdst: %d\r\n", log_info,
+	fprintf(stdout, "\r\n%s FS ipsrc: %d, ipdst: %d\r\n", log_info,
 		flow->ipaddr_rule.fs_ipsrc_offset,
 		flow->ipaddr_rule.fs_ipdst_offset);
 }