examples/pipeline: fix include path for rte_log.h

Message ID 20240213145218.1532323-1-cristian.dumitrescu@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series examples/pipeline: fix include path for rte_log.h |

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/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Cristian Dumitrescu Feb. 13, 2024, 2:52 p.m. UTC
  When rte_log.h was moved to a new directory, the include path was not
updated for the generated C code produced by the pipeline library,
which results in build failure for this code.

Fixes: 09ce41310930 ("log: separate logging functions out of EAL")
Cc: stable@dpdk.org

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 examples/pipeline/cli.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

David Marchand Feb. 13, 2024, 4:18 p.m. UTC | #1
On Tue, Feb 13, 2024 at 3:52 PM Cristian Dumitrescu
<cristian.dumitrescu@intel.com> wrote:
>
> When rte_log.h was moved to a new directory, the include path was not
> updated for the generated C code produced by the pipeline library,
> which results in build failure for this code.
>
> Fixes: 09ce41310930 ("log: separate logging functions out of EAL")
> Cc: stable@dpdk.org
>
> Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> ---
>  examples/pipeline/cli.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
> index 2ae6cc579f..afb143c01f 100644
> --- a/examples/pipeline/cli.c
> +++ b/examples/pipeline/cli.c
> @@ -714,6 +714,7 @@ cmd_pipeline_libbuild(char **tokens,
>                  "-I %s/lib/eal/include "
>                  "-I %s/lib/eal/x86/include "
>                  "-I %s/lib/eal/include/generic "
> +                "-I %s/lib/log "
>                  "-I %s/lib/meter "
>                  "-I %s/lib/port "
>                  "-I %s/lib/table "
> @@ -738,6 +739,7 @@ cmd_pipeline_libbuild(char **tokens,
>                  install_dir,
>                  install_dir,
>                  install_dir,
> +                install_dir,
>                  log_file,
>                  obj_file,
>                  lib_file,

Wrt $Subject, copy/paste code in drivers/net/softnic is broken too.

Some comments on this code:
- putting compilation commands seems a rather strange idea in C code,
but at least, why not invoke an external tool/script that makes use of
existing build framework?
- RTE_INSTALL_DIR is undocumented,
- this implementation (passing -I <some_directory>/lib/eal/include) is
broken with a system-installed dpdk,
  
Cristian Dumitrescu Feb. 13, 2024, 5:22 p.m. UTC | #2
Hi David,

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Tuesday, February 13, 2024 4:19 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: Re: [PATCH] examples/pipeline: fix include path for rte_log.h
> 
> 
> Wrt $Subject, copy/paste code in drivers/net/softnic is broken too.

You're right, let me fix this in V2.

> 
> Some comments on this code:
> - putting compilation commands seems a rather strange idea in C code,
> but at least, why not invoke an external tool/script that makes use of
> existing build framework?

Yes, I am thinking of transitioning the pipeline app from the examples
folder to the apps folder, as it is way more than an example at this point,
and also add a script/tool to generate the C code in a more configurable
way. For now, the examples/pipeline contains just the default way to do
this, but of course a standalone tool would be better. On my ToDo list.
Thanks for providing this input!

> - RTE_INSTALL_DIR is undocumented,

This option is not supposed to be broadly used, but it is there just in case.
When the tool mentioned above will be ready, this will be moved into that
tool.

> - this implementation (passing -I <some_directory>/lib/eal/include) is
> broken with a system-installed dpdk,

Yes, this is expected. For the purpose of the pipeline C code generation,
we need the path to the full DPDK folder, not just the public header files.
There is one internal DPDK internal header file (rte_pipeline_internal.h)
which is needed for code generation purposes, but it should not be
made a public header, as it does not contain the pipeline API that apps
are using.

> 
 
> --
> David Marchand

Regard,
Cristian
  

Patch

diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c
index 2ae6cc579f..afb143c01f 100644
--- a/examples/pipeline/cli.c
+++ b/examples/pipeline/cli.c
@@ -714,6 +714,7 @@  cmd_pipeline_libbuild(char **tokens,
 		 "-I %s/lib/eal/include "
 		 "-I %s/lib/eal/x86/include "
 		 "-I %s/lib/eal/include/generic "
+		 "-I %s/lib/log "
 		 "-I %s/lib/meter "
 		 "-I %s/lib/port "
 		 "-I %s/lib/table "
@@ -738,6 +739,7 @@  cmd_pipeline_libbuild(char **tokens,
 		 install_dir,
 		 install_dir,
 		 install_dir,
+		 install_dir,
 		 log_file,
 		 obj_file,
 		 lib_file,