[2/2] lib: make graph optional

Message ID 20230619204650.3348681-2-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [1/2] test: add graph tests |

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/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

David Marchand June 19, 2023, 8:46 p.m. UTC
  Allow disabling of the graph library in builds.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test/meson.build | 12 +++++++-----
 lib/meson.build      |  1 +
 2 files changed, 8 insertions(+), 5 deletions(-)
  

Comments

Jerin Jacob June 20, 2023, 6:56 a.m. UTC | #1
On Tue, Jun 20, 2023 at 2:17 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> Allow disabling of the graph library in builds.

Good to make graph as optional.
I did not check the build, will examples/l3fwd-graph/ skip automatically ?

>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> +if dpdk_conf.has('RTE_LIB_GRAPH')

Can devtools/test-meson-builds.sh updated to check build with
disabling all optional libs?

> +    test_sources += 'test_graph.c'
> +    fast_tests += [['graph_autotest', true, true]]
> +    fast_tests += [['node_list_dump', true, true]]
> +    test_sources += 'test_graph_perf.c'
> +    perf_test_names += 'graph_perf_autotest'
  
David Marchand June 20, 2023, 7:09 a.m. UTC | #2
On Tue, Jun 20, 2023 at 8:56 AM Jerin Jacob <jerinjacobk@gmail.com> wrote:
>
> On Tue, Jun 20, 2023 at 2:17 AM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > Allow disabling of the graph library in builds.
>
> Good to make graph as optional.
> I did not check the build, will examples/l3fwd-graph/ skip automatically ?

Yes.
Each example exposes its required dependencies.
examples/meson.build will skip any example with unmet requirements
unless the example was explicitly set in the -Dexamples= list of
examples to build.

See:
https://git.dpdk.org/dpdk/tree/examples/meson.build#n105

https://git.dpdk.org/dpdk/tree/examples/meson.build#n79
https://git.dpdk.org/dpdk/tree/examples/meson.build#n117


>
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> > +if dpdk_conf.has('RTE_LIB_GRAPH')
>
> Can devtools/test-meson-builds.sh updated to check build with
> disabling all optional libs?

I already tested this series with our script: we already have a "mini" target.

build build-mini cc skipABI $use_shared -Ddisable_libs=* \
        -Denable_drivers=net/null

...
Message: Skipping example "l2fwd-jobstats"
Library rt found: YES
Message: Missing dependency "graph" for example "l3fwd-graph"
Message: Skipping example "l3fwd-graph"
Message: Missing dependency "power" for example "l3fwd-power"
Message: Skipping example "l3fwd-power"
...
  
Bruce Richardson June 20, 2023, 8:10 a.m. UTC | #3
On Mon, Jun 19, 2023 at 10:46:50PM +0200, David Marchand wrote:
> Allow disabling of the graph library in builds.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  app/test/meson.build | 12 +++++++-----
>  lib/meson.build      |  1 +
>  2 files changed, 8 insertions(+), 5 deletions(-)
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Jerin Jacob June 20, 2023, 8:20 a.m. UTC | #4
On Tue, Jun 20, 2023 at 1:40 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Mon, Jun 19, 2023 at 10:46:50PM +0200, David Marchand wrote:
> > Allow disabling of the graph library in builds.
> >
> > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > ---
> >  app/test/meson.build | 12 +++++++-----
> >  lib/meson.build      |  1 +
> >  2 files changed, 8 insertions(+), 5 deletions(-)
> >
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>
  
Thomas Monjalon June 22, 2023, 5:33 p.m. UTC | #5
20/06/2023 10:20, Jerin Jacob:
> On Tue, Jun 20, 2023 at 1:40 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > On Mon, Jun 19, 2023 at 10:46:50PM +0200, David Marchand wrote:
> > > Allow disabling of the graph library in builds.
> > >
> > > Signed-off-by: David Marchand <david.marchand@redhat.com>
> > > ---
> > >  app/test/meson.build | 12 +++++++-----
> > >  lib/meson.build      |  1 +
> > >  2 files changed, 8 insertions(+), 5 deletions(-)
> > >
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Acked-by: Jerin Jacob <jerinj@marvell.com>

Series applied, thanks.
  

Patch

diff --git a/app/test/meson.build b/app/test/meson.build
index 35d6baeb22..c96488126f 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -61,8 +61,6 @@  test_sources = files(
         'test_fib6.c',
         'test_fib6_perf.c',
         'test_func_reentrancy.c',
-        'test_graph.c',
-        'test_graph_perf.c',
         'test_hash.c',
         'test_hash_functions.c',
         'test_hash_multiwriter.c',
@@ -250,8 +248,6 @@  fast_tests = [
         ['thash_autotest', true, true],
         ['threads_autotest', true, true],
         ['trace_autotest', true, true],
-        ['graph_autotest', true, true],
-        ['node_list_dump', true, true],
 ]
 
 # Tests known to have issues or which don't belong in other tests lists.
@@ -300,7 +296,6 @@  perf_test_names = [
         'trace_perf_autotest',
         'ipsec_perf_autotest',
         'thash_perf_autotest',
-        'graph_perf_autotest',
 ]
 
 driver_test_names = [
@@ -366,6 +361,13 @@  if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
 endif
+if dpdk_conf.has('RTE_LIB_GRAPH')
+    test_sources += 'test_graph.c'
+    fast_tests += [['graph_autotest', true, true]]
+    fast_tests += [['node_list_dump', true, true]]
+    test_sources += 'test_graph_perf.c'
+    perf_test_names += 'graph_perf_autotest'
+endif
 if dpdk_conf.has('RTE_LIB_METRICS')
     test_sources += ['test_metrics.c']
     fast_tests += [['metrics_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 9677239236..7310021833 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -72,6 +72,7 @@  optional_libs = [
         'cfgfile',
         'flow_classify',
         'gpudev',
+        'graph',
         'gro',
         'gso',
         'kni',