[0/3] replace use of EAL logtype

Message ID 20231211172437.61958-1-stephen@networkplumber.org (mailing list archive)
Headers
Series replace use of EAL logtype |

Message

Stephen Hemminger Dec. 11, 2023, 5:23 p.m. UTC
  There are some places EAL logtype is being used in testpmd
and examples where it should not be. Lets reserve EAL
logtype to only be used by DPDK internals.

Stephen Hemminger (3):
  testpmd: replace EAL logtype with fprintf
  examples/l2fwd-keepalive: don't use EAL logtype
  examples/vm_power_manager: do not use EAL logtype

 app/test-pmd/testpmd.c           | 33 +++++++++++---------------------
 examples/l2fwd-keepalive/shm.c   | 21 +++++++-------------
 examples/vm_power_manager/main.c | 11 ++++-------
 3 files changed, 22 insertions(+), 43 deletions(-)
  

Comments

Tyler Retzlaff Dec. 11, 2023, 7:19 p.m. UTC | #1
On Mon, Dec 11, 2023 at 09:23:22AM -0800, Stephen Hemminger wrote:
> There are some places EAL logtype is being used in testpmd
> and examples where it should not be. Lets reserve EAL
> logtype to only be used by DPDK internals.
> 
> Stephen Hemminger (3):
>   testpmd: replace EAL logtype with fprintf
>   examples/l2fwd-keepalive: don't use EAL logtype
>   examples/vm_power_manager: do not use EAL logtype
> 
>  app/test-pmd/testpmd.c           | 33 +++++++++++---------------------
>  examples/l2fwd-keepalive/shm.c   | 21 +++++++-------------
>  examples/vm_power_manager/main.c | 11 ++++-------

are the log types under ALLOW_INTERNAL_API? if not should they be? and
if they are should examples be defining ALLOW_INTERNAL_API?

just curious.
  
Stephen Hemminger Dec. 11, 2023, 8:15 p.m. UTC | #2
On Mon, 11 Dec 2023 11:19:31 -0800
Tyler Retzlaff <roretzla@linux.microsoft.com> wrote:

> On Mon, Dec 11, 2023 at 09:23:22AM -0800, Stephen Hemminger wrote:
> > There are some places EAL logtype is being used in testpmd
> > and examples where it should not be. Lets reserve EAL
> > logtype to only be used by DPDK internals.
> > 
> > Stephen Hemminger (3):
> >   testpmd: replace EAL logtype with fprintf
> >   examples/l2fwd-keepalive: don't use EAL logtype
> >   examples/vm_power_manager: do not use EAL logtype
> > 
> >  app/test-pmd/testpmd.c           | 33 +++++++++++---------------------
> >  examples/l2fwd-keepalive/shm.c   | 21 +++++++-------------
> >  examples/vm_power_manager/main.c | 11 ++++-------  
> 
> are the log types under ALLOW_INTERNAL_API? if not should they be? and
> if they are should examples be defining ALLOW_INTERNAL_API?
> 
> just curious.
> 

No they never were under ALLOW_INTERNAL_API.
They should have been, but a little late now to change.
  
David Marchand Dec. 12, 2023, 8:01 a.m. UTC | #3
On Mon, Dec 11, 2023 at 8:19 PM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> On Mon, Dec 11, 2023 at 09:23:22AM -0800, Stephen Hemminger wrote:
> > There are some places EAL logtype is being used in testpmd
> > and examples where it should not be. Lets reserve EAL
> > logtype to only be used by DPDK internals.
> >
> > Stephen Hemminger (3):
> >   testpmd: replace EAL logtype with fprintf
> >   examples/l2fwd-keepalive: don't use EAL logtype
> >   examples/vm_power_manager: do not use EAL logtype
> >
> >  app/test-pmd/testpmd.c           | 33 +++++++++++---------------------
> >  examples/l2fwd-keepalive/shm.c   | 21 +++++++-------------
> >  examples/vm_power_manager/main.c | 11 ++++-------
>
> are the log types under ALLOW_INTERNAL_API? if not should they be? and
> if they are should examples be defining ALLOW_INTERNAL_API?

ALLOW_INTERNAL_API and ALLOW_EXPERIMENTAL_API tags have a transitive aspect.
So it would prevent applications from calling inline helpers and
macros with such logs in them.

Like for example:
lib/eal/include/rte_test.h:             RTE_LOG(ERR, EAL, "Test assert
%s line %d failed: "           \

The EAL logtype is "easy" to fix, but others like ETHDEV are more tricky.