Skip to contentSkip to conversation

no printf in drivers code

DISCUSSION Thomas Monjalon 7 participants 9 messages Feb 3, 2023 – Feb 8, 2023

lore
Share & tools
lore
#0 lore raw

Hello,

We have too many drivers using printf() instead of rte_log(). Please propose a plan to replace or remove the calls to printf(). If no plan, I could propose one but you may not like it :)

Affected drivers are:
baseband/acc
bus/dpaa
bus/fslmc
crypto/caam_jr
crypto/ccp
dma/ioat
net/dpaa
net/dpaa2
net/nfp
net/qede
net/txgbe
raw/ifpga

PS: printf is allowed for tests and dumps.

#1 lore raw
Quoted 19 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Friday, February 3, 2023 7:57 AM
To: Nicolas Chautru <[email protected]>; [email protected]; Sachin Saxena <[email protected]>; Gagandeep Singh <[email protected]>; Sunil Uttarwar <[email protected]>; Bruce Richardson <[email protected]>; Conor Walsh <[email protected]>; Chaoyong He <[email protected]>; Niklas Soderlund <[email protected]>; Rasesh Mody <[email protected]>; Devendra Singh Rawat <[email protected]>; Jiawen Wu <[email protected]>; Jian Wang <[email protected]>; Rosen Xu <[email protected]>; Tianfei zhang <[email protected]>
Cc: [email protected]; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]
Subject: no printf in drivers code

Quoted 5 lines

Hello,

We have too many drivers using printf() instead of rte_log(). Please propose a plan to replace or remove the calls to printf(). If no plan, I could propose one but you may not like it :)

Does it make sense to add scripts to CI to capture this issue? In general, we do not want printfs in DPDK code (other than tests, sample apps?)

Quoted 17 lines

Affected drivers are:
baseband/acc
bus/dpaa
bus/fslmc
crypto/caam_jr
crypto/ccp
dma/ioat
net/dpaa
net/dpaa2
net/nfp
net/qede
net/txgbe
raw/ifpga

PS: printf is allowed for tests and dumps.

#2 lore raw

03/02/2023 17:18, Honnappa Nagarahalli:

Quoted 8 lines

From: Thomas Monjalon <[email protected]>

Quoted 4 lines

We have too many drivers using printf() instead of rte_log(). Please propose a plan to replace or remove the calls to printf(). If no plan, I could propose one but you may not like it :)

Does it make sense to add scripts to CI to capture this issue?
In general, we do not want printfs in DPDK code (other than tests, sample apps?)

It's difficult to automate because printfs are acceptable
in dump functions, selftest, and testpmd code hosted in drivers directories.

#3 lore raw
Quoted 8 lines · Thomas Monjalon

03/02/2023 17:18, Honnappa Nagarahalli:

Quoted 6 lines

From: Thomas Monjalon <[email protected]>

Quoted 4 lines

We have too many drivers using printf() instead of rte_log(). Please propose a plan to replace or remove the calls to printf(). If no plan, I could propose one but you may not like it :)

Quoted 5 lines
Quoted 2 lines

Does it make sense to add scripts to CI to capture this issue?
In general, we do not want printfs in DPDK code (other than tests, sample apps?)

It's difficult to automate because printfs are acceptable
in dump functions, selftest, and testpmd code hosted in drivers directories.

We can identify which parts need those, create dedicated helpers that do call printf (but are excluded from the check), and and then the printf exclusion is applied to the whole tree.

Signature · 1 line
David Marchand
#4 lore raw

<snip>

Quoted 16 lines

Subject: Re: no printf in drivers code

Quoted 12 lines · Thomas Monjalon

03/02/2023 17:18, Honnappa Nagarahalli:

Quoted 9 lines

From: Thomas Monjalon <[email protected]>

Quoted 4 lines

We have too many drivers using printf() instead of rte_log(). Please propose a plan to replace or remove the calls to printf(). If no plan, I could propose one but you may not like it :)

Does it make sense to add scripts to CI to capture this issue? In general, we do not want printfs in DPDK code (other than tests, sample apps?)

Quoted 6 lines
Quoted 2 lines

It's difficult to automate because printfs are acceptable in dump functions, selftest, and testpmd code hosted in drivers directories.

We can identify which parts need those, create dedicated helpers that do call printf (but are excluded from the check), and and then the printf exclusion is applied to the whole tree.

+1

Quoted 4 lines

--
David Marchand

#5 lore raw
In reply to Thomas Monjalon
Quoted 20 lines

Hello,

We have too many drivers using printf() instead of rte_log(). Please propose a plan to replace or remove the calls to printf(). If no plan, I could propose one but you may not like it :)

Affected drivers are:
baseband/acc
bus/dpaa
bus/fslmc
crypto/caam_jr
crypto/ccp
dma/ioat
net/dpaa
net/dpaa2
net/nfp
net/qede
net/txgbe
raw/ifpga

Quoted 1 line

PS: printf is allowed for tests and dumps.

Hi Thomas,

I sent a patch to the mailing list to swap the printf in the IOAT driver to rte log. I didn't change the fptintf's within the dump function as advised above.

Thanks,
Conor.

#6 lore raw
In reply to Thomas Monjalon
Quoted 11 lines

From: Thomas Monjalon <[email protected]>

Hello,

We have too many drivers using printf() instead of rte_log(). Please propose a plan to replace or remove the calls to printf(). If no plan, I could propose one but you may not like it :)

Affected drivers are:
baseband/acc

Will push a patch for this next week. These actually currently only occur when called indirectly from test application, but still no concern to replace.

Quoted 14 lines

bus/dpaa
bus/fslmc
crypto/caam_jr
crypto/ccp
dma/ioat
net/dpaa
net/dpaa2
net/nfp
net/qede
net/txgbe
raw/ifpga

PS: printf is allowed for tests and dumps.

#7 lore raw
In reply to Thomas Monjalon

Hi Thomas,

Quoted 6 lines · Thomas Monjalon

Hello,

We have too many drivers using printf() instead of rte_log(). Please propose a plan to replace or remove the calls to printf(). If no plan, I could propose one but you may not like it :)

Quoted 10 lines

Affected drivers are:
baseband/acc
bus/dpaa
bus/fslmc
crypto/caam_jr
crypto/ccp
dma/ioat
net/dpaa
net/dpaa2
net/nfp

A patch for NFP have been post as part of the series '[PATCH 0/3] cleanup the PMD'.

Quoted 7 lines

net/qede
net/txgbe
raw/ifpga

PS: printf is allowed for tests and dumps.

Signature · 2 lines
Kind Regards,
Niklas Söderlund
#8 lore raw

Hi Thomas,

Quoted 15 lines · Thomas Monjalon

Hello,

Quoted 14 lines

We have too many drivers using printf() instead of rte_log(). Please propose a plan to replace or remove the calls to printf(). If no plan, I could propose one but you may not like it :)

Affected drivers are:
baseband/acc
bus/dpaa
bus/fslmc
crypto/caam_jr
crypto/ccp
dma/ioat
net/dpaa
net/dpaa2

[Hemant] NXP will send the patches shortly.

Quoted 5 lines
Quoted 5 lines

net/nfp
net/qede
net/txgbe
raw/ifpga

Regards
Hemant