Skip to contentSkip to conversation

build: output a dependency log in build directory

PATCH Superseded Bruce Richardson 10 participants 79 messages Jul 30, 2024 – Jan 14 Page 1 of 2

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: output a dependency log in build directory

As meson processes our DPDK source tree it manages dependencies specified by each individual driver. To enable future analysis of the dependency links between components, log the dependencies of each DPDK component as it gets processed. This could potentially allow other tools to automatically enable or disable components based on the desired end components to be built, e.g. if the user requests net/ice, ensure that common/iavf is also enabled in the drivers.

The output file produced is in "dot" or "graphviz" format, which allows producing a graphical representation of the DPDK dependency tree if so desired. For example: "dot -Tpng -O build/deps.dot" to produce the image file "build/deps.dot.png".

---
 app/meson.build        |  1 +
 buildtools/log-deps.py | 43 ++++++++++++++++++++++++++++++++++++++++++
 buildtools/meson.build |  2 ++
 drivers/meson.build    |  1 +
 lib/meson.build        |  1 +
 5 files changed, 48 insertions(+)
 create mode 100644 buildtools/log-deps.py
app/meson.build +1 -0
index 5b2c80c7a1..6afa457f4c 100644
@@ -76,6 +76,7 @@ foreach app:apps
 
     if build
         subdir(name)
+        run_command([log_deps_cmd, name, deps])
         if not build and require_apps
             error('Cannot build explicitly requested app "@0@".\n'.format(name)
                   + '\tReason: ' + reason)
buildtools/log-deps.py new file +43 -0

43 lines not on this page · raw message

buildtools/meson.build +2 -0
index 3adf34e1a8..332f0f3d38 100644
@@ -24,6 +24,8 @@ get_numa_count_cmd = py3 + files('get-numa-count.py')
 get_test_suites_cmd = py3 + files('get-test-suites.py')
 has_hugepages_cmd = py3 + files('has-hugepages.py')
 cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py')
+log_deps_cmd = py3 + files('log-deps.py')
+run_command(log_deps_cmd)  # call with no parameters to reset the file
 
 # install any build tools that end-users might want also
 install_data([
drivers/meson.build +1 -0
index 66931d4241..44935e067c 100644
@@ -154,6 +154,7 @@ foreach subpath:subdirs
         if build
             # pull in driver directory which should update all the local variables
             subdir(drv_path)
+            run_command([log_deps_cmd, drv_path.underscorify(), deps])
 
             if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0 and require_iova_in_mbuf
                 build = false
lib/meson.build +1 -0
index 162287753f..da2815465f 100644
@@ -160,6 +160,7 @@ foreach l:libraries
 
     if build
         subdir(l)
+        run_command([log_deps_cmd, l, deps])
         if not build and require_libs
             error('Cannot build explicitly requested lib "@0@".\n'.format(name)
                     +'\tReason: ' + reason)
Signature · 1 line
2.43.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines

As meson processes our DPDK source tree it manages dependencies specified by each individual driver. To enable future analysis of the dependency links between components, log the dependencies of each DPDK component as it gets processed. This could potentially allow other tools to automatically enable or disable components based on the desired end components to be built, e.g. if the user requests net/ice, ensure that common/iavf is also enabled in the drivers.

Quoted 6 lines

The output file produced is in "dot" or "graphviz" format, which allows producing a graphical representation of the DPDK dependency tree if so desired. For example: "dot -Tpng -O build/deps.dot" to produce the image file "build/deps.dot.png".

I think it is a great idea.

Quoted 109 lines
---
 app/meson.build        |  1 +
 buildtools/log-deps.py | 43 ++++++++++++++++++++++++++++++++++++++++++
 buildtools/meson.build |  2 ++
 drivers/meson.build    |  1 +
 lib/meson.build        |  1 +
 5 files changed, 48 insertions(+)
 create mode 100644 buildtools/log-deps.py
app/meson.build +1 -0
index 5b2c80c7a1..6afa457f4c 100644
@@ -76,6 +76,7 @@ foreach app:apps
 
     if build
         subdir(name)
+        run_command([log_deps_cmd, name, deps])
         if not build and require_apps
             error('Cannot build explicitly requested app "@0@".\n'.format(name)
                   + '\tReason: ' + reason)
buildtools/log-deps.py new file +43 -0
new file mode 100644
index 0000000000..a4331fa15b
@@ -0,0 +1,43 @@
+#! /usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 Intel Corporation
+
+"""Utility script to build up a list of dependencies from meson."""
+
+import os
+import sys
+
+
+def file_to_list(filename):
+    """Read file into a list of strings."""
+    with open(filename) as f:
+        return f.readlines()
+
+
+def list_to_file(filename, lines):
+    """Write a list of strings out to a file."""
+    with open(filename, 'w') as f:
+        f.writelines(lines)
+
+
+depsfile = f'{os.environ["MESON_BUILD_ROOT"]}/deps.dot'
+
+# to reset the deps file on each build, the script is called without any params
+if len(sys.argv) == 1:
+    os.remove(depsfile)
+    sys.exit(0)
+
+try:
+    contents = file_to_list(depsfile)
+except FileNotFoundError:
+    contents = ['digraph {\n', '}\n']
+
+component = sys.argv[1]
+if len(sys.argv) > 2:
+    contents[-1] = f'"{component}" -> {{ "{"\", \"".join(sys.argv[2:])}" }}\n'
+else:
+    contents[-1] = f'"{component}"\n'
+
+contents.append('}\n')
+
+list_to_file(depsfile, contents)
buildtools/meson.build +2 -0
index 3adf34e1a8..332f0f3d38 100644
@@ -24,6 +24,8 @@ get_numa_count_cmd = py3 + files('get-numa-count.py')
 get_test_suites_cmd = py3 + files('get-test-suites.py')
 has_hugepages_cmd = py3 + files('has-hugepages.py')
 cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py')
+log_deps_cmd = py3 + files('log-deps.py')
+run_command(log_deps_cmd)  # call with no parameters to reset the file
 
 # install any build tools that end-users might want also
 install_data([
drivers/meson.build +1 -0
index 66931d4241..44935e067c 100644
@@ -154,6 +154,7 @@ foreach subpath:subdirs
         if build
             # pull in driver directory which should update all the local variables
             subdir(drv_path)
+            run_command([log_deps_cmd, drv_path.underscorify(), deps])
 
             if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0 and require_iova_in_mbuf
                 build = false
lib/meson.build +1 -1
index 162287753f..da2815465f 100644
@@ -160,6 +160,7 @@ foreach l:libraries
 
     if build
         subdir(l)
+        run_command([log_deps_cmd, l, deps])
         if not build and require_libs
             error('Cannot build explicitly requested lib "@0@".\n'.format(name)
                     +'\tReason: ' + reason)
--

2.43.0

#2 lore raw
In reply to Bruce Richardson
Quoted 8 lines · Bruce Richardson

As meson processes our DPDK source tree it manages dependencies specified by each individual driver. To enable future analysis of the dependency links between components, log the dependencies of each DPDK component as it gets processed. This could potentially allow other tools to automatically enable or disable components based on the desired end components to be built, e.g. if the user requests net/ice, ensure that common/iavf is also enabled in the drivers.

Quoted 7 lines

The output file produced is in "dot" or "graphviz" format, which allows producing a graphical representation of the DPDK dependency tree if so desired. For example: "dot -Tpng -O build/deps.dot" to produce the image file "build/deps.dot.png".

I tested it quickly, good to have this dependency list, at least it makes some duplicated dependencies obvious from .dot file.

But generated dependency graph is too large to be useful, does it make sense to have a new meson option that control this dependency generation:
-Dgenerate_deps=apps
-Dgenerate_deps=libs
-Dgenerate_deps=drivers
-Dgenerate_deps=all

Not sure about what should be the default option,
as this is not always required/used, disabling this option by default saves unnecessary work,
but disabling it by default may cause not noticing when it is broken, perhaps this can be addressed by adding this option to 'devtools/test-meson-builds.sh'.

btw, it generates following warning:

WARNING: You should add the boolean check kwarg to the run_command call.

It currently defaults to false,

but it will default to true in future releases of meson.

See also: https://github.com/mesonbuild/meson/issues/9300

Quoted 107 lines
---
 app/meson.build        |  1 +
 buildtools/log-deps.py | 43 ++++++++++++++++++++++++++++++++++++++++++
 buildtools/meson.build |  2 ++
 drivers/meson.build    |  1 +
 lib/meson.build        |  1 +
 5 files changed, 48 insertions(+)
 create mode 100644 buildtools/log-deps.py
app/meson.build +1 -0
index 5b2c80c7a1..6afa457f4c 100644
@@ -76,6 +76,7 @@ foreach app:apps
 
     if build
         subdir(name)
+        run_command([log_deps_cmd, name, deps])
         if not build and require_apps
             error('Cannot build explicitly requested app "@0@".\n'.format(name)
                   + '\tReason: ' + reason)
buildtools/log-deps.py new file +43 -0
new file mode 100644
index 0000000000..a4331fa15b
@@ -0,0 +1,43 @@
+#! /usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 Intel Corporation
+
+"""Utility script to build up a list of dependencies from meson."""
+
+import os
+import sys
+
+
+def file_to_list(filename):
+    """Read file into a list of strings."""
+    with open(filename) as f:
+        return f.readlines()
+
+
+def list_to_file(filename, lines):
+    """Write a list of strings out to a file."""
+    with open(filename, 'w') as f:
+        f.writelines(lines)
+
+
+depsfile = f'{os.environ["MESON_BUILD_ROOT"]}/deps.dot'
+
+# to reset the deps file on each build, the script is called without any params
+if len(sys.argv) == 1:
+    os.remove(depsfile)
+    sys.exit(0)
+
+try:
+    contents = file_to_list(depsfile)
+except FileNotFoundError:
+    contents = ['digraph {\n', '}\n']
+
+component = sys.argv[1]
+if len(sys.argv) > 2:
+    contents[-1] = f'"{component}" -> {{ "{"\", \"".join(sys.argv[2:])}" }}\n'
+else:
+    contents[-1] = f'"{component}"\n'
+
+contents.append('}\n')
+
+list_to_file(depsfile, contents)
buildtools/meson.build +2 -0
index 3adf34e1a8..332f0f3d38 100644
@@ -24,6 +24,8 @@ get_numa_count_cmd = py3 + files('get-numa-count.py')
 get_test_suites_cmd = py3 + files('get-test-suites.py')
 has_hugepages_cmd = py3 + files('has-hugepages.py')
 cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py')
+log_deps_cmd = py3 + files('log-deps.py')
+run_command(log_deps_cmd)  # call with no parameters to reset the file
 
 # install any build tools that end-users might want also
 install_data([
drivers/meson.build +1 -0
index 66931d4241..44935e067c 100644
@@ -154,6 +154,7 @@ foreach subpath:subdirs
         if build
             # pull in driver directory which should update all the local variables
             subdir(drv_path)
+            run_command([log_deps_cmd, drv_path.underscorify(), deps])
 
             if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0 and require_iova_in_mbuf
                 build = false
lib/meson.build +1 -0
index 162287753f..da2815465f 100644
@@ -160,6 +160,7 @@ foreach l:libraries
 
     if build
         subdir(l)
+        run_command([log_deps_cmd, l, deps])
         if not build and require_libs
             error('Cannot build explicitly requested lib "@0@".\n'.format(name)
                     +'\tReason: ' + reason)
#3 lore raw
Quoted 23 lines · Ferruh Yigit
Quoted 8 lines · Bruce Richardson

As meson processes our DPDK source tree it manages dependencies specified by each individual driver. To enable future analysis of the dependency links between components, log the dependencies of each DPDK component as it gets processed. This could potentially allow other tools to automatically enable or disable components based on the desired end components to be built, e.g. if the user requests net/ice, ensure that common/iavf is also enabled in the drivers.

Quoted 7 lines

The output file produced is in "dot" or "graphviz" format, which allows producing a graphical representation of the DPDK dependency tree if so desired. For example: "dot -Tpng -O build/deps.dot" to produce the image file "build/deps.dot.png".

I tested it quickly, good to have this dependency list, at least it makes some duplicated dependencies obvious from .dot file.

But generated dependency graph is too large to be useful, does it make sense to have a new meson option that control this dependency generation:

Review

Quoted 4 lines
(quoted diff) +0 -4
-Dgenerate_deps=apps
-Dgenerate_deps=libs
-Dgenerate_deps=drivers
-Dgenerate_deps=all

I had indeed noticed that. Right now I'm focused on cutting down our dependency lists to make things more manageable - I have a script to automate the identification of excess dependencies and I already have a patch for cleaning up the libraries to a minimal dependency set.

I also think having separate drivers and libraries charts could be useful I wouldn't want to add a build option for it though - it's not something that should be necessary. Instead, I will look at other options, perhaps even doing multiple dependency files - they don't seem to slow meson down, so why not always do them all.

Quoted 8 lines

Not sure about what should be the default option,
as this is not always required/used, disabling this option by default saves unnecessary work,
but disabling it by default may cause not noticing when it is broken, perhaps this can be addressed by adding this option to 'devtools/test-meson-builds.sh'.

btw, it generates following warning:

Oops - will look to fix in V2.

/Bruce

#4 lore raw

v2 cover record and rework component dependencies

In reply to Bruce Richardson

As part of the meson build, we can record the dependencies for each component as we process it, logging them to a file. This file can be used as input to a number of other scripts and tools, for example, to graph the dependencies, or to allow higher-level build-config tools to automatically enable component requirements, etc.

The first patch of this set generates the basic dependency tree. The second patch does some processing of that dependency tree to identify cases where dependencies are being unnecessarily specified. Reducing these makes it easier to have readable dependency graphs in future, without affecting the build.

The following 4 patches are based on the output of the second patch, and greatly cut down the number of direct dependency links between components. Even with the cut-down dependencies, the full dependency graph is nigh-unreadable, so the final patch adds a new script to generate dependency tree subgraphs, creating dot files for e.g. the dependencies of a particular component, or a component class such as mempool drivers.

Bruce Richardson (7):
build: output a dependency log in build directory
devtools: add script to flag unneeded dependencies
build: remove kvargs from driver class dependencies
build: reduce library dependencies
build: reduce driver dependencies
build: reduce app dependencies
devtools: add script to generate DPDK dependency graphs

 app/dumpcap/meson.build                    |   2 +-
 app/graph/meson.build                      |   2 +-
 app/meson.build                            |   1 +
 app/pdump/meson.build                      |   2 +-
 app/proc-info/meson.build                  |   2 +-
 app/test-crypto-perf/meson.build           |   2 +-
 app/test-fib/meson.build                   |   2 +-
 app/test-sad/meson.build                   |   2 +-
 app/test/meson.build                       |   2 +-
 buildtools/log-deps.py                     |  43 +++++++
 buildtools/meson.build                     |   2 +
 devtools/draw-dependency-graphs.py         | 136 +++++++++++++++++++++
 devtools/find-duplicate-deps.py            |  53 ++++++++
 drivers/baseband/fpga_5gnr_fec/meson.build |   2 +-
 drivers/baseband/fpga_lte_fec/meson.build  |   2 +-
 drivers/baseband/la12xx/meson.build        |   2 +-
 drivers/baseband/null/meson.build          |   2 +-
 drivers/baseband/turbo_sw/meson.build      |   2 +-
 drivers/bus/auxiliary/meson.build          |   2 -
 drivers/bus/dpaa/meson.build               |   2 +-
 drivers/bus/fslmc/meson.build              |   2 +-
 drivers/bus/ifpga/meson.build              |   2 +-
 drivers/bus/pci/meson.build                |   4 +-
 drivers/bus/platform/meson.build           |   1 -
 drivers/bus/uacce/meson.build              |   2 -
 drivers/bus/vdev/meson.build               |   2 -
 drivers/common/cnxk/meson.build            |   4 +-
 drivers/common/cpt/meson.build             |   2 +-
 drivers/common/idpf/meson.build            |   2 +-
 drivers/common/mlx5/meson.build            |   2 +-
 drivers/compress/mlx5/meson.build          |   2 +-
 drivers/compress/nitrox/meson.build        |   2 +-
 drivers/compress/octeontx/meson.build      |   2 +-
 drivers/crypto/bcmfs/meson.build           |   2 +-
 drivers/crypto/cnxk/meson.build            |   2 +-
 drivers/crypto/dpaa_sec/meson.build        |   2 +-
 drivers/crypto/ipsec_mb/meson.build        |   2 +-
 drivers/crypto/mlx5/meson.build            |   2 +-
 drivers/crypto/nitrox/meson.build          |   2 +-
 drivers/dma/cnxk/meson.build               |   2 +-
 drivers/dma/dpaa/meson.build               |   2 +-
 drivers/dma/dpaa2/meson.build              |   2 +-
 drivers/dma/odm/meson.build                |   2 +-
 drivers/dma/skeleton/meson.build           |   2 +-
 drivers/event/cnxk/meson.build             |   2 +-
 drivers/event/dlb2/meson.build             |   2 +-
 drivers/event/dpaa2/meson.build            |   2 +-
 drivers/event/meson.build                  |   2 +-
 drivers/event/octeontx/meson.build         |   3 +-
 drivers/event/sw/meson.build               |   2 +-
 drivers/mempool/cnxk/meson.build           |   2 +-
 drivers/mempool/dpaa/meson.build           |   2 +-
 drivers/mempool/dpaa2/meson.build          |   2 +-
 drivers/mempool/octeontx/meson.build       |   2 +-
 drivers/meson.build                        |   1 +
 drivers/net/cnxk/meson.build               |   3 +-
 drivers/net/iavf/meson.build               |   2 +-
 drivers/net/ice/meson.build                |   2 +-
 drivers/net/mana/meson.build               |   2 +-
 drivers/net/meson.build                    |   2 +-
 drivers/net/mlx5/meson.build               |   2 +-
 drivers/net/sfc/meson.build                |   2 +-
 drivers/net/softnic/meson.build            |   2 +-
 drivers/raw/cnxk_bphy/meson.build          |   2 +-
 drivers/raw/cnxk_gpio/meson.build          |   2 +-
 drivers/raw/ntb/meson.build                |   2 +-
 drivers/raw/skeleton/meson.build           |   2 +-
 drivers/regex/meson.build                  |   2 +-
 drivers/regex/mlx5/meson.build             |   2 +-
 drivers/vdpa/ifc/meson.build               |   2 +-
 drivers/vdpa/meson.build                   |   3 +-
 drivers/vdpa/mlx5/meson.build              |   2 +-
 drivers/vdpa/sfc/meson.build               |   2 +-
 lib/argparse/meson.build                   |   2 +-
 lib/bbdev/meson.build                      |   2 +-
 lib/bitratestats/meson.build               |   2 +-
 lib/bpf/meson.build                        |   2 +-
 lib/cmdline/meson.build                    |   2 +-
 lib/compressdev/meson.build                |   2 +-
 lib/cryptodev/meson.build                  |   2 +-
 lib/dispatcher/meson.build                 |   2 +-
 lib/distributor/meson.build                |   2 +-
 lib/dmadev/meson.build                     |   2 -
 lib/eal/meson.build                        |   5 +-
 lib/efd/meson.build                        |   2 +-
 lib/ethdev/meson.build                     |   2 +-
 lib/eventdev/meson.build                   |   3 +-
 lib/fib/meson.build                        |   2 +-
 lib/gpudev/meson.build                     |   2 +-
 lib/graph/meson.build                      |   2 +-
 lib/gro/meson.build                        |   2 +-
 lib/gso/meson.build                        |   2 +-
 lib/hash/meson.build                       |   4 +-
 lib/ip_frag/meson.build                    |   2 +-
 lib/ipsec/meson.build                      |   2 +-
 lib/kvargs/meson.build                     |   2 +-
 lib/latencystats/meson.build               |   2 +-
 lib/lpm/meson.build                        |   3 +-
 lib/mbuf/meson.build                       |   2 +-
 lib/member/meson.build                     |   2 +-
 lib/mempool/meson.build                    |   2 +-
 lib/meson.build                            |   1 +
 lib/metrics/meson.build                    |   2 +-
 lib/mldev/meson.build                      |   2 +-
 lib/net/meson.build                        |   2 +-
 lib/node/meson.build                       |   2 +-
 lib/pcapng/meson.build                     |   2 +-
 lib/pdcp/meson.build                       |   2 +-
 lib/pdump/meson.build                      |   2 +-
 lib/pipeline/meson.build                   |   2 +-
 lib/port/meson.build                       |   2 +-
 lib/power/meson.build                      |   2 +-
 lib/rawdev/meson.build                     |   2 -
 lib/rcu/meson.build                        |   2 +-
 lib/regexdev/meson.build                   |   2 +-
 lib/reorder/meson.build                    |   2 +-
 lib/rib/meson.build                        |   2 +-
 lib/ring/meson.build                       |   1 -
 lib/sched/meson.build                      |   2 +-
 lib/security/meson.build                   |   2 +-
 lib/table/meson.build                      |   2 +-
 lib/telemetry/meson.build                  |   2 +-
 lib/vhost/meson.build                      |   2 +-
 123 files changed, 347 insertions(+), 134 deletions(-)
 create mode 100644 buildtools/log-deps.py
 create mode 100755 devtools/draw-dependency-graphs.py
 create mode 100755 devtools/find-duplicate-deps.py

--
2.43.0

#5 lore raw

PATCH v2 1/7 build: output a dependency log in build directory

As meson processes our DPDK source tree it manages dependencies specified by each individual driver. To enable future analysis of the dependency links between components, log the dependencies of each DPDK component as it gets processed. This could potentially allow other tools to automatically enable or disable components based on the desired end components to be built, e.g. if the user requests net/ice, ensure that common/iavf is also enabled in the drivers.

The output file produced is in "dot" or "graphviz" format, which allows producing a graphical representation of the DPDK dependency tree if so desired. For example: "dot -Tpng -O build/deps.dot" to produce the image file "build/deps.dot.png".

---
 app/meson.build        |  1 +
 buildtools/log-deps.py | 43 ++++++++++++++++++++++++++++++++++++++++++
 buildtools/meson.build |  2 ++
 drivers/meson.build    |  1 +
 lib/meson.build        |  1 +
 5 files changed, 48 insertions(+)
 create mode 100644 buildtools/log-deps.py
app/meson.build +1 -0
index 5b2c80c7a1..837a57ad0a 100644
@@ -76,6 +76,7 @@ foreach app:apps
 
     if build
         subdir(name)
+        run_command([log_deps_cmd, 'dpdk-' + name, deps], check: false)
         if not build and require_apps
             error('Cannot build explicitly requested app "@0@".\n'.format(name)
                   + '\tReason: ' + reason)
buildtools/log-deps.py new file +43 -0

43 lines not on this page · raw message

buildtools/meson.build +2 -0
index 3adf34e1a8..e2ba9d0ad4 100644
@@ -24,6 +24,8 @@ get_numa_count_cmd = py3 + files('get-numa-count.py')
 get_test_suites_cmd = py3 + files('get-test-suites.py')
 has_hugepages_cmd = py3 + files('has-hugepages.py')
 cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py')
+log_deps_cmd = py3 + files('log-deps.py')
+run_command(log_deps_cmd, check: false)  # call with no parameters to reset the file
 
 # install any build tools that end-users might want also
 install_data([
drivers/meson.build +1 -0
index 66931d4241..d56308f1c1 100644
@@ -154,6 +154,7 @@ foreach subpath:subdirs
         if build
             # pull in driver directory which should update all the local variables
             subdir(drv_path)
+            run_command([log_deps_cmd, class + '_' + name, deps], check: false)
 
             if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0 and require_iova_in_mbuf
                 build = false
lib/meson.build +1 -0
index 162287753f..106c2a947c 100644
@@ -160,6 +160,7 @@ foreach l:libraries
 
     if build
         subdir(l)
+        run_command([log_deps_cmd, l, deps], check: false)
         if not build and require_libs
             error('Cannot build explicitly requested lib "@0@".\n'.format(name)
                     +'\tReason: ' + reason)

--
2.43.0

#6 lore raw
Quoted 17 lines · Bruce Richardson

As meson processes our DPDK source tree it manages dependencies specified by each individual driver. To enable future analysis of the dependency links between components, log the dependencies of each DPDK component as it gets processed. This could potentially allow other tools to automatically enable or disable components based on the desired end components to be built, e.g. if the user requests net/ice, ensure that common/iavf is also enabled in the drivers.

The output file produced is in "dot" or "graphviz" format, which allows producing a graphical representation of the DPDK dependency tree if so desired. For example: "dot -Tpng -O build/deps.dot" to produce the image file "build/deps.dot.png".

---

<snip>

buildtools/log-deps.py line 37

Quoted 8 lines
buildtools/log-deps.py new file +8 -0
+try:
+    contents = file_to_list(depsfile)
+except FileNotFoundError:
+    contents = ['digraph {\n', '}\n']
+
+component = sys.argv[1]
+if len(sys.argv) > 2:
+    contents[-1] = f'"{component}" -> {{ "{"\", \"".join(sys.argv[2:])}" }}\n'

This is invalid syntax prior to Python 3.12. You're doing escaped quotes ("\", \"") inside a f-string block ({}). My machine has Python 3.9 and this breaks the script.

Signature · 2 lines
Thanks,
Anatoly
#7 lore raw
Quoted 21 lines · Anatoly
Quoted 17 lines · Bruce Richardson

As meson processes our DPDK source tree it manages dependencies specified by each individual driver. To enable future analysis of the dependency links between components, log the dependencies of each DPDK component as it gets processed. This could potentially allow other tools to automatically enable or disable components based on the desired end components to be built, e.g. if the user requests net/ice, ensure that common/iavf is also enabled in the drivers.

The output file produced is in "dot" or "graphviz" format, which allows producing a graphical representation of the DPDK dependency tree if so desired. For example: "dot -Tpng -O build/deps.dot" to produce the image file "build/deps.dot.png".

---

<snip>

Quoted 13 lines

buildtools/log-deps.py line 37

Quoted 8 lines
buildtools/log-deps.py new file +8 -0
+try:
+    contents = file_to_list(depsfile)
+except FileNotFoundError:
+    contents = ['digraph {\n', '}\n']
+
+component = sys.argv[1]
+if len(sys.argv) > 2:
+    contents[-1] = f'"{component}" -> {{ "{"\", \"".join(sys.argv[2:])}" }}\n'

This is invalid syntax prior to Python 3.12. You're doing escaped quotes ("\", \"") inside a f-string block ({}). My machine has Python 3.9 and this breaks the script.

Thanks for the heads-up. I'll do a respin when I can.

#8 lore raw

PATCH v2 2/7 devtools: add script to flag unneeded dependencies

In reply to Bruce Richardson

While not a serious problem, DPDK components often list more dependencies than are actually necessary to build, due to the use of recursive dependencies. In extreme cases, such as with core libraries, this can lead to longer configuration times due to meson having to deduplicate long lists of dependencies. Therefore we can add a script to identify when a component has got unnecessary dependencies listed.

---
 devtools/find-duplicate-deps.py | 53 +++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100755 devtools/find-duplicate-deps.py
devtools/find-duplicate-deps.py new file +53 -0
new file mode 100755
index 0000000000..b1eacf21ce
@@ -0,0 +1,53 @@
+#! /usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 Intel Corporation
+
+"""Identify any superfluous dependencies listed in DPDK deps graph."""
+
+import sys
+
+all_deps = {}
+
+
+class dep:
+    """Holds a component and its dependencies."""
+
+    def __init__(self, name, dep_names):
+        """Create and process a component and its deps."""
+        self.name = name.strip('" ')
+        self.base_deps = [all_deps[dn.strip('" ')] for dn in dep_names]
+        self.recursive_deps = []
+        for d in self.base_deps:
+            self.recursive_deps.extend(d.base_deps)
+            self.recursive_deps.extend(d.recursive_deps)
+        self.extra_deps = []
+        for d in self.base_deps:
+            if d in self.recursive_deps:
+                self.extra_deps.append(d.name)
+        if self.extra_deps:
+            print(f'{self.name}: extra deps {self.extra_deps}')
+
+    def dict_add(self, d):
+        """Add this object to a dictionary by name."""
+        d[self.name] = self
+
+
+def main(argv):
+    """Read the dependency tree from a dot file and process it."""
+    if len(argv) != 2:
+        print(f'Usage: {argv[0]} <build-directory>/deps.dot', file=sys.stderr)
+        sys.exit(1)
+
+    with open(argv[1]) as f:
+        for ln in f.readlines():
+            ln = ln.strip()
+            if '->' in ln:
+                name, deps = ln.split('->')
+                deps = deps.strip(' {}')
+                dep(name, deps.split(',')).dict_add(all_deps)
+            elif ln.startswith('"') and ln.endswith('"'):
+                dep(ln.strip('"'), []).dict_add(all_deps)
+
+
+if __name__ == '__main__':
+    main(sys.argv)
Signature · 1 line
2.43.0
#9 lore raw

PATCH v2 3/7 build: remove kvargs from driver class dependencies

In reply to Bruce Richardson

The kvargs library is used by EAL, and therefore is implicitly a dependency of every DPDK driver. Remove it from the minimum set of dependencies for each driver class as it's unnecessary to call it out there.

---
 drivers/event/meson.build | 2 +-
 drivers/net/meson.build   | 2 +-
 drivers/regex/meson.build | 2 +-
 drivers/vdpa/meson.build  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/event/meson.build +1 -1
index d6706b57f7..2708833adf 100644
@@ -19,4 +19,4 @@ if not (toolchain == 'gcc' and cc.version().version_compare('<4.8.6') and
         dpdk_conf.has('RTE_ARCH_ARM64'))
     drivers += 'octeontx'
 endif
-std_deps = ['eventdev', 'kvargs']
+std_deps = ['eventdev']
drivers/net/meson.build +1 -1
index fb6d34b782..ebd12364df 100644
@@ -63,6 +63,6 @@ drivers = [
         'virtio',
         'vmxnet3',
 ]
-std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
+std_deps = ['ethdev']           # 'ethdev' also pulls in mbuf, net, eal etc
 std_deps += ['bus_pci']         # very many PMDs depend on PCI, so make std
 std_deps += ['bus_vdev']        # same with vdev bus
drivers/regex/meson.build +1 -1
index ff2a8fea89..10192e7c77 100644
@@ -5,4 +5,4 @@ drivers = [
         'mlx5',
         'cn9k',
 ]
-std_deps = ['ethdev', 'kvargs', 'regexdev'] # 'ethdev' also pulls in mbuf, net, eal etc
+std_deps = ['ethdev', 'regexdev'] # 'ethdev' also pulls in mbuf, net, eal etc
drivers/vdpa/meson.build +1 -1
index 896e8e0304..e01c277b9e 100644
@@ -11,5 +11,5 @@ drivers = [
         'nfp',
         'sfc',
 ]
-std_deps = ['bus_pci', 'kvargs']
+std_deps = ['bus_pci']
 std_deps += ['vhost']
Signature · 1 line
2.43.0
#10 lore raw

PATCH v2 4/7 build: reduce library dependencies

In reply to Bruce Richardson

Rather than having each library depend up on EAL + any extra libs, we can take advantage of recursive dependency support in meson and just assign the dependencies of each directory directly, rather than appending to the array. For libraries which only depend upon EAL, keep that as a default, but for libraries which depend upon even a single extra lib, that EAL dependency is unnecessary.

Going further, we can identify using the find_duplicate_deps.py script any unnecessary deps in each library's list, and remove them to slim the dependency tree down.

Reducing number of dependencies means that meson
takes less time processing and deduplicating the dependency tree for each component, and also shrinks the dependency graph for DPDK itself.

---
 lib/argparse/meson.build     | 2 +-
 lib/bbdev/meson.build        | 2 +-
 lib/bitratestats/meson.build | 2 +-
 lib/bpf/meson.build          | 2 +-
 lib/cmdline/meson.build      | 2 +-
 lib/compressdev/meson.build  | 2 +-
 lib/cryptodev/meson.build    | 2 +-
 lib/dispatcher/meson.build   | 2 +-
 lib/distributor/meson.build  | 2 +-
 lib/dmadev/meson.build       | 2 --
 lib/eal/meson.build          | 5 +----
 lib/efd/meson.build          | 2 +-
 lib/ethdev/meson.build       | 2 +-
 lib/eventdev/meson.build     | 3 +--
 lib/fib/meson.build          | 2 +-
 lib/gpudev/meson.build       | 2 +-
 lib/graph/meson.build        | 2 +-
 lib/gro/meson.build          | 2 +-
 lib/gso/meson.build          | 2 +-
 lib/hash/meson.build         | 4 +---
 lib/ip_frag/meson.build      | 2 +-
 lib/ipsec/meson.build        | 2 +-
 lib/kvargs/meson.build       | 2 +-
 lib/latencystats/meson.build | 2 +-
 lib/lpm/meson.build          | 3 +--
 lib/mbuf/meson.build         | 2 +-
 lib/member/meson.build       | 2 +-
 lib/mempool/meson.build      | 2 +-
 lib/metrics/meson.build      | 2 +-
 lib/mldev/meson.build        | 2 +-
 lib/net/meson.build          | 2 +-
 lib/node/meson.build         | 2 +-
 lib/pcapng/meson.build       | 2 +-
 lib/pdcp/meson.build         | 2 +-
 lib/pdump/meson.build        | 2 +-
 lib/pipeline/meson.build     | 2 +-
 lib/port/meson.build         | 2 +-
 lib/power/meson.build        | 2 +-
 lib/rawdev/meson.build       | 2 --
 lib/rcu/meson.build          | 2 +-
 lib/regexdev/meson.build     | 2 +-
 lib/reorder/meson.build      | 2 +-
 lib/rib/meson.build          | 2 +-
 lib/ring/meson.build         | 1 -
 lib/sched/meson.build        | 2 +-
 lib/security/meson.build     | 2 +-
 lib/table/meson.build        | 2 +-
 lib/telemetry/meson.build    | 2 +-
 lib/vhost/meson.build        | 2 +-
 49 files changed, 46 insertions(+), 58 deletions(-)
lib/argparse/meson.build +1 -1
index 8ab4c408ee..5d602c1f2a 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_argparse.c')
 headers = files('rte_argparse.h')
 
-deps += ['log']
+deps = ['log']
lib/bbdev/meson.build +1 -1
index 07685e7578..2e68aa7873 100644
@@ -11,4 +11,4 @@ sources = files('rte_bbdev.c')
 headers = files('rte_bbdev.h',
         'rte_bbdev_pmd.h',
         'rte_bbdev_op.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/bitratestats/meson.build +1 -1
index ede7e0a579..8defcd53bf 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_bitrate.c')
 headers = files('rte_bitrate.h')
-deps += ['ethdev', 'metrics']
+deps = ['metrics']
lib/bpf/meson.build +1 -1
index aa258a9061..82127bc657 100644
@@ -31,7 +31,7 @@ headers = files('bpf_def.h',
         'rte_bpf.h',
         'rte_bpf_ethdev.h')
 
-deps += ['mbuf', 'net', 'ethdev']
+deps = ['ethdev']
 
 dep = dependency('libelf', required: false, method: 'pkg-config')
 if dep.found()
lib/cmdline/meson.build +1 -1
index 63fb69100d..4451f3da29 100644
@@ -31,4 +31,4 @@ else
     sources += files('cmdline_os_unix.c')
 endif
 
-deps += ['net']
+deps = ['net']
lib/compressdev/meson.build +1 -1
index c80295dc0d..4b86955baf 100644
@@ -16,4 +16,4 @@ driver_sdk_headers = files(
         'rte_compressdev_pmd.h',
         'rte_compressdev_internal.h',
     )
-deps += ['kvargs', 'mbuf']
+deps = ['mbuf']
lib/cryptodev/meson.build +1 -1
index 4734acf321..74e42ac700 100644
@@ -20,4 +20,4 @@ driver_sdk_headers += files(
         'cryptodev_pmd.h',
 )
 
-deps += ['kvargs', 'mbuf', 'rcu', 'telemetry']
+deps = ['mbuf', 'rcu']
lib/dispatcher/meson.build +1 -1
index ffaef26a6d..4dc1759951 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_dispatcher.c')
 headers = files('rte_dispatcher.h')
 
-deps += ['eventdev']
+deps = ['eventdev']
lib/distributor/meson.build +1 -1
index 24988c5827..ba43273bc3 100644
@@ -14,4 +14,4 @@ else
     sources += files('rte_distributor_match_generic.c')
 endif
 headers = files('rte_distributor.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/dmadev/meson.build +0 -2
index e66dcb66b0..70b375f1cb 100644
@@ -11,5 +11,3 @@ sources = files('rte_dmadev.c', 'rte_dmadev_trace_points.c')
 headers = files('rte_dmadev.h')
 indirect_headers += files('rte_dmadev_core.h', 'rte_dmadev_trace_fp.h')
 driver_sdk_headers += files('rte_dmadev_pmd.h')
-
-deps += ['telemetry']
lib/eal/meson.build +1 -4
index e1d6c4cf17..d25443d097 100644
@@ -14,10 +14,7 @@ subdir(exec_env)
 
 subdir(arch_subdir)
 
-deps += ['log', 'kvargs']
-if not is_windows
-    deps += ['telemetry']
-endif
+deps = ['kvargs', 'telemetry']
 if dpdk_conf.has('RTE_USE_LIBBSD')
     ext_deps += libbsd
 endif
lib/efd/meson.build +1 -1
index 343f14e1f3..da0ee7f803 100644
@@ -9,4 +9,4 @@ endif
 
 sources = files('rte_efd.c')
 headers = files('rte_efd.h')
-deps += ['ring', 'hash']
+deps = ['hash']
lib/ethdev/meson.build +1 -1
index f1d2586591..fc53a9c309 100644
@@ -53,7 +53,7 @@ if is_linux
     )
 endif
 
-deps += ['net', 'kvargs', 'meter', 'telemetry']
+deps = ['net', 'meter']
 
 if is_freebsd
     annotate_locks = false
lib/eventdev/meson.build +1 -2
index a04bb86f0f..237df998ce 100644
@@ -38,5 +38,4 @@ driver_sdk_headers += files(
         'event_timer_adapter_pmd.h',
 )
 
-deps += ['ring', 'ethdev', 'hash', 'mempool', 'mbuf', 'timer', 'cryptodev', 'dmadev']
-deps += ['telemetry']
+deps = ['ethdev', 'hash', 'timer', 'cryptodev', 'dmadev']
lib/fib/meson.build +1 -1
index 6795f41a0a..9ba8e50fe0 100644
@@ -10,7 +10,7 @@ endif
 
 sources = files('rte_fib.c', 'rte_fib6.c', 'dir24_8.c', 'trie.c')
 headers = files('rte_fib.h', 'rte_fib6.h')
-deps += ['rib']
+deps = ['rib']
 
 # compile AVX512 version if:
 # we are building 64-bit binary AND binutils can generate proper code
lib/gpudev/meson.build +1 -1
index d21fadc052..5d883b85a1 100644
@@ -13,4 +13,4 @@ sources = files(
         'gpudev.c',
 )
 
-deps += ['mbuf']
+deps = ['mbuf']
lib/graph/meson.build +1 -1
index 0cb15442ab..f58f107d52 100644
@@ -25,4 +25,4 @@ indirect_headers += files(
         'rte_graph_worker_common.h',
 )
 
-deps += ['eal', 'pcapng', 'mempool', 'ring']
+deps = ['pcapng']
lib/gro/meson.build +1 -1
index dbce05220d..c6de6ceebc 100644
@@ -10,4 +10,4 @@ sources = files(
         'gro_vxlan_udp4.c',
 )
 headers = files('rte_gro.h')
-deps += ['ethdev']
+deps = ['ethdev']
lib/gso/meson.build +1 -1
index 622411df8f..bc99109933 100644
@@ -10,4 +10,4 @@ sources = files(
         'rte_gso.c',
 )
 headers = files('rte_gso.h')
-deps += ['ethdev']
+deps = ['ethdev']
lib/hash/meson.build +1 -3
index 277eb9fa93..74b81397f9 100644
@@ -25,6 +25,4 @@ sources = files(
         'rte_thash_gfni.c',
 )
 
-deps += ['net']
-deps += ['ring']
-deps += ['rcu']
+deps = ['net', 'rcu']
lib/ip_frag/meson.build +1 -1
index ea2de09f75..cacf391460 100644
@@ -10,4 +10,4 @@ sources = files(
         'ip_frag_internal.c',
 )
 headers = files('rte_ip_frag.h')
-deps += ['ethdev', 'hash']
+deps = ['ethdev', 'hash']
lib/ipsec/meson.build +1 -1
index 5c5a4aae78..7abbac5b6a 100644
@@ -14,6 +14,6 @@ sources = files('esp_inb.c', 'esp_outb.c',
 headers = files('rte_ipsec.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h')
 indirect_headers += files('rte_ipsec_group.h')
 
-deps += ['mbuf', 'net', 'cryptodev', 'security', 'hash', 'telemetry']
+deps = ['security', 'hash']
 
 annotate_locks = false
lib/kvargs/meson.build +1 -1
index 7eae744a8f..7282b0ff8d 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-deps += 'log'
+deps = ['log']
 sources = files('rte_kvargs.c')
 headers = files('rte_kvargs.h')
lib/latencystats/meson.build +1 -1
index 286558dd79..f8b9a8aeec 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_latencystats.c')
 headers = files('rte_latencystats.h')
-deps += ['metrics', 'ethdev']
+deps = ['metrics']
lib/lpm/meson.build +1 -2
index ae30f80b69..5031b085c4 100644
@@ -18,5 +18,4 @@ indirect_headers += files(
         'rte_lpm_sse.h',
         'rte_lpm_sve.h',
 )
-deps += ['hash']
-deps += ['rcu']
+deps = ['hash']
lib/mbuf/meson.build +1 -1
index 2cee9057a5..22f5a3038b 100644
@@ -20,4 +20,4 @@ headers = files(
         'rte_mbuf_pool_ops.h',
         'rte_mbuf_dyn.h',
 )
-deps += ['mempool']
+deps = ['mempool']
lib/member/meson.build +1 -1
index 02ef59795e..b951aa566e 100644
@@ -16,7 +16,7 @@ sources = files(
         'rte_member_vbf.c',
 )
 
-deps += ['hash', 'ring']
+deps = ['hash']
 
 # compile AVX512 version if:
 if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
lib/mempool/meson.build +1 -1
index acce66cb97..25b26a50fa 100644
@@ -25,4 +25,4 @@ headers = files(
         'rte_mempool.h',
         'rte_mempool_trace_fp.h',
 )
-deps += ['ring', 'telemetry']
+deps = ['ring']
lib/metrics/meson.build +1 -1
index 8c1c4b4b49..5165967646 100644
@@ -8,4 +8,4 @@ if dpdk_conf.has('RTE_HAS_JANSSON')
     ext_deps += jansson_dep
 endif
 
-deps += ['ethdev', 'telemetry']
+deps = ['ethdev']
lib/mldev/meson.build +1 -1
index 2c933baad6..6069fff1f0 100644
@@ -41,7 +41,7 @@ driver_sdk_headers += files(
         'mldev_utils.h',
 )
 
-deps += ['mempool', 'mbuf']
+deps = ['mbuf']
 
 if get_option('buildtype').contains('debug')
         cflags += [ '-DRTE_LIBRTE_ML_DEV_DEBUG' ]
lib/net/meson.build +1 -1
index 0b69138949..2cb511f046 100644
@@ -34,7 +34,7 @@ sources = files(
         'rte_net.c',
         'rte_net_crc.c',
 )
-deps += ['mbuf']
+deps = ['mbuf']
 
 if dpdk_conf.has('RTE_ARCH_X86_64')
     net_crc_sse42_cpu_support = (cc.get_define('__PCLMUL__', args: machine_args) != '')
lib/node/meson.build +1 -1
index 0bed97a96c..368ce1dc63 100644
@@ -34,4 +34,4 @@ headers = files(
 
 # Strict-aliasing rules are violated by uint8_t[] to context size casts.
 cflags += '-fno-strict-aliasing'
-deps += ['graph', 'mbuf', 'lpm', 'ethdev', 'mempool', 'cryptodev', 'ip_frag']
+deps = ['graph', 'lpm', 'cryptodev', 'ip_frag']
lib/pcapng/meson.build +1 -1
index 4549925d41..e8f059a9b0 100644
@@ -4,4 +4,4 @@
 sources = files('rte_pcapng.c')
 headers = files('rte_pcapng.h')
 
-deps += ['ethdev']
+deps = ['ethdev']
lib/pdcp/meson.build +1 -1
index f4f9246bcb..f6f3d6237a 100644
@@ -18,4 +18,4 @@ sources = files(
 headers = files('rte_pdcp.h')
 indirect_headers += files('rte_pdcp_group.h')
 
-deps += ['mbuf', 'net', 'cryptodev', 'security', 'reorder']
+deps = ['security', 'reorder']
lib/pdump/meson.build +1 -1
index da8d51b616..23d7db794b 100644
@@ -9,4 +9,4 @@ endif
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev', 'bpf', 'pcapng']
+deps = ['bpf', 'pcapng']
lib/pipeline/meson.build +1 -1
index fd5e0dc6bb..f08eca70d1 100644
@@ -25,4 +25,4 @@ headers = files(
         'rte_swx_extern.h',
         'rte_swx_ctl.h',
 )
-deps += ['port', 'table', 'meter', 'sched', 'cryptodev', 'ipsec']
+deps = ['table', 'ipsec']
lib/port/meson.build +1 -1
index b597772872..0524c3c049 100644
@@ -40,7 +40,7 @@ headers = files(
         'rte_swx_port_ring.h',
         'rte_swx_port_source_sink.h',
 )
-deps += ['ethdev', 'sched', 'ip_frag', 'cryptodev', 'eventdev']
+deps = ['sched', 'ip_frag', 'eventdev']
 
 if dpdk_conf.has('RTE_HAS_LIBPCAP')
     dpdk_conf.set('RTE_PORT_PCAP', 1)
lib/power/meson.build +1 -1
index b8426589b2..190bbf90a2 100644
@@ -33,4 +33,4 @@ headers = files(
 if cc.has_argument('-Wno-cast-qual')
     cflags += '-Wno-cast-qual'
 endif
-deps += ['timer', 'ethdev']
+deps = ['timer', 'ethdev']
lib/rawdev/meson.build +0 -2
index 7dfc3d5cf9..8841f003d7 100644
@@ -9,5 +9,3 @@ endif
 
 sources = files('rte_rawdev.c')
 headers = files('rte_rawdev.h', 'rte_rawdev_pmd.h')
-
-deps += ['telemetry']
lib/rcu/meson.build +1 -1
index 71143f5210..b78f46fad7 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_rcu_qsbr.c')
 headers = files('rte_rcu_qsbr.h')
 
-deps += ['ring']
+deps = ['ring']
lib/regexdev/meson.build +1 -1
index 426e764ece..3e20fa387d 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_regexdev.c')
 headers = files('rte_regexdev.h', 'rte_regexdev_driver.h')
 indirect_headers += files('rte_regexdev_core.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/reorder/meson.build +1 -1
index 03aed53d90..1e088a7d97 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_reorder.c')
 headers = files('rte_reorder.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/rib/meson.build +1 -1
index 7bacbb4535..2085beb444 100644
@@ -4,4 +4,4 @@
 
 sources = files('rte_rib.c', 'rte_rib6.c')
 headers = files('rte_rib.h', 'rte_rib6.h')
-deps += ['mempool']
+deps = ['mempool']
lib/ring/meson.build +0 -1
index 7fca958ed7..c20685c689 100644
@@ -18,4 +18,3 @@ indirect_headers += files (
         'rte_ring_rts.h',
         'rte_ring_rts_elem_pvt.h',
 )
-deps += ['telemetry']
lib/sched/meson.build +1 -1
index df75db51ed..7ca8ec09df 100644
@@ -15,4 +15,4 @@ headers = files(
         'rte_sched_common.h',
         'rte_pie.h',
 )
-deps += ['mbuf', 'meter']
+deps = ['mbuf', 'meter']
lib/security/meson.build +1 -1
index 1034a7a299..e4545a8c72 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_security.c')
 headers = files('rte_security.h', 'rte_security_driver.h')
-deps += ['mempool', 'cryptodev', 'net']
+deps = ['cryptodev', 'net']
lib/table/meson.build +1 -1
index 9b3d9ac759..78d7e87eab 100644
@@ -39,7 +39,7 @@ headers = files(
         'rte_table_lpm_ipv6.h',
         'rte_table_stub.h',
 )
-deps += ['mbuf', 'port', 'lpm', 'hash', 'acl']
+deps = ['port', 'lpm', 'acl']
 
 indirect_headers += files(
         'rte_lru_arm64.h',
lib/telemetry/meson.build +1 -1
index 489d000047..3e3a2cfc32 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-deps += 'log'
+deps = ['log']
 sources = files('telemetry.c', 'telemetry_data.c', 'telemetry_legacy.c')
 headers = files('rte_telemetry.h')
 includes += include_directories('../metrics')
lib/vhost/meson.build +1 -1
index 41b622a9be..51bbd87397 100644
@@ -42,4 +42,4 @@ headers = files(
 driver_sdk_headers = files(
         'vdpa_driver.h',
 )
-deps += ['ethdev', 'cryptodev', 'hash', 'pci', 'dmadev']
+deps = ['ethdev', 'cryptodev', 'hash', 'pci', 'dmadev']
Signature · 1 line
2.43.0
#11 lore raw

PATCH v2 5/7 build: reduce driver dependencies

In reply to Bruce Richardson

Remove any unnecessary dependencies from the driver dependency lists. This will give each driver a near-minimum set of required dependencies.

---
 drivers/baseband/fpga_5gnr_fec/meson.build | 2 +-
 drivers/baseband/fpga_lte_fec/meson.build  | 2 +-
 drivers/baseband/la12xx/meson.build        | 2 +-
 drivers/baseband/null/meson.build          | 2 +-
 drivers/baseband/turbo_sw/meson.build      | 2 +-
 drivers/bus/auxiliary/meson.build          | 2 --
 drivers/bus/dpaa/meson.build               | 2 +-
 drivers/bus/fslmc/meson.build              | 2 +-
 drivers/bus/ifpga/meson.build              | 2 +-
 drivers/bus/pci/meson.build                | 4 +---
 drivers/bus/platform/meson.build           | 1 -
 drivers/bus/uacce/meson.build              | 2 --
 drivers/bus/vdev/meson.build               | 2 --
 drivers/common/cnxk/meson.build            | 4 ++--
 drivers/common/cpt/meson.build             | 2 +-
 drivers/common/idpf/meson.build            | 2 +-
 drivers/common/mlx5/meson.build            | 2 +-
 drivers/compress/mlx5/meson.build          | 2 +-
 drivers/compress/nitrox/meson.build        | 2 +-
 drivers/compress/octeontx/meson.build      | 2 +-
 drivers/crypto/bcmfs/meson.build           | 2 +-
 drivers/crypto/cnxk/meson.build            | 2 +-
 drivers/crypto/dpaa_sec/meson.build        | 2 +-
 drivers/crypto/ipsec_mb/meson.build        | 2 +-
 drivers/crypto/mlx5/meson.build            | 2 +-
 drivers/crypto/nitrox/meson.build          | 2 +-
 drivers/dma/cnxk/meson.build               | 2 +-
 drivers/dma/dpaa/meson.build               | 2 +-
 drivers/dma/dpaa2/meson.build              | 2 +-
 drivers/dma/odm/meson.build                | 2 +-
 drivers/dma/skeleton/meson.build           | 2 +-
 drivers/event/cnxk/meson.build             | 2 +-
 drivers/event/dlb2/meson.build             | 2 +-
 drivers/event/dpaa2/meson.build            | 2 +-
 drivers/event/octeontx/meson.build         | 3 +--
 drivers/event/sw/meson.build               | 2 +-
 drivers/mempool/cnxk/meson.build           | 2 +-
 drivers/mempool/dpaa/meson.build           | 2 +-
 drivers/mempool/dpaa2/meson.build          | 2 +-
 drivers/mempool/octeontx/meson.build       | 2 +-
 drivers/net/cnxk/meson.build               | 3 +--
 drivers/net/iavf/meson.build               | 2 +-
 drivers/net/ice/meson.build                | 2 +-
 drivers/net/mana/meson.build               | 2 +-
 drivers/net/mlx5/meson.build               | 2 +-
 drivers/net/sfc/meson.build                | 2 +-
 drivers/net/softnic/meson.build            | 2 +-
 drivers/raw/cnxk_bphy/meson.build          | 2 +-
 drivers/raw/cnxk_gpio/meson.build          | 2 +-
 drivers/raw/ntb/meson.build                | 2 +-
 drivers/raw/skeleton/meson.build           | 2 +-
 drivers/regex/mlx5/meson.build             | 2 +-
 drivers/vdpa/ifc/meson.build               | 2 +-
 drivers/vdpa/meson.build                   | 3 +--
 drivers/vdpa/mlx5/meson.build              | 2 +-
 drivers/vdpa/sfc/meson.build               | 2 +-
 56 files changed, 53 insertions(+), 65 deletions(-)
drivers/baseband/fpga_5gnr_fec/meson.build +1 -1
index c3678d23eb..31b9e92fbb 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2020 Intel Corporation
 
-deps += ['bus_vdev', 'ring', 'pci', 'bus_pci']
+deps += ['bus_vdev', 'bus_pci']
 
 sources = files('rte_fpga_5gnr_fec.c')
 
drivers/baseband/fpga_lte_fec/meson.build +1 -1
index 14e07826ef..fbf24755db 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Intel Corporation
 
-deps += ['bus_vdev', 'ring', 'pci', 'bus_pci']
+deps += ['bus_vdev', 'bus_pci']
 sources = files('fpga_lte_fec.c')
drivers/baseband/la12xx/meson.build +1 -1
index 7b7e41c961..e1dbdd0fa7 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2020-2021 NXP
 
-deps += ['bus_vdev', 'ring']
+deps += ['bus_vdev']
 
 sources = files('bbdev_la12xx.c')
drivers/baseband/null/meson.build +1 -1
index 22863f0bd8..716d6c6fdb 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <[email protected]>
 
-deps += ['bus_vdev', 'ring']
+deps += ['bus_vdev']
 sources = files('bbdev_null.c')
drivers/baseband/turbo_sw/meson.build +1 -1
index a9035a753e..ac18e8a9b6 100644
@@ -26,5 +26,5 @@ if dep_dec5g.found()
     cflags += ['-DRTE_BBDEV_SDK_AVX512']
 endif
 
-deps += ['bus_vdev', 'ring']
+deps += ['bus_vdev']
 sources = files('bbdev_turbo_software.c')
drivers/bus/auxiliary/meson.build +0 -2
index 10468fd130..a113f11743 100644
@@ -13,5 +13,3 @@ if is_linux
 endif
 
 require_iova_in_mbuf = false
-
-deps += ['kvargs']
drivers/bus/dpaa/meson.build +1 -1
index 114e0a2265..d0ae5a9ff0 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_dpaax', 'eventdev']
+deps = ['common_dpaax', 'eventdev']
 sources = files(
         'base/fman/fman.c',
         'base/fman/fman_hw.c',
drivers/bus/fslmc/meson.build +1 -1
index 162ca286fe..989a47c7a0 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_dpaax', 'eventdev', 'kvargs']
+deps = ['common_dpaax', 'eventdev']
 sources = files(
         'fslmc_bus.c',
         'fslmc_vfio.c',
drivers/bus/ifpga/meson.build +1 -1
index dedc94db2d..e87b08eaf4 100644
@@ -7,6 +7,6 @@ if is_windows
     subdir_done()
 endif
 
-deps += ['pci', 'kvargs', 'rawdev']
+deps = ['pci', 'rawdev']
 driver_sdk_headers += files('bus_ifpga_driver.h')
 sources = files('ifpga_bus.c')
drivers/bus/pci/meson.build +1 -3
index fede114dc7..776c3d1550 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-deps += ['pci']
+deps = ['pci']
 headers = files('rte_bus_pci.h')
 driver_sdk_headers = files('bus_pci_driver.h')
 sources = files('pci_common.c',
@@ -31,5 +31,3 @@ if is_windows
 endif
 
 require_iova_in_mbuf = false
-
-deps += ['kvargs']
drivers/bus/platform/meson.build +0 -1
index 8633cc4e75..2039c23ac6 100644
@@ -10,7 +10,6 @@ endif
 
 require_iova_in_mbuf = false
 
-deps += ['kvargs']
 sources = files(
         'platform_params.c',
         'platform.c',
drivers/bus/uacce/meson.build +0 -2
index a659d65f23..130148a315 100644
@@ -8,5 +8,3 @@ endif
 
 sources = files('uacce.c')
 driver_sdk_headers += files('bus_uacce_driver.h')
-
-deps += ['kvargs']
drivers/bus/vdev/meson.build +0 -2
index 50f0c8918d..24993c88a3 100644
@@ -9,5 +9,3 @@ headers = files('rte_bus_vdev.h')
 driver_sdk_headers = files('bus_vdev_driver.h')
 
 require_iova_in_mbuf = false
-
-deps += ['kvargs']
drivers/common/cnxk/meson.build +2 -2
index e0e4600989..8ff080ee19 100644
@@ -8,7 +8,7 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     subdir_done()
 endif
 
-deps = ['eal', 'pci', 'bus_pci', 'mbuf', 'security']
+deps = ['bus_pci', 'security']
 sources = files(
         'roc_ae.c',
         'roc_aes.c',
@@ -91,7 +91,7 @@ sources += files('cnxk_telemetry_bphy.c',
                  'cnxk_telemetry_sso.c',
 )
 
-deps += ['bus_pci', 'net', 'telemetry']
+deps += ['bus_pci']
 
 require_iova_in_mbuf = false
 
drivers/common/cpt/meson.build +1 -1
index c09824a651..a4b000dc37 100644
@@ -9,5 +9,5 @@ endif
 
 sources = files('cpt_fpm_tables.c', 'cpt_pmd_ops_helper.c')
 
-deps = ['kvargs', 'pci', 'cryptodev']
+deps = ['pci', 'cryptodev']
 includes += include_directories('../../crypto/octeontx')
drivers/common/idpf/meson.build +1 -1
index 80c8906f80..adf5430487 100644
@@ -7,7 +7,7 @@ endif
 
 includes += include_directories('../iavf')
 
-deps += ['mbuf']
+deps = ['mbuf']
 
 sources = files(
         'idpf_common_device.c',
drivers/common/mlx5/meson.build +1 -1
index 1eefc02f06..b94c956495 100644
@@ -12,7 +12,7 @@ if is_windows and not is_ms_linker and not meson.is_cross_build()
     subdir_done()
 endif
 
-deps += ['hash', 'pci', 'bus_pci', 'bus_auxiliary', 'net', 'eal', 'kvargs']
+deps += ['hash', 'bus_pci', 'bus_auxiliary']
 sources += files(
         'mlx5_devx_cmds.c',
         'mlx5_common.c',
drivers/compress/mlx5/meson.build +1 -1
index 26a0e0cd09..ddb9e0f82c 100644
@@ -7,7 +7,7 @@ if not is_linux
     subdir_done()
 endif
 
-deps += ['common_mlx5', 'eal', 'compressdev']
+deps += ['common_mlx5', 'compressdev']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/compress/nitrox/meson.build +1 -1
index 1becc66912..c3db4ac2bb 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_nitrox', 'bus_pci', 'compressdev']
+deps += ['common_nitrox', 'compressdev']
 
 sources += files(
         'nitrox_comp.c',
drivers/compress/octeontx/meson.build +1 -1
index 16f973f4d7..0ccde449e8 100644
@@ -9,7 +9,7 @@ endif
 
 sources = files('otx_zip.c', 'otx_zip_pmd.c')
 includes += include_directories('include')
-deps += ['mempool_octeontx', 'bus_pci']
+deps += ['mempool_octeontx']
 ext_deps += dep
 
 require_iova_in_mbuf = false
drivers/crypto/bcmfs/meson.build +1 -1
index 5842f83a3b..678bab7398 100644
@@ -9,7 +9,7 @@ if is_windows
     subdir_done()
 endif
 
-deps += ['eal', 'bus_vdev']
+deps += ['bus_vdev']
 sources = files(
         'bcmfs_logs.c',
         'bcmfs_device.c',
drivers/crypto/cnxk/meson.build +1 -1
index aa840fb7bb..c5a5725e1a 100644
@@ -25,7 +25,7 @@ sources = files(
 )
 
 headers = files('rte_pmd_cnxk_crypto.h')
-deps += ['bus_pci', 'common_cnxk', 'security', 'eventdev']
+deps += ['common_cnxk', 'eventdev']
 includes += include_directories('../../../lib/net', '../../event/cnxk')
 
 if get_option('buildtype').contains('debug')
drivers/crypto/dpaa_sec/meson.build +1 -1
index f87ad6c7e7..9efac952c4 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['bus_dpaa', 'mempool_dpaa', 'security']
+deps += ['mempool_dpaa', 'security']
 sources = files('dpaa_sec.c', 'dpaa_sec_raw_dp.c')
 
 includes += include_directories('../../bus/dpaa/include')
drivers/crypto/ipsec_mb/meson.build +1 -1
index 87bf965554..739cbd1b6e 100644
@@ -45,5 +45,5 @@ sources = files(
         'pmd_snow3g.c',
         'pmd_zuc.c',
 )
-deps += ['bus_vdev', 'net', 'security']
+deps += ['bus_vdev', 'security']
 require_iova_in_mbuf = false
drivers/crypto/mlx5/meson.build +1 -1
index d7bc8ec967..595053d8cd 100644
@@ -7,7 +7,7 @@ if not (is_linux or is_windows)
     subdir_done()
 endif
 
-deps += ['common_mlx5', 'eal', 'cryptodev']
+deps += ['common_mlx5', 'cryptodev']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/crypto/nitrox/meson.build +1 -1
index f8887713d2..85e3ca2b28 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_nitrox', 'bus_pci', 'cryptodev']
+deps += ['common_nitrox', 'cryptodev']
 
 sources += files(
         'nitrox_sym.c',
drivers/dma/cnxk/meson.build +1 -1
index 8ccc1c2cb7..738774d542 100644
@@ -12,7 +12,7 @@ driver_sdk_headers = files(
         'cnxk_dma_event_dp.h',
 )
 
-deps += ['bus_pci', 'common_cnxk', 'dmadev', 'eventdev']
+deps += ['common_cnxk', 'eventdev']
 
 includes += include_directories('../../event/cnxk')
 
drivers/dma/dpaa/meson.build +1 -1
index c31a6d91fe..fec4a45767 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on linux'
 endif
 
-deps += ['dmadev', 'bus_dpaa']
+deps += ['bus_dpaa']
 sources = files('dpaa_qdma.c')
 
 if cc.has_argument('-Wno-pointer-arith')
drivers/dma/dpaa2/meson.build +1 -1
index a99151e2a5..2b5b76ec5f 100644
@@ -8,7 +8,7 @@ endif
 
 build = dpdk_conf.has('RTE_MEMPOOL_DPAA2')
 reason = 'missing dependency, DPDK DPAA2 mempool driver'
-deps += ['dmadev', 'bus_fslmc', 'mempool_dpaa2', 'ring', 'kvargs']
+deps += ['mempool_dpaa2']
 sources = files('dpaa2_qdma.c')
 
 if cc.has_argument('-Wno-pointer-arith')
drivers/dma/odm/meson.build +1 -1
index d597762d37..959e7e685d 100644
@@ -7,7 +7,7 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     subdir_done()
 endif
 
-deps += ['bus_pci', 'dmadev', 'eal', 'mempool', 'pci']
+deps += ['bus_pci', 'dmadev', 'mempool']
 
 sources = files('odm_dmadev.c', 'odm.c')
 
drivers/dma/skeleton/meson.build +1 -1
index 77055683ad..0d703a36eb 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2021 HiSilicon Limited
 
-deps += ['dmadev', 'kvargs', 'ring', 'bus_vdev']
+deps += ['dmadev', 'ring', 'bus_vdev']
 sources = files(
         'skeleton_dmadev.c',
 )
drivers/event/cnxk/meson.build +1 -1
index e0e350570d..b365fff0cb 100644
@@ -337,7 +337,7 @@ foreach flag: extra_flags
 endforeach
 
 headers = files('rte_pmd_cnxk_eventdev.h')
-deps += ['bus_pci', 'common_cnxk', 'net_cnxk', 'crypto_cnxk', 'dma_cnxk']
+deps += ['net_cnxk', 'crypto_cnxk', 'dma_cnxk']
 
 require_iova_in_mbuf = false
 
drivers/event/dlb2/meson.build +1 -1
index 515d1795fe..217abc174d 100644
@@ -67,4 +67,4 @@ endif
 
 headers = files('rte_pmd_dlb2.h')
 
-deps += ['mbuf', 'mempool', 'ring', 'pci', 'bus_pci']
+deps += ['bus_pci']
drivers/event/dpaa2/meson.build +1 -1
index dd5063af43..7dae1da32b 100644
@@ -5,7 +5,7 @@ if not is_linux
     build = false
     reason = 'only supported on Linux'
 endif
-deps += ['bus_vdev', 'net_dpaa2', 'crypto_dpaa2_sec']
+deps += ['net_dpaa2', 'crypto_dpaa2_sec']
 sources = files(
         'dpaa2_hw_dpcon.c',
         'dpaa2_eventdev.c',
drivers/event/octeontx/meson.build +1 -2
index eb17e059d8..1227b2e18d 100644
@@ -17,5 +17,4 @@ sources = files(
         'timvf_probe.c',
 )
 
-deps += ['common_octeontx', 'mempool_octeontx', 'bus_vdev', 'net_octeontx']
-deps += ['crypto_octeontx']
+deps = ['net_octeontx', 'crypto_octeontx']
drivers/event/sw/meson.build +1 -1
index 3a3ebd72a3..450969aa7a 100644
@@ -8,5 +8,5 @@ sources = files(
         'sw_evdev_xstats.c',
         'sw_evdev.c',
 )
-deps += ['hash', 'bus_vdev']
+deps += ['bus_vdev']
 require_iova_in_mbuf = false
drivers/mempool/cnxk/meson.build +1 -1
index e388cce26a..7bbed325df 100644
@@ -18,5 +18,5 @@ sources = files(
 )
 
 headers = files('rte_pmd_cnxk_mempool.h')
-deps += ['eal', 'mbuf', 'kvargs', 'bus_pci', 'common_cnxk', 'mempool']
+deps = ['common_cnxk']
 require_iova_in_mbuf = false
drivers/mempool/dpaa/meson.build +1 -1
index c4e9994b83..39fc312344 100644
@@ -6,5 +6,5 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['bus_dpaa']
+deps = ['bus_dpaa']
 sources = files('dpaa_mempool.c')
drivers/mempool/dpaa2/meson.build +1 -1
index 3d16d44158..0099b20b97 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['bus_fslmc']
+deps = ['bus_fslmc']
 sources = files('dpaa2_hw_mempool.c')
 
 headers = files('rte_dpaa2_mempool.h')
drivers/mempool/octeontx/meson.build +1 -1
index 3ccecac75d..f97bcf4a5a 100644
@@ -12,6 +12,6 @@ sources = files(
         'rte_mempool_octeontx.c',
 )
 
-deps += ['mbuf', 'bus_pci', 'common_octeontx']
+deps = ['mbuf', 'bus_pci', 'common_octeontx']
 
 require_iova_in_mbuf = false
drivers/net/cnxk/meson.build +1 -2
index 7bce80098a..f2f8f60f83 100644
@@ -231,8 +231,7 @@ sources += files(
 endif
 endif
 
-deps += ['bus_pci', 'cryptodev', 'eventdev', 'security']
-deps += ['common_cnxk', 'mempool_cnxk']
+deps = ['eventdev', 'mempool_cnxk']
 
 # Allow implicit vector conversions and strict aliasing warning
 extra_flags = ['-flax-vector-conversions', '-Wno-strict-aliasing']
drivers/net/iavf/meson.build +1 -1
index 83aebd5596..a96d9c0bc0 100644
@@ -11,7 +11,7 @@ includes += include_directories('../../common/iavf')
 
 testpmd_sources = files('iavf_testpmd.c')
 
-deps += ['common_iavf', 'security', 'cryptodev']
+deps += ['common_iavf', 'security']
 
 sources = files(
         'iavf_ethdev.c',
drivers/net/ice/meson.build +1 -1
index b7f2188e62..99344211cb 100644
@@ -18,7 +18,7 @@ sources = files(
 
 testpmd_sources = files('ice_testpmd.c')
 
-deps += ['hash', 'net', 'common_iavf']
+deps += ['hash', 'common_iavf']
 includes += include_directories('base', '../../common/iavf')
 
 if arch_subdir == 'x86'
drivers/net/mana/meson.build +1 -1
index 2d72eca5a8..c97f117fd7 100644
@@ -7,7 +7,7 @@ if not is_linux or not dpdk_conf.has('RTE_ARCH_X86')
     subdir_done()
 endif
 
-deps += ['pci', 'bus_pci', 'net', 'eal', 'kvargs']
+deps += ['bus_pci']
 
 sources += files(
         'gdma.c',
drivers/net/mlx5/meson.build +1 -1
index b279ddf47c..ec679d11ab 100644
@@ -8,7 +8,7 @@ if not (is_linux or is_windows)
     subdir_done()
 endif
 
-deps += ['hash', 'common_mlx5']
+deps += ['common_mlx5']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/net/sfc/meson.build +1 -1
index 5adde68517..820ee6c91e 100644
@@ -71,7 +71,7 @@ if not cc.links(atomic_check_code)
     ext_deps += libatomic_dep
 endif
 
-deps += ['common_sfc_efx', 'bus_pci', 'hash']
+deps += ['common_sfc_efx', 'hash']
 sources = files(
         'sfc_ethdev.c',
         'sfc_kvargs.c',
drivers/net/softnic/meson.build +1 -1
index 5dfbd16c77..1529ef38f9 100644
@@ -15,4 +15,4 @@ sources = files(
         'rte_eth_softnic_swq.c',
         'rte_eth_softnic_thread.c',
 )
-deps += ['pipeline', 'port', 'table']
+deps += ['pipeline']
drivers/raw/cnxk_bphy/meson.build +1 -1
index bb5d2ffb80..b38b071697 100644
@@ -2,7 +2,7 @@
 # Copyright(C) 2021 Marvell.
 #
 
-deps += ['bus_pci', 'common_cnxk', 'rawdev']
+deps += ['common_cnxk', 'rawdev']
 sources = files(
         'cnxk_bphy.c',
         'cnxk_bphy_cgx.c',
drivers/raw/cnxk_gpio/meson.build +1 -1
index 9d9a527392..6d17fe573f 100644
@@ -2,7 +2,7 @@
 # Copyright(C) 2021 Marvell.
 #
 
-deps += ['bus_vdev', 'common_cnxk', 'rawdev', 'kvargs']
+deps += ['bus_vdev', 'common_cnxk', 'rawdev']
 sources = files(
         'cnxk_gpio.c',
         'cnxk_gpio_irq.c',
drivers/raw/ntb/meson.build +1 -1
index 9096f2b25a..8f79d3b16a 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Intel Corporation.
 
-deps += ['rawdev', 'mbuf', 'mempool', 'pci', 'bus_pci']
+deps += ['rawdev', 'mbuf', 'bus_pci']
 sources = files('ntb.c',
                 'ntb_hw_intel.c')
 headers = files('rte_pmd_ntb.h')
drivers/raw/skeleton/meson.build +1 -1
index 9d5fcf6514..7d76fe71b3 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-deps += ['rawdev', 'kvargs', 'mbuf', 'bus_vdev']
+deps += ['rawdev', 'mbuf', 'bus_vdev']
 sources = files(
         'skeleton_rawdev.c',
         'skeleton_rawdev_test.c',
drivers/regex/mlx5/meson.build +1 -1
index 6070b37501..f75bf2e084 100644
@@ -7,7 +7,7 @@ if not is_linux
     subdir_done()
 endif
 
-deps += ['common_mlx5', 'eal']
+deps += ['common_mlx5']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/vdpa/ifc/meson.build +1 -1
index f78d36a715..f4ed4f491f 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-deps += 'vhost'
+deps += 'bus_pci'
 sources = files('ifcvf_vdpa.c', 'base/ifcvf.c')
 includes += include_directories('base')
drivers/vdpa/meson.build +1 -2
index e01c277b9e..747cdc7c55 100644
@@ -11,5 +11,4 @@ drivers = [
         'nfp',
         'sfc',
 ]
-std_deps = ['bus_pci']
-std_deps += ['vhost']
+std_deps = ['vhost']
drivers/vdpa/mlx5/meson.build +1 -1
index e224d1bcc9..1263ac43a4 100644
@@ -7,7 +7,7 @@ if not is_linux
     subdir_done()
 endif
 
-deps += ['hash', 'common_mlx5', 'vhost', 'pci', 'eal', 'sched']
+deps += ['common_mlx5', 'vhost', 'sched']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/vdpa/sfc/meson.build +1 -1
index 933f3f18f3..465ca9f220 100644
@@ -16,7 +16,7 @@ foreach flag: extra_flags
     endif
 endforeach
 
-deps += ['common_sfc_efx', 'bus_pci']
+deps += ['common_sfc_efx']
 sources = files(
         'sfc_vdpa.c',
         'sfc_vdpa_hw.c',
Signature · 1 line
2.43.0
#12 lore raw

PATCH v2 6/7 build: reduce app dependencies

In reply to Bruce Richardson

Remove any unnecessary dependencies from the app dependency lists. This will give each app a near-minimum set of required dependencies.

---
 app/dumpcap/meson.build          | 2 +-
 app/graph/meson.build            | 2 +-
 app/pdump/meson.build            | 2 +-
 app/proc-info/meson.build        | 2 +-
 app/test-crypto-perf/meson.build | 2 +-
 app/test-fib/meson.build         | 2 +-
 app/test-sad/meson.build         | 2 +-
 app/test/meson.build             | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)
app/dumpcap/meson.build +1 -1
index 69c016c780..6204cf051a 100644
@@ -14,4 +14,4 @@ endif
 
 ext_deps += pcap_dep
 sources = files('main.c')
-deps += ['ethdev', 'pdump', 'pcapng', 'bpf']
+deps += ['pdump']
app/graph/meson.build +1 -1
index 6dc54d5ee6..9c4cd080d9 100644
@@ -9,7 +9,7 @@ if not build
     subdir_done()
 endif
 
-deps += ['graph', 'eal', 'lpm', 'ethdev', 'node', 'cmdline']
+deps += ['node', 'cmdline']
 sources = files(
         'cli.c',
         'conn.c',
app/pdump/meson.build +1 -1
index fb282bba1f..a10f9d6124 100644
@@ -8,4 +8,4 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ethdev', 'kvargs', 'pdump']
+deps += ['pdump']
app/proc-info/meson.build +1 -1
index 4f83f29a64..b309109291 100644
@@ -8,7 +8,7 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ethdev', 'security', 'eventdev']
+deps += ['security', 'eventdev']
 if dpdk_conf.has('RTE_LIB_METRICS')
     deps += 'metrics'
 endif
app/test-crypto-perf/meson.build +1 -1
index 7b02b518f0..51794521fb 100644
@@ -19,7 +19,7 @@ sources = files(
         'cperf_test_verify.c',
         'main.c',
 )
-deps += ['cryptodev', 'net', 'security']
+deps += ['cryptodev']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
     deps += 'crypto_scheduler'
 endif
app/test-fib/meson.build +1 -1
index eb36772cf3..25e2ea1a1d 100644
@@ -8,4 +8,4 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['fib', 'lpm', 'net']
+deps += ['fib', 'lpm']
app/test-sad/meson.build +1 -1
index a50616a9c7..414e2a05cb 100644
@@ -8,4 +8,4 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ipsec', 'net']
+deps += ['ipsec']
app/test/meson.build +1 -1
index e29258e6ec..027008e047 100644
@@ -2,7 +2,7 @@
 # Copyright(c) 2017-2023 Intel Corporation
 
 # the main test files [test.c and commands.c] relies on these libraries
-deps += ['cmdline', 'ring', 'mempool', 'mbuf']
+deps += ['cmdline']
 sources += files('commands.c', 'test.c')
 
 # optional dependencies: some files may use these - and so we should link them in -
Signature · 1 line
2.43.0
#13 lore raw

PATCH v2 7/7 devtools: add script to generate DPDK dependency graphs

In reply to Bruce Richardson

Rather than the single monolithic graph that would be output from the deps.dot file in a build directory, we can post-process that to generate simpler graphs for different tasks. This new "draw_dependency_graphs" script takes the "deps.dot" as input and generates an output file that has the nodes categorized, filtering them based off the requested node or category. For example, use "--component net_ice" to show the dependency tree from that driver, or "--category lib" to show just the library dependency tree.

---
 devtools/draw-dependency-graphs.py | 136 +++++++++++++++++++++++++++++
 1 file changed, 136 insertions(+)
 create mode 100755 devtools/draw-dependency-graphs.py
devtools/draw-dependency-graphs.py new file +136 -0
new file mode 100755
index 0000000000..826d89d5ce
@@ -0,0 +1,136 @@
+#! /usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 Intel Corporation
+
+import argparse
+import ast
+
+
+driver_classes = [
+    "baseband",
+    "bus",
+    "common",
+    "compress",
+    "crypto",
+    "dma",
+    "event",
+    "gpu",
+    "mempool",
+    "ml",
+    "net",
+    "raw",
+    "regex",
+    "vdpa",
+]
+
+
+def component_type(name: str):
+    if name.startswith("dpdk-"):
+        return "app"
+
+    nameparts = name.split("_", 1)
+    if len(nameparts) > 1 and nameparts[0] in driver_classes:
+        return f"drivers/{nameparts[0]}"
+
+    return "lib"
+
+
+def read_deps_list(lines: list[str]):
+    deps_data = {}
+    for ln in lines:
+        if ln.startswith("digraph") or ln == "}":
+            continue
+
+        if "->" in ln:
+            component, deps = [s.strip() for s in ln.split("->")]
+            deps = ast.literal_eval(deps)
+        else:
+            component, deps = ln, {}
+
+        component = component.strip('"')
+        comp_class = component_type(component)
+
+        if comp_class not in deps_data.keys():
+            deps_data[comp_class] = {}
+        deps_data[comp_class][component] = deps
+    return deps_data
+
+
+def create_classified_graph(deps_data: dict[dict[list[str]]]):
+    yield ("digraph dpdk_dependencies {\n  overlap=false\n  model=subset\n")
+    for n, category in enumerate(deps_data.keys()):
+        yield (f'  subgraph cluster_{n} {{\n    label = "{category}"\n')
+        for component in deps_data[category].keys():
+            yield (
+                f'    "{component}" -> {deps_data[category][component]}\n'.replace(
+                    "'", '"'
+                )
+            )
+        yield ("  }\n")
+    yield ("}\n")
+
+
+def get_deps_for_component(
+    dep_data: dict[dict[list[str]]], component: str, comp_deps: set
+):
+    categories = dep_data.keys()
+    comp_deps.add(component)
+    for cat in categories:
+        if component in dep_data[cat].keys():
+            for dep in dep_data[cat][component]:
+                get_deps_for_component(dep_data, dep, comp_deps)
+
+
+def filter_deps(
+    dep_data: dict[dict[list[str]]], component: list[str]
+) -> dict[dict[list[str]]]:
+    components = set()
+    for comp in component:
+        get_deps_for_component(dep_data, comp, components)
+
+    retval = {}
+    for category in dep_data.keys():
+        for comp in dep_data[category].keys():
+            if comp in components:
+                if category not in retval:
+                    retval[category] = {}
+                retval[category][comp] = dep_data[category][comp]
+    return retval
+
+
+def main():
+    parser = argparse.ArgumentParser(
+        description="Utility to generate dependency tree graphs for DPDK"
+    )
+    parser.add_argument(
+        "--component",
+        type=str,
+        help="Only output hierarchy from specified component down.",
+    )
+    parser.add_argument(
+        "--category",
+        type=str,
+        help="Output hierarchy for all components in given category, e.g. lib, app, drivers/net, etc.",
+    )
+    parser.add_argument(
+        "input_file",
+        type=argparse.FileType("r"),
+        help="Path to the deps.dot file from a DPDK build directory",
+    )
+    parser.add_argument(
+        "output_file",
+        type=argparse.FileType("w"),
+        help="Path to the desired output dot file",
+    )
+    args = parser.parse_args()
+
+    deps = read_deps_list([ln.strip() for ln in args.input_file.readlines()])
+    if args.component:
+        deps = filter_deps(deps, [args.component])
+    elif args.category:
+        deps = filter_deps(deps, deps[args.category].keys())
+    args.output_file.writelines(create_classified_graph(deps))
+
+
+if __name__ == "__main__":
+    main()
Signature · 1 line
2.43.0
Acked-by on the v2 series
#14 lore raw

RE: [PATCH v2 0/7] record and rework component dependencies

In reply to Bruce Richardson
Quoted 15 lines

From: Bruce Richardson [mailto:[email protected]]
Sent: Friday, 2 August 2024 14.44

As part of the meson build, we can record the dependencies for each component as we process it, logging them to a file. This file can be used as input to a number of other scripts and tools, for example, to graph the dependencies, or to allow higher-level build-config tools to automatically enable component requirements, etc.

The first patch of this set generates the basic dependency tree. The second patch does some processing of that dependency tree to identify cases where dependencies are being unnecessarily specified. Reducing these makes it easier to have readable dependency graphs in future, without affecting the build.

Quoted 7 lines

The following 4 patches are based on the output of the second patch, and greatly cut down the number of direct dependency links between components. Even with the cut-down dependencies, the full dependency graph is nigh-unreadable, so the final patch adds a new script to generate dependency tree subgraphs, creating dot files for e.g. the dependencies of a particular component, or a component class such as mempool drivers.

Thank you for the work on this, Bruce.

For the series,

#15 lore raw

Re: [PATCH v2 0/7] record and rework component dependencies

In reply to Bruce Richardson

I saw there was one fail for this series for the Marvell MVNETA container.

I thought I should also mention that the build did fail when our automation tried to run DTS on the Octeon CN10K DPU (which is also Marvell). So, that is why you won't get a report for the CN10K DTS results.

Let me know if you can't get what you need from the MVNETA build logs failure, and I can manually get more info about why this won't compile. Cheers.

#16 lore raw

Re: [PATCH v2 0/7] record and rework component dependencies

Quoted 10 lines · Patrick Robb

I saw there was one fail for this series for the Marvell MVNETA container.

I thought I should also mention that the build did fail when our automation tried to run DTS on the Octeon CN10K DPU (which is also Marvell). So, that is why you won't get a report for the CN10K DTS results.

Let me know if you can't get what you need from the MVNETA build logs failure, and I can manually get more info about why this won't compile. Cheers.

I have already got multiple emails about failures from this series - though all look to be about the same issue. I think it should be an easy fix for v3, but I'll waiting till all reports come back.

/Bruce

Tested-by on the v2 series
#17 lore raw

Re: [PATCH v2 0/7] record and rework component dependencies

In reply to Bruce Richardson
Quoted 20 lines · Bruce Richardson

As part of the meson build, we can record the dependencies for each component as we process it, logging them to a file. This file can be used as input to a number of other scripts and tools, for example, to graph the dependencies, or to allow higher-level build-config tools to automatically enable component requirements, etc.

The first patch of this set generates the basic dependency tree. The second patch does some processing of that dependency tree to identify cases where dependencies are being unnecessarily specified. Reducing these makes it easier to have readable dependency graphs in future, without affecting the build.

The following 4 patches are based on the output of the second patch, and greatly cut down the number of direct dependency links between components. Even with the cut-down dependencies, the full dependency graph is nigh-unreadable, so the final patch adds a new script to generate dependency tree subgraphs, creating dot files for e.g. the dependencies of a particular component, or a component class such as mempool drivers.

Quoted 9 lines

Bruce Richardson (7):
build: output a dependency log in build directory
devtools: add script to flag unneeded dependencies
build: remove kvargs from driver class dependencies
build: reduce library dependencies
build: reduce driver dependencies
build: reduce app dependencies
devtools: add script to generate DPDK dependency graphs

Thanks for the update, output is now easier to consume with the help of the 'devtools/draw-dependency-graphs.py' script.
A detail but script is not actually drawing graph, but parsing .dot file, name is a little misleading.

Also for the patches that are converting explicit dependency to implicit dependency, I can see the benefit for the meson and graph. But also there is a value of keeping explicit dependency, it was an easy way to document dependencies of component for developers.
So, I am not really sure which one is better.

#18 lore raw

Re: [PATCH v2 0/7] record and rework component dependencies

Quoted 39 lines · Ferruh Yigit
Quoted 20 lines · Bruce Richardson

As part of the meson build, we can record the dependencies for each component as we process it, logging them to a file. This file can be used as input to a number of other scripts and tools, for example, to graph the dependencies, or to allow higher-level build-config tools to automatically enable component requirements, etc.

The first patch of this set generates the basic dependency tree. The second patch does some processing of that dependency tree to identify cases where dependencies are being unnecessarily specified. Reducing these makes it easier to have readable dependency graphs in future, without affecting the build.

The following 4 patches are based on the output of the second patch, and greatly cut down the number of direct dependency links between components. Even with the cut-down dependencies, the full dependency graph is nigh-unreadable, so the final patch adds a new script to generate dependency tree subgraphs, creating dot files for e.g. the dependencies of a particular component, or a component class such as mempool drivers.

Quoted 9 lines

Bruce Richardson (7):
build: output a dependency log in build directory
devtools: add script to flag unneeded dependencies
build: remove kvargs from driver class dependencies
build: reduce library dependencies
build: reduce driver dependencies
build: reduce app dependencies
devtools: add script to generate DPDK dependency graphs

Thanks for the update, output is now easier to consume with the help of the 'devtools/draw-dependency-graphs.py' script.
A detail but script is not actually drawing graph, but parsing .dot file, name is a little misleading.

Quoted 6 lines

Also for the patches that are converting explicit dependency to implicit dependency, I can see the benefit for the meson and graph. But also there is a value of keeping explicit dependency, it was an easy way to document dependencies of component for developers.
So, I am not really sure which one is better.

Up till now we did not keep a fully dependency list for each component because the configuration time with meson completely exploded due to really slow deduplication of dependencies there. I haven't checked with recent versions of meson, though, so the problem may no longer be there now. Right now, we have "partial dependency lists" - neither full list of dependencies of a component, nor a minimal set. These patches don't bring us fully to a minimal set, but bring us closer. I honestly don't think we need to enforce either case - so long as we have all dependencies either explicilty or via recursive dependency, things are fine.

/Bruce

#19 lore raw

v3 cover record and rework component dependencies

In reply to Bruce Richardson

As part of the meson build, we can record the dependencies for each component as we process it, logging them to a file. This file can be used as input to a number of other scripts and tools, for example, to graph the dependencies, or to allow higher-level build-config tools to automatically enable component requirements, etc.

The first patch of this set separates dependencies inside meson into optional or mandatory. The second patch of this set generates the basic dependency tree. The third patch does some processing of that dependency tree to identify cases where dependencies are being unnecessarily specified. Reducing these makes it easier to have readable dependency graphs in future, without affecting the build.

The following 4 patches are based on the output of the second patch, and greatly cut down the number of direct dependency links between components. Even with the cut-down dependencies, the full dependency graph is nigh-unreadable, so the final patch adds a new script to generate dependency tree subgraphs, creating dot files for e.g. the dependencies of a particular component, or a component class such as mempool drivers.

v2 -> v3:
- Split dependencies into optional and mandatory
- Fixup graph scripts to read and generate graphs that encode optional dependencies into the graph
- Python version fixes to avoid using features not available in minimum supported Python version
- Formatting with Ruff, and PEP-484 compliance

Anatoly Burakov (1):
build: split dependencies into mandatory and optional

Bruce Richardson (7):
build: output a dependency log in build directory
devtools: add script to flag unneeded dependencies
build: remove kvargs from driver class dependencies
build: reduce library dependencies
build: reduce driver dependencies
build: reduce app dependencies
devtools: add script to generate DPDK dependency graphs

 app/dumpcap/meson.build                    |   2 +-
 app/graph/meson.build                      |   2 +-
 app/meson.build                            |  11 +-
 app/pdump/meson.build                      |   2 +-
 app/proc-info/meson.build                  |   4 +-
 app/test-bbdev/meson.build                 |   8 +-
 app/test-crypto-perf/meson.build           |   4 +-
 app/test-fib/meson.build                   |   2 +-
 app/test-pmd/meson.build                   |  26 +--
 app/test-sad/meson.build                   |   2 +-
 app/test/meson.build                       |  14 +-
 buildtools/log-deps.py                     |  81 ++++++++
 buildtools/meson.build                     |   2 +
 devtools/draw-dependency-graphs.py         | 223 +++++++++++++++++++++
 devtools/find-duplicate-deps.py            |  53 +++++
 drivers/baseband/fpga_5gnr_fec/meson.build |   2 +-
 drivers/baseband/fpga_lte_fec/meson.build  |   2 +-
 drivers/baseband/la12xx/meson.build        |   2 +-
 drivers/baseband/null/meson.build          |   2 +-
 drivers/baseband/turbo_sw/meson.build      |   2 +-
 drivers/bus/auxiliary/meson.build          |   2 -
 drivers/bus/dpaa/meson.build               |   2 +-
 drivers/bus/fslmc/meson.build              |   2 +-
 drivers/bus/ifpga/meson.build              |   2 +-
 drivers/bus/pci/meson.build                |   4 +-
 drivers/bus/platform/meson.build           |   1 -
 drivers/bus/uacce/meson.build              |   2 -
 drivers/bus/vdev/meson.build               |   2 -
 drivers/common/cnxk/meson.build            |   4 +-
 drivers/common/cpt/meson.build             |   2 +-
 drivers/common/idpf/meson.build            |   2 +-
 drivers/common/mlx5/meson.build            |   2 +-
 drivers/compress/mlx5/meson.build          |   2 +-
 drivers/compress/nitrox/meson.build        |   2 +-
 drivers/compress/octeontx/meson.build      |   2 +-
 drivers/crypto/bcmfs/meson.build           |   2 +-
 drivers/crypto/cnxk/meson.build            |   2 +-
 drivers/crypto/dpaa_sec/meson.build        |   2 +-
 drivers/crypto/ipsec_mb/meson.build        |   2 +-
 drivers/crypto/mlx5/meson.build            |   2 +-
 drivers/crypto/nitrox/meson.build          |   2 +-
 drivers/dma/cnxk/meson.build               |   2 +-
 drivers/dma/dpaa/meson.build               |   2 +-
 drivers/dma/dpaa2/meson.build              |   2 +-
 drivers/dma/odm/meson.build                |   2 +-
 drivers/dma/skeleton/meson.build           |   2 +-
 drivers/event/cnxk/meson.build             |   2 +-
 drivers/event/dlb2/meson.build             |   2 +-
 drivers/event/dpaa2/meson.build            |   2 +-
 drivers/event/meson.build                  |   2 +-
 drivers/event/octeontx/meson.build         |   3 +-
 drivers/event/sw/meson.build               |   2 +-
 drivers/mempool/cnxk/meson.build           |   2 +-
 drivers/mempool/dpaa/meson.build           |   2 +-
 drivers/mempool/dpaa2/meson.build          |   2 +-
 drivers/mempool/octeontx/meson.build       |   2 +-
 drivers/meson.build                        |   9 +-
 drivers/net/cnxk/meson.build               |   3 +-
 drivers/net/iavf/meson.build               |   2 +-
 drivers/net/ice/meson.build                |   2 +-
 drivers/net/mana/meson.build               |   2 +-
 drivers/net/meson.build                    |   2 +-
 drivers/net/mlx5/meson.build               |   2 +-
 drivers/net/sfc/meson.build                |   2 +-
 drivers/net/softnic/meson.build            |   2 +-
 drivers/raw/cnxk_bphy/meson.build          |   2 +-
 drivers/raw/cnxk_gpio/meson.build          |   2 +-
 drivers/raw/ntb/meson.build                |   2 +-
 drivers/raw/skeleton/meson.build           |   2 +-
 drivers/regex/meson.build                  |   2 +-
 drivers/regex/mlx5/meson.build             |   2 +-
 drivers/vdpa/ifc/meson.build               |   2 +-
 drivers/vdpa/meson.build                   |   3 +-
 drivers/vdpa/mlx5/meson.build              |   2 +-
 drivers/vdpa/sfc/meson.build               |   2 +-
 examples/ethtool/meson.build               |   2 +-
 examples/l2fwd-crypto/meson.build          |   2 +-
 examples/l3fwd/meson.build                 |   2 +-
 examples/meson.build                       |  11 +-
 examples/vm_power_manager/meson.build      |   6 +-
 lib/argparse/meson.build                   |   2 +-
 lib/bbdev/meson.build                      |   2 +-
 lib/bitratestats/meson.build               |   2 +-
 lib/bpf/meson.build                        |   2 +-
 lib/cmdline/meson.build                    |   2 +-
 lib/compressdev/meson.build                |   2 +-
 lib/cryptodev/meson.build                  |   2 +-
 lib/dispatcher/meson.build                 |   2 +-
 lib/distributor/meson.build                |   2 +-
 lib/dmadev/meson.build                     |   2 -
 lib/eal/meson.build                        |   5 +-
 lib/efd/meson.build                        |   2 +-
 lib/ethdev/meson.build                     |   2 +-
 lib/eventdev/meson.build                   |   3 +-
 lib/fib/meson.build                        |   2 +-
 lib/gpudev/meson.build                     |   2 +-
 lib/graph/meson.build                      |   2 +-
 lib/gro/meson.build                        |   2 +-
 lib/gso/meson.build                        |   2 +-
 lib/hash/meson.build                       |   4 +-
 lib/ip_frag/meson.build                    |   2 +-
 lib/ipsec/meson.build                      |   2 +-
 lib/kvargs/meson.build                     |   2 +-
 lib/latencystats/meson.build               |   2 +-
 lib/lpm/meson.build                        |   3 +-
 lib/mbuf/meson.build                       |   2 +-
 lib/member/meson.build                     |   2 +-
 lib/mempool/meson.build                    |   2 +-
 lib/meson.build                            |   8 +-
 lib/metrics/meson.build                    |   2 +-
 lib/mldev/meson.build                      |   2 +-
 lib/net/meson.build                        |   2 +-
 lib/node/meson.build                       |   2 +-
 lib/pcapng/meson.build                     |   2 +-
 lib/pdcp/meson.build                       |   2 +-
 lib/pdump/meson.build                      |   2 +-
 lib/pipeline/meson.build                   |   2 +-
 lib/port/meson.build                       |   2 +-
 lib/power/meson.build                      |   2 +-
 lib/rawdev/meson.build                     |   2 -
 lib/rcu/meson.build                        |   2 +-
 lib/regexdev/meson.build                   |   2 +-
 lib/reorder/meson.build                    |   2 +-
 lib/rib/meson.build                        |   2 +-
 lib/ring/meson.build                       |   1 -
 lib/sched/meson.build                      |   2 +-
 lib/security/meson.build                   |   2 +-
 lib/table/meson.build                      |   2 +-
 lib/telemetry/meson.build                  |   2 +-
 lib/vhost/meson.build                      |   2 +-
 130 files changed, 533 insertions(+), 171 deletions(-)
 create mode 100644 buildtools/log-deps.py
 create mode 100755 devtools/draw-dependency-graphs.py
 create mode 100755 devtools/find-duplicate-deps.py
Signature · 1 line
2.43.5
#20 lore raw

PATCH v3 1/8 build: split dependencies into mandatory and optional

Allow specifying dependencies as either mandatory or optional. This does not change anything about the build, but it is useful for tooling to know if a dependency is required or not.

---
 app/meson.build                       |  3 ++-
 app/proc-info/meson.build             |  2 +-
 app/test-bbdev/meson.build            |  8 ++++----
 app/test-crypto-perf/meson.build      |  2 +-
 app/test-pmd/meson.build              | 26 +++++++++++++-------------
 app/test/meson.build                  | 12 ++++++------
 drivers/meson.build                   |  3 ++-
 examples/ethtool/meson.build          |  2 +-
 examples/l2fwd-crypto/meson.build     |  2 +-
 examples/l3fwd/meson.build            |  2 +-
 examples/meson.build                  |  3 ++-
 examples/vm_power_manager/meson.build |  6 +++---
 lib/meson.build                       |  3 ++-
 13 files changed, 39 insertions(+), 35 deletions(-)
app/meson.build +2 -1
index 5b2c80c7a1..1c61cd862c 100644
@@ -65,6 +65,7 @@ foreach app:apps
     # external package/library requirements
     ext_deps = []
     deps = []
+    optional_deps = []
 
     if not enable_apps.contains(app)
         build = false
@@ -84,7 +85,7 @@ foreach app:apps
 
     if build
         dep_objs = []
-        foreach d:deps
+        foreach d:deps + optional_deps
             var_name = get_option('default_library') + '_rte_' + d
             if not is_variable(var_name)
                 build = false
app/proc-info/meson.build +1 -1
index 4f83f29a64..156592119b 100644
@@ -10,5 +10,5 @@ endif
 sources = files('main.c')
 deps += ['ethdev', 'security', 'eventdev']
 if dpdk_conf.has('RTE_LIB_METRICS')
-    deps += 'metrics'
+    optional_deps += 'metrics'
 endif
app/test-bbdev/meson.build +4 -4
index 926e0a5271..c26e46a987 100644
@@ -15,14 +15,14 @@ sources = files(
 )
 deps += ['bbdev', 'bus_vdev']
 if dpdk_conf.has('RTE_BASEBAND_FPGA_LTE_FEC')
-    deps += ['baseband_fpga_lte_fec']
+    optional_deps += ['baseband_fpga_lte_fec']
 endif
 if dpdk_conf.has('RTE_BASEBAND_FPGA_5GNR_FEC')
-    deps += ['baseband_fpga_5gnr_fec']
+    optional_deps += ['baseband_fpga_5gnr_fec']
 endif
 if dpdk_conf.has('RTE_BASEBAND_ACC')
-    deps += ['baseband_acc']
+    optional_deps += ['baseband_acc']
 endif
 if dpdk_conf.has('RTE_BASEBAND_LA12XX')
-    deps += ['baseband_la12xx']
+    optional_deps += ['baseband_la12xx']
 endif
app/test-crypto-perf/meson.build +1 -1
index 7b02b518f0..05c71e0a0c 100644
@@ -21,5 +21,5 @@ sources = files(
 )
 deps += ['cryptodev', 'net', 'security']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
+    optional_deps += 'crypto_scheduler'
 endif
app/test-pmd/meson.build +13 -13
index 719f875be0..5559829e09 100644
@@ -36,44 +36,44 @@ endif
 
 deps += ['ethdev', 'cmdline']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
+    optional_deps += 'crypto_scheduler'
 endif
 if dpdk_conf.has('RTE_LIB_BITRATESTATS')
-    deps += 'bitratestats'
+    optional_deps += 'bitratestats'
 endif
 if dpdk_conf.has('RTE_LIB_BPF')
     sources += files('bpf_cmd.c')
-    deps += 'bpf'
+    optional_deps += 'bpf'
 endif
 if dpdk_conf.has('RTE_LIB_GRO')
-    deps += 'gro'
+    optional_deps += 'gro'
 endif
 if dpdk_conf.has('RTE_LIB_GSO')
-    deps += 'gso'
+    optional_deps += 'gso'
 endif
 if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
-    deps += 'latencystats'
+    optional_deps += 'latencystats'
 endif
 if dpdk_conf.has('RTE_LIB_METRICS')
-    deps += 'metrics'
+    optional_deps += 'metrics'
 endif
 if dpdk_conf.has('RTE_LIB_PDUMP')
-    deps += 'pdump'
+    optional_deps += 'pdump'
 endif
 if dpdk_conf.has('RTE_NET_BNXT')
-    deps += 'net_bnxt'
+    optional_deps += 'net_bnxt'
 endif
 if dpdk_conf.has('RTE_NET_I40E')
-    deps += 'net_i40e'
+    optional_deps += 'net_i40e'
 endif
 if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += 'net_ixgbe'
+    optional_deps += 'net_ixgbe'
 endif
 if dpdk_conf.has('RTE_NET_DPAA')
-    deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa']
+    optional_deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa']
 endif
 
 # Driver-specific commands are located in driver directories.
 includes = include_directories('.')
 sources += testpmd_drivers_sources
-deps += testpmd_drivers_deps
+optional_deps += testpmd_drivers_deps
app/test/meson.build +6 -6
index e29258e6ec..bb0a38b3a5 100644
@@ -7,7 +7,7 @@ sources += files('commands.c', 'test.c')
 
 # optional dependencies: some files may use these - and so we should link them in -
 # but do not explicitly require them so they are not listed in the per-file lists below
-optional_deps = ['crypto_scheduler', 'lpm']
+opt_deps = ['crypto_scheduler', 'lpm']
 
 # some other utility C files, providing functions used by various tests
 # so we need to include these deps in the dependency list for the files using those fns.
@@ -217,8 +217,8 @@ foreach f, f_deps : source_file_deps
             break
         else
             # technically we might not need this dep, but adding it is harmless
-            if d not in deps
-                deps += d
+            if d not in optional_deps
+                optional_deps += d
             endif
         endif
     endforeach
@@ -239,9 +239,9 @@ foreach f, f_deps : source_file_deps
     endif
 endforeach
 # add the optional dependencies
-foreach d:optional_deps
-    if is_variable(def_lib + '_rte_' + d) and d not in deps
-        deps += d
+foreach d:opt_deps
+    if is_variable(def_lib + '_rte_' + d) and d not in optional_deps
+        optional_deps += d
     endif
 endforeach
 
drivers/meson.build +2 -1
index 66931d4241..b9a18a5986 100644
@@ -128,6 +128,7 @@ foreach subpath:subdirs
         includes = [include_directories(drv_path)]
         # set up internal deps. Drivers can append/override as necessary
         deps = std_deps
+        optional_deps = []
         # ext_deps: Stores external library dependency got
         # using dependency() (preferred) or find_library().
         # For the find_library() case (but not with dependency()) we also
@@ -169,7 +170,7 @@ foreach subpath:subdirs
             # get dependency objs from strings
             shared_deps = ext_deps
             static_deps = ext_deps
-            foreach d:deps
+            foreach d:deps + optional_deps
                 if not build
                     break
                 endif
examples/ethtool/meson.build +1 -1
index d7f63d48af..e8638a8607 100644
@@ -20,7 +20,7 @@ includes = include_directories('lib', 'ethtool-app')
 
 deps += 'bus_pci'
 if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += 'net_ixgbe'
+    optional_deps += 'net_ixgbe'
 endif
 
 allow_experimental_apis = true
examples/l2fwd-crypto/meson.build +1 -1
index bb44c88882..f16ebadc74 100644
@@ -8,7 +8,7 @@
 
 deps += 'cryptodev'
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
+    optional_deps += 'crypto_scheduler'
 endif
 allow_experimental_apis = true
 sources = files(
examples/l3fwd/meson.build +1 -1
index c25de77bba..5938452607 100644
@@ -19,5 +19,5 @@ sources = files(
         'main.c',
 )
 if dpdk_conf.has('RTE_LIB_EVENTDEV')
-    deps += 'eventdev'
+    optional_deps += 'eventdev'
 endif
examples/meson.build +2 -1
index 8e8968a1fa..82151d09b4 100644
@@ -98,11 +98,12 @@ foreach example: examples
     ext_deps = []
     includes = [include_directories(example, 'common')]
     deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
+    optional_deps = []
     subdir(example)
 
     if build
         dep_objs = ext_deps
-        foreach d:deps
+        foreach d:deps + optional_deps
             var_name = get_option('default_library') + '_rte_' + d
             if not is_variable(var_name)
                 build = false
examples/vm_power_manager/meson.build +3 -3
index b866d8fd54..25e5bcb71b 100644
@@ -9,15 +9,15 @@
 deps += ['power']
 
 if dpdk_conf.has('RTE_NET_BNXT')
-    deps += ['net_bnxt']
+    optional_deps += ['net_bnxt']
 endif
 
 if dpdk_conf.has('RTE_NET_I40E')
-    deps += ['net_i40e']
+    optional_deps += ['net_i40e']
 endif
 
 if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += ['net_ixgbe']
+    optional_deps += ['net_ixgbe']
 endif
 
 allow_experimental_apis = true
lib/meson.build +2 -1
index 162287753f..7916deadd9 100644
@@ -134,6 +134,7 @@ foreach l:libraries
     # external package/library requirements
     ext_deps = []
     deps = []
+    optional_deps = []
     # eal is standard dependency once built
     if dpdk_conf.has('RTE_LIB_EAL')
         deps += ['eal']
@@ -171,7 +172,7 @@ foreach l:libraries
 
     shared_deps = ext_deps
     static_deps = ext_deps
-    foreach d:deps
+    foreach d:deps + optional_deps
         if not build
             break
         endif
Signature · 1 line
2.43.5
#21 lore raw

Re: [PATCH v3 1/8] build: split dependencies into mandatory and optional

Quoted 4 lines · Anatoly Burakov

Allow specifying dependencies as either mandatory or optional. This does not change anything about the build, but it is useful for tooling to know if a dependency is required or not.

Ideally we probably want to merge the support in this patch with the idea expressed in [1]

/Bruce

[1] https://patches.dpdk.org/project/dpdk/patch/[email protected]/

Quoted 305 lines
---
 app/meson.build                       |  3 ++-
 app/proc-info/meson.build             |  2 +-
 app/test-bbdev/meson.build            |  8 ++++----
 app/test-crypto-perf/meson.build      |  2 +-
 app/test-pmd/meson.build              | 26 +++++++++++++-------------
 app/test/meson.build                  | 12 ++++++------
 drivers/meson.build                   |  3 ++-
 examples/ethtool/meson.build          |  2 +-
 examples/l2fwd-crypto/meson.build     |  2 +-
 examples/l3fwd/meson.build            |  2 +-
 examples/meson.build                  |  3 ++-
 examples/vm_power_manager/meson.build |  6 +++---
 lib/meson.build                       |  3 ++-
 13 files changed, 39 insertions(+), 35 deletions(-)
app/meson.build +2 -1
index 5b2c80c7a1..1c61cd862c 100644
@@ -65,6 +65,7 @@ foreach app:apps
     # external package/library requirements
     ext_deps = []
     deps = []
+    optional_deps = []
 
     if not enable_apps.contains(app)
         build = false
@@ -84,7 +85,7 @@ foreach app:apps
 
     if build
         dep_objs = []
-        foreach d:deps
+        foreach d:deps + optional_deps
             var_name = get_option('default_library') + '_rte_' + d
             if not is_variable(var_name)
                 build = false
app/proc-info/meson.build +1 -1
index 4f83f29a64..156592119b 100644
@@ -10,5 +10,5 @@ endif
 sources = files('main.c')
 deps += ['ethdev', 'security', 'eventdev']
 if dpdk_conf.has('RTE_LIB_METRICS')
-    deps += 'metrics'
+    optional_deps += 'metrics'
 endif
app/test-bbdev/meson.build +4 -4
index 926e0a5271..c26e46a987 100644
@@ -15,14 +15,14 @@ sources = files(
 )
 deps += ['bbdev', 'bus_vdev']
 if dpdk_conf.has('RTE_BASEBAND_FPGA_LTE_FEC')
-    deps += ['baseband_fpga_lte_fec']
+    optional_deps += ['baseband_fpga_lte_fec']
 endif
 if dpdk_conf.has('RTE_BASEBAND_FPGA_5GNR_FEC')
-    deps += ['baseband_fpga_5gnr_fec']
+    optional_deps += ['baseband_fpga_5gnr_fec']
 endif
 if dpdk_conf.has('RTE_BASEBAND_ACC')
-    deps += ['baseband_acc']
+    optional_deps += ['baseband_acc']
 endif
 if dpdk_conf.has('RTE_BASEBAND_LA12XX')
-    deps += ['baseband_la12xx']
+    optional_deps += ['baseband_la12xx']
 endif
app/test-crypto-perf/meson.build +1 -1
index 7b02b518f0..05c71e0a0c 100644
@@ -21,5 +21,5 @@ sources = files(
 )
 deps += ['cryptodev', 'net', 'security']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
+    optional_deps += 'crypto_scheduler'
 endif
app/test-pmd/meson.build +13 -13
index 719f875be0..5559829e09 100644
@@ -36,44 +36,44 @@ endif
 
 deps += ['ethdev', 'cmdline']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
+    optional_deps += 'crypto_scheduler'
 endif
 if dpdk_conf.has('RTE_LIB_BITRATESTATS')
-    deps += 'bitratestats'
+    optional_deps += 'bitratestats'
 endif
 if dpdk_conf.has('RTE_LIB_BPF')
     sources += files('bpf_cmd.c')
-    deps += 'bpf'
+    optional_deps += 'bpf'
 endif
 if dpdk_conf.has('RTE_LIB_GRO')
-    deps += 'gro'
+    optional_deps += 'gro'
 endif
 if dpdk_conf.has('RTE_LIB_GSO')
-    deps += 'gso'
+    optional_deps += 'gso'
 endif
 if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
-    deps += 'latencystats'
+    optional_deps += 'latencystats'
 endif
 if dpdk_conf.has('RTE_LIB_METRICS')
-    deps += 'metrics'
+    optional_deps += 'metrics'
 endif
 if dpdk_conf.has('RTE_LIB_PDUMP')
-    deps += 'pdump'
+    optional_deps += 'pdump'
 endif
 if dpdk_conf.has('RTE_NET_BNXT')
-    deps += 'net_bnxt'
+    optional_deps += 'net_bnxt'
 endif
 if dpdk_conf.has('RTE_NET_I40E')
-    deps += 'net_i40e'
+    optional_deps += 'net_i40e'
 endif
 if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += 'net_ixgbe'
+    optional_deps += 'net_ixgbe'
 endif
 if dpdk_conf.has('RTE_NET_DPAA')
-    deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa']
+    optional_deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa']
 endif
 
 # Driver-specific commands are located in driver directories.
 includes = include_directories('.')
 sources += testpmd_drivers_sources
-deps += testpmd_drivers_deps
+optional_deps += testpmd_drivers_deps
app/test/meson.build +6 -6
index e29258e6ec..bb0a38b3a5 100644
@@ -7,7 +7,7 @@ sources += files('commands.c', 'test.c')
 
 # optional dependencies: some files may use these - and so we should link them in -
 # but do not explicitly require them so they are not listed in the per-file lists below
-optional_deps = ['crypto_scheduler', 'lpm']
+opt_deps = ['crypto_scheduler', 'lpm']
 
 # some other utility C files, providing functions used by various tests
 # so we need to include these deps in the dependency list for the files using those fns.
@@ -217,8 +217,8 @@ foreach f, f_deps : source_file_deps
             break
         else
             # technically we might not need this dep, but adding it is harmless
-            if d not in deps
-                deps += d
+            if d not in optional_deps
+                optional_deps += d
             endif
         endif
     endforeach
@@ -239,9 +239,9 @@ foreach f, f_deps : source_file_deps
     endif
 endforeach
 # add the optional dependencies
-foreach d:optional_deps
-    if is_variable(def_lib + '_rte_' + d) and d not in deps
-        deps += d
+foreach d:opt_deps
+    if is_variable(def_lib + '_rte_' + d) and d not in optional_deps
+        optional_deps += d
     endif
 endforeach
 
drivers/meson.build +2 -1
index 66931d4241..b9a18a5986 100644
@@ -128,6 +128,7 @@ foreach subpath:subdirs
         includes = [include_directories(drv_path)]
         # set up internal deps. Drivers can append/override as necessary
         deps = std_deps
+        optional_deps = []
         # ext_deps: Stores external library dependency got
         # using dependency() (preferred) or find_library().
         # For the find_library() case (but not with dependency()) we also
@@ -169,7 +170,7 @@ foreach subpath:subdirs
             # get dependency objs from strings
             shared_deps = ext_deps
             static_deps = ext_deps
-            foreach d:deps
+            foreach d:deps + optional_deps
                 if not build
                     break
                 endif
examples/ethtool/meson.build +1 -1
index d7f63d48af..e8638a8607 100644
@@ -20,7 +20,7 @@ includes = include_directories('lib', 'ethtool-app')
 
 deps += 'bus_pci'
 if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += 'net_ixgbe'
+    optional_deps += 'net_ixgbe'
 endif
 
 allow_experimental_apis = true
examples/l2fwd-crypto/meson.build +1 -1
index bb44c88882..f16ebadc74 100644
@@ -8,7 +8,7 @@
 
 deps += 'cryptodev'
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
+    optional_deps += 'crypto_scheduler'
 endif
 allow_experimental_apis = true
 sources = files(
examples/l3fwd/meson.build +1 -1
index c25de77bba..5938452607 100644
@@ -19,5 +19,5 @@ sources = files(
         'main.c',
 )
 if dpdk_conf.has('RTE_LIB_EVENTDEV')
-    deps += 'eventdev'
+    optional_deps += 'eventdev'
 endif
examples/meson.build +2 -1
index 8e8968a1fa..82151d09b4 100644
@@ -98,11 +98,12 @@ foreach example: examples
     ext_deps = []
     includes = [include_directories(example, 'common')]
     deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
+    optional_deps = []
     subdir(example)
 
     if build
         dep_objs = ext_deps
-        foreach d:deps
+        foreach d:deps + optional_deps
             var_name = get_option('default_library') + '_rte_' + d
             if not is_variable(var_name)
                 build = false
examples/vm_power_manager/meson.build +3 -3
index b866d8fd54..25e5bcb71b 100644
@@ -9,15 +9,15 @@
 deps += ['power']
 
 if dpdk_conf.has('RTE_NET_BNXT')
-    deps += ['net_bnxt']
+    optional_deps += ['net_bnxt']
 endif
 
 if dpdk_conf.has('RTE_NET_I40E')
-    deps += ['net_i40e']
+    optional_deps += ['net_i40e']
 endif
 
 if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += ['net_ixgbe']
+    optional_deps += ['net_ixgbe']
 endif
 
 allow_experimental_apis = true
lib/meson.build +2 -1
index 162287753f..7916deadd9 100644
@@ -134,6 +134,7 @@ foreach l:libraries
     # external package/library requirements
     ext_deps = []
     deps = []
+    optional_deps = []
     # eal is standard dependency once built
     if dpdk_conf.has('RTE_LIB_EAL')
         deps += ['eal']
@@ -171,7 +172,7 @@ foreach l:libraries
 
     shared_deps = ext_deps
     static_deps = ext_deps
-    foreach d:deps
+    foreach d:deps + optional_deps
         if not build
             break
         endif
Signature · 1 line
2.43.5
#22 lore raw

Re: [PATCH v3 1/8] build: split dependencies into mandatory and optional

Quoted 6 lines · Bruce Richardson
Quoted 4 lines · Anatoly Burakov

Allow specifying dependencies as either mandatory or optional. This does not change anything about the build, but it is useful for tooling to know if a dependency is required or not.

Quoted 6 lines

Ideally we probably want to merge the support in this patch with the idea expressed in [1]

/Bruce

[1] https://patches.dpdk.org/project/dpdk/patch/[email protected]/

Hi Bruce,

Please correct me if I'm wrong, but doesn't it essentially do the same thing? You're adding a new loop over optional deps, while I'm simply extending existing loop to iterate over deps + optional deps, which would achieve the same thing?

What does that patch do that this patch doesn't?

Signature · 2 lines
Thanks,
Anatoly
#23 lore raw

Re: [PATCH v3 1/8] build: split dependencies into mandatory and optional

Quoted 14 lines · Anatoly
Quoted 6 lines · Bruce Richardson
Quoted 4 lines · Anatoly Burakov

Allow specifying dependencies as either mandatory or optional. This does not change anything about the build, but it is useful for tooling to know if a dependency is required or not.

Quoted 6 lines

Ideally we probably want to merge the support in this patch with the idea expressed in [1]

/Bruce

[1] https://patches.dpdk.org/project/dpdk/patch/[email protected]/

Quoted 9 lines

Hi Bruce,

Please correct me if I'm wrong, but doesn't it essentially do the same thing? You're adding a new loop over optional deps, while I'm simply extending existing loop to iterate over deps + optional deps, which would achieve the same thing?

What does that patch do that this patch doesn't?

Your patch categorises the dependencies into optional and mandatory but doesn't actually change any code flow logic. My patch doesn't do the classification changes in the individual components, but changes the higher level meson.build file to do the checks for optional dependencies and only add them if they are present. That is, it removes the need for individual components to check for the optional deps themselves and add them if found.

/Bruce

#24 lore raw

PATCH v3 2/8 build: output a dependency log in build directory

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

As meson processes our DPDK source tree it manages dependencies specified by each individual driver. To enable future analysis of the dependency links between components, log the dependencies of each DPDK component as it gets processed. This could potentially allow other tools to automatically enable or disable components based on the desired end components to be built, e.g. if the user requests net/ice, ensure that common/iavf is also enabled in the drivers.

The output file produced is in "dot" or "graphviz" format, which allows producing a graphical representation of the DPDK dependency tree if so desired. For example: "dot -Tpng -O build/deps.dot" to produce the image file "build/deps.dot.png".

---
 app/meson.build        |  8 ++++-
 buildtools/log-deps.py | 81 ++++++++++++++++++++++++++++++++++++++++++
 buildtools/meson.build |  2 ++
 drivers/meson.build    |  6 ++++
 examples/meson.build   |  8 ++++-
 lib/meson.build        |  5 +++
 6 files changed, 108 insertions(+), 2 deletions(-)
 create mode 100644 buildtools/log-deps.py
app/meson.build +7 -1
index 1c61cd862c..55a1f076cd 100644
@@ -75,8 +75,14 @@ foreach app:apps
         reason = 'explicitly disabled via build config'
     endif
 
+    app_name = 'dpdk-' + name
     if build
         subdir(name)
+        type_cmd = '--type=app'
+        run_command([log_deps_cmd, type_cmd, app_name, deps], check: false)
+        if optional_deps.length() > 0
+            run_command([log_deps_cmd, '--optional', type_cmd, app_name, optional_deps], check: false)
+        endif
         if not build and require_apps
             error('Cannot build explicitly requested app "@0@".\n'.format(name)
                   + '\tReason: ' + reason)
@@ -115,7 +121,7 @@ foreach app:apps
         link_libs = dpdk_static_libraries + dpdk_drivers
     endif
 
-    exec = executable('dpdk-' + name,
+    exec = executable(app_name,
             sources,
             c_args: cflags,
             link_args: ldflags,
buildtools/log-deps.py new file +81 -0

81 lines not on this page · raw message

buildtools/meson.build +2 -0
index 3adf34e1a8..e2ba9d0ad4 100644
@@ -24,6 +24,8 @@ get_numa_count_cmd = py3 + files('get-numa-count.py')
 get_test_suites_cmd = py3 + files('get-test-suites.py')
 has_hugepages_cmd = py3 + files('has-hugepages.py')
 cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py')
+log_deps_cmd = py3 + files('log-deps.py')
+run_command(log_deps_cmd, check: false)  # call with no parameters to reset the file
 
 # install any build tools that end-users might want also
 install_data([
drivers/meson.build +6 -0
index b9a18a5986..32c9e3f88a 100644
@@ -155,6 +155,12 @@ foreach subpath:subdirs
         if build
             # pull in driver directory which should update all the local variables
             subdir(drv_path)
+            type_cmd = '--type=drivers'
+            drv_name = class + '_' + name
+            run_command([log_deps_cmd, type_cmd, drv_name, deps], check: false)
+            if optional_deps.length() > 0
+                run_command([log_deps_cmd, '--optional', type_cmd, drv_name, optional_deps], check: false)
+            endif
 
             if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0 and require_iova_in_mbuf
                 build = false
examples/meson.build +7 -1
index 82151d09b4..1589a3057e 100644
@@ -101,8 +101,14 @@ foreach example: examples
     optional_deps = []
     subdir(example)
 
+    example_name = 'dpdk-' + name
     if build
         dep_objs = ext_deps
+        type_cmd = '--type=examples'
+        run_command([log_deps_cmd, type_cmd, example_name, deps], check: false)
+        if optional_deps.length() > 0
+            run_command([log_deps_cmd, '--optional', type_cmd, example_name, optional_deps], check: false)
+        endif
         foreach d:deps + optional_deps
             var_name = get_option('default_library') + '_rte_' + d
             if not is_variable(var_name)
@@ -125,7 +131,7 @@ foreach example: examples
     if allow_experimental_apis
         cflags += '-DALLOW_EXPERIMENTAL_API'
     endif
-    executable('dpdk-' + name, sources,
+    executable(example_name, sources,
             include_directories: includes,
             link_whole: link_whole_libs,
             link_args: ldflags,
lib/meson.build +5 -0
index 7916deadd9..f2ac800f5a 100644
@@ -161,6 +161,11 @@ foreach l:libraries
 
     if build
         subdir(l)
+        type_cmd = '--type=lib'
+        run_command([log_deps_cmd, type_cmd, l, deps], check: false)
+        if optional_deps.length() > 0
+            run_command([log_deps_cmd, '--optional', type_cmd, l, optional_deps], check: false)
+        endif
         if not build and require_libs
             error('Cannot build explicitly requested lib "@0@".\n'.format(name)
                     +'\tReason: ' + reason)
Signature · 1 line
2.43.5
#25 lore raw

PATCH v3 3/8 devtools: add script to flag unneeded dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

While not a serious problem, DPDK components often list more dependencies than are actually necessary to build, due to the use of recursive dependencies. In extreme cases, such as with core libraries, this can lead to longer configuration times due to meson having to deduplicate long lists of dependencies. Therefore we can add a script to identify when a component has got unnecessary dependencies listed.

---
 devtools/find-duplicate-deps.py | 53 +++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100755 devtools/find-duplicate-deps.py
devtools/find-duplicate-deps.py new file +53 -0
new file mode 100755
index 0000000000..b1eacf21ce
@@ -0,0 +1,53 @@
+#! /usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 Intel Corporation
+
+"""Identify any superfluous dependencies listed in DPDK deps graph."""
+
+import sys
+
+all_deps = {}
+
+
+class dep:
+    """Holds a component and its dependencies."""
+
+    def __init__(self, name, dep_names):
+        """Create and process a component and its deps."""
+        self.name = name.strip('" ')
+        self.base_deps = [all_deps[dn.strip('" ')] for dn in dep_names]
+        self.recursive_deps = []
+        for d in self.base_deps:
+            self.recursive_deps.extend(d.base_deps)
+            self.recursive_deps.extend(d.recursive_deps)
+        self.extra_deps = []
+        for d in self.base_deps:
+            if d in self.recursive_deps:
+                self.extra_deps.append(d.name)
+        if self.extra_deps:
+            print(f'{self.name}: extra deps {self.extra_deps}')
+
+    def dict_add(self, d):
+        """Add this object to a dictionary by name."""
+        d[self.name] = self
+
+
+def main(argv):
+    """Read the dependency tree from a dot file and process it."""
+    if len(argv) != 2:
+        print(f'Usage: {argv[0]} <build-directory>/deps.dot', file=sys.stderr)
+        sys.exit(1)
+
+    with open(argv[1]) as f:
+        for ln in f.readlines():
+            ln = ln.strip()
+            if '->' in ln:
+                name, deps = ln.split('->')
+                deps = deps.strip(' {}')
+                dep(name, deps.split(',')).dict_add(all_deps)
+            elif ln.startswith('"') and ln.endswith('"'):
+                dep(ln.strip('"'), []).dict_add(all_deps)
+
+
+if __name__ == '__main__':
+    main(sys.argv)
Signature · 1 line
2.43.5
#26 lore raw

PATCH v3 4/8 build: remove kvargs from driver class dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

The kvargs library is used by EAL, and therefore is implicitly a dependency of every DPDK driver. Remove it from the minimum set of dependencies for each driver class as it's unnecessary to call it out there.

---
 drivers/event/meson.build | 2 +-
 drivers/net/meson.build   | 2 +-
 drivers/regex/meson.build | 2 +-
 drivers/vdpa/meson.build  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/event/meson.build +1 -1
index d6706b57f7..2708833adf 100644
@@ -19,4 +19,4 @@ if not (toolchain == 'gcc' and cc.version().version_compare('<4.8.6') and
         dpdk_conf.has('RTE_ARCH_ARM64'))
     drivers += 'octeontx'
 endif
-std_deps = ['eventdev', 'kvargs']
+std_deps = ['eventdev']
drivers/net/meson.build +1 -1
index fb6d34b782..ebd12364df 100644
@@ -63,6 +63,6 @@ drivers = [
         'virtio',
         'vmxnet3',
 ]
-std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
+std_deps = ['ethdev']           # 'ethdev' also pulls in mbuf, net, eal etc
 std_deps += ['bus_pci']         # very many PMDs depend on PCI, so make std
 std_deps += ['bus_vdev']        # same with vdev bus
drivers/regex/meson.build +1 -1
index ff2a8fea89..10192e7c77 100644
@@ -5,4 +5,4 @@ drivers = [
         'mlx5',
         'cn9k',
 ]
-std_deps = ['ethdev', 'kvargs', 'regexdev'] # 'ethdev' also pulls in mbuf, net, eal etc
+std_deps = ['ethdev', 'regexdev'] # 'ethdev' also pulls in mbuf, net, eal etc
drivers/vdpa/meson.build +1 -1
index 896e8e0304..e01c277b9e 100644
@@ -11,5 +11,5 @@ drivers = [
         'nfp',
         'sfc',
 ]
-std_deps = ['bus_pci', 'kvargs']
+std_deps = ['bus_pci']
 std_deps += ['vhost']
Signature · 1 line
2.43.5
#27 lore raw

PATCH v3 5/8 build: reduce library dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Rather than having each library depend up on EAL + any extra libs, we can take advantage of recursive dependency support in meson and just assign the dependencies of each directory directly, rather than appending to the array. For libraries which only depend upon EAL, keep that as a default, but for libraries which depend upon even a single extra lib, that EAL dependency is unnecessary.

Going further, we can identify using the find_duplicate_deps.py script any unnecessary deps in each library's list, and remove them to slim the dependency tree down.

Reducing number of dependencies means that meson
takes less time processing and deduplicating the dependency tree for each component, and also shrinks the dependency graph for DPDK itself.

---
 lib/argparse/meson.build     | 2 +-
 lib/bbdev/meson.build        | 2 +-
 lib/bitratestats/meson.build | 2 +-
 lib/bpf/meson.build          | 2 +-
 lib/cmdline/meson.build      | 2 +-
 lib/compressdev/meson.build  | 2 +-
 lib/cryptodev/meson.build    | 2 +-
 lib/dispatcher/meson.build   | 2 +-
 lib/distributor/meson.build  | 2 +-
 lib/dmadev/meson.build       | 2 --
 lib/eal/meson.build          | 5 +----
 lib/efd/meson.build          | 2 +-
 lib/ethdev/meson.build       | 2 +-
 lib/eventdev/meson.build     | 3 +--
 lib/fib/meson.build          | 2 +-
 lib/gpudev/meson.build       | 2 +-
 lib/graph/meson.build        | 2 +-
 lib/gro/meson.build          | 2 +-
 lib/gso/meson.build          | 2 +-
 lib/hash/meson.build         | 4 +---
 lib/ip_frag/meson.build      | 2 +-
 lib/ipsec/meson.build        | 2 +-
 lib/kvargs/meson.build       | 2 +-
 lib/latencystats/meson.build | 2 +-
 lib/lpm/meson.build          | 3 +--
 lib/mbuf/meson.build         | 2 +-
 lib/member/meson.build       | 2 +-
 lib/mempool/meson.build      | 2 +-
 lib/metrics/meson.build      | 2 +-
 lib/mldev/meson.build        | 2 +-
 lib/net/meson.build          | 2 +-
 lib/node/meson.build         | 2 +-
 lib/pcapng/meson.build       | 2 +-
 lib/pdcp/meson.build         | 2 +-
 lib/pdump/meson.build        | 2 +-
 lib/pipeline/meson.build     | 2 +-
 lib/port/meson.build         | 2 +-
 lib/power/meson.build        | 2 +-
 lib/rawdev/meson.build       | 2 --
 lib/rcu/meson.build          | 2 +-
 lib/regexdev/meson.build     | 2 +-
 lib/reorder/meson.build      | 2 +-
 lib/rib/meson.build          | 2 +-
 lib/ring/meson.build         | 1 -
 lib/sched/meson.build        | 2 +-
 lib/security/meson.build     | 2 +-
 lib/table/meson.build        | 2 +-
 lib/telemetry/meson.build    | 2 +-
 lib/vhost/meson.build        | 2 +-
 49 files changed, 46 insertions(+), 58 deletions(-)
lib/argparse/meson.build +1 -1
index 8ab4c408ee..5d602c1f2a 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_argparse.c')
 headers = files('rte_argparse.h')
 
-deps += ['log']
+deps = ['log']
lib/bbdev/meson.build +1 -1
index 07685e7578..2e68aa7873 100644
@@ -11,4 +11,4 @@ sources = files('rte_bbdev.c')
 headers = files('rte_bbdev.h',
         'rte_bbdev_pmd.h',
         'rte_bbdev_op.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/bitratestats/meson.build +1 -1
index ede7e0a579..8defcd53bf 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_bitrate.c')
 headers = files('rte_bitrate.h')
-deps += ['ethdev', 'metrics']
+deps = ['metrics']
lib/bpf/meson.build +1 -1
index aa258a9061..82127bc657 100644
@@ -31,7 +31,7 @@ headers = files('bpf_def.h',
         'rte_bpf.h',
         'rte_bpf_ethdev.h')
 
-deps += ['mbuf', 'net', 'ethdev']
+deps = ['ethdev']
 
 dep = dependency('libelf', required: false, method: 'pkg-config')
 if dep.found()
lib/cmdline/meson.build +1 -1
index 63fb69100d..4451f3da29 100644
@@ -31,4 +31,4 @@ else
     sources += files('cmdline_os_unix.c')
 endif
 
-deps += ['net']
+deps = ['net']
lib/compressdev/meson.build +1 -1
index c80295dc0d..4b86955baf 100644
@@ -16,4 +16,4 @@ driver_sdk_headers = files(
         'rte_compressdev_pmd.h',
         'rte_compressdev_internal.h',
     )
-deps += ['kvargs', 'mbuf']
+deps = ['mbuf']
lib/cryptodev/meson.build +1 -1
index 4734acf321..74e42ac700 100644
@@ -20,4 +20,4 @@ driver_sdk_headers += files(
         'cryptodev_pmd.h',
 )
 
-deps += ['kvargs', 'mbuf', 'rcu', 'telemetry']
+deps = ['mbuf', 'rcu']
lib/dispatcher/meson.build +1 -1
index ffaef26a6d..4dc1759951 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_dispatcher.c')
 headers = files('rte_dispatcher.h')
 
-deps += ['eventdev']
+deps = ['eventdev']
lib/distributor/meson.build +1 -1
index 24988c5827..ba43273bc3 100644
@@ -14,4 +14,4 @@ else
     sources += files('rte_distributor_match_generic.c')
 endif
 headers = files('rte_distributor.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/dmadev/meson.build +0 -2
index e66dcb66b0..70b375f1cb 100644
@@ -11,5 +11,3 @@ sources = files('rte_dmadev.c', 'rte_dmadev_trace_points.c')
 headers = files('rte_dmadev.h')
 indirect_headers += files('rte_dmadev_core.h', 'rte_dmadev_trace_fp.h')
 driver_sdk_headers += files('rte_dmadev_pmd.h')
-
-deps += ['telemetry']
lib/eal/meson.build +1 -4
index e1d6c4cf17..d25443d097 100644
@@ -14,10 +14,7 @@ subdir(exec_env)
 
 subdir(arch_subdir)
 
-deps += ['log', 'kvargs']
-if not is_windows
-    deps += ['telemetry']
-endif
+deps = ['kvargs', 'telemetry']
 if dpdk_conf.has('RTE_USE_LIBBSD')
     ext_deps += libbsd
 endif
lib/efd/meson.build +1 -1
index 343f14e1f3..da0ee7f803 100644
@@ -9,4 +9,4 @@ endif
 
 sources = files('rte_efd.c')
 headers = files('rte_efd.h')
-deps += ['ring', 'hash']
+deps = ['hash']
lib/ethdev/meson.build +1 -1
index f1d2586591..fc53a9c309 100644
@@ -53,7 +53,7 @@ if is_linux
     )
 endif
 
-deps += ['net', 'kvargs', 'meter', 'telemetry']
+deps = ['net', 'meter']
 
 if is_freebsd
     annotate_locks = false
lib/eventdev/meson.build +1 -2
index a04bb86f0f..237df998ce 100644
@@ -38,5 +38,4 @@ driver_sdk_headers += files(
         'event_timer_adapter_pmd.h',
 )
 
-deps += ['ring', 'ethdev', 'hash', 'mempool', 'mbuf', 'timer', 'cryptodev', 'dmadev']
-deps += ['telemetry']
+deps = ['ethdev', 'hash', 'timer', 'cryptodev', 'dmadev']
lib/fib/meson.build +1 -1
index 6795f41a0a..9ba8e50fe0 100644
@@ -10,7 +10,7 @@ endif
 
 sources = files('rte_fib.c', 'rte_fib6.c', 'dir24_8.c', 'trie.c')
 headers = files('rte_fib.h', 'rte_fib6.h')
-deps += ['rib']
+deps = ['rib']
 
 # compile AVX512 version if:
 # we are building 64-bit binary AND binutils can generate proper code
lib/gpudev/meson.build +1 -1
index d21fadc052..5d883b85a1 100644
@@ -13,4 +13,4 @@ sources = files(
         'gpudev.c',
 )
 
-deps += ['mbuf']
+deps = ['mbuf']
lib/graph/meson.build +1 -1
index 0cb15442ab..f58f107d52 100644
@@ -25,4 +25,4 @@ indirect_headers += files(
         'rte_graph_worker_common.h',
 )
 
-deps += ['eal', 'pcapng', 'mempool', 'ring']
+deps = ['pcapng']
lib/gro/meson.build +1 -1
index dbce05220d..c6de6ceebc 100644
@@ -10,4 +10,4 @@ sources = files(
         'gro_vxlan_udp4.c',
 )
 headers = files('rte_gro.h')
-deps += ['ethdev']
+deps = ['ethdev']
lib/gso/meson.build +1 -1
index 622411df8f..bc99109933 100644
@@ -10,4 +10,4 @@ sources = files(
         'rte_gso.c',
 )
 headers = files('rte_gso.h')
-deps += ['ethdev']
+deps = ['ethdev']
lib/hash/meson.build +1 -3
index 277eb9fa93..74b81397f9 100644
@@ -25,6 +25,4 @@ sources = files(
         'rte_thash_gfni.c',
 )
 
-deps += ['net']
-deps += ['ring']
-deps += ['rcu']
+deps = ['net', 'rcu']
lib/ip_frag/meson.build +1 -1
index ea2de09f75..cacf391460 100644
@@ -10,4 +10,4 @@ sources = files(
         'ip_frag_internal.c',
 )
 headers = files('rte_ip_frag.h')
-deps += ['ethdev', 'hash']
+deps = ['ethdev', 'hash']
lib/ipsec/meson.build +1 -1
index 5c5a4aae78..7abbac5b6a 100644
@@ -14,6 +14,6 @@ sources = files('esp_inb.c', 'esp_outb.c',
 headers = files('rte_ipsec.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h')
 indirect_headers += files('rte_ipsec_group.h')
 
-deps += ['mbuf', 'net', 'cryptodev', 'security', 'hash', 'telemetry']
+deps = ['security', 'hash']
 
 annotate_locks = false
lib/kvargs/meson.build +1 -1
index 7eae744a8f..7282b0ff8d 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-deps += 'log'
+deps = ['log']
 sources = files('rte_kvargs.c')
 headers = files('rte_kvargs.h')
lib/latencystats/meson.build +1 -1
index 286558dd79..f8b9a8aeec 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_latencystats.c')
 headers = files('rte_latencystats.h')
-deps += ['metrics', 'ethdev']
+deps = ['metrics']
lib/lpm/meson.build +1 -2
index ae30f80b69..5031b085c4 100644
@@ -18,5 +18,4 @@ indirect_headers += files(
         'rte_lpm_sse.h',
         'rte_lpm_sve.h',
 )
-deps += ['hash']
-deps += ['rcu']
+deps = ['hash']
lib/mbuf/meson.build +1 -1
index 2cee9057a5..22f5a3038b 100644
@@ -20,4 +20,4 @@ headers = files(
         'rte_mbuf_pool_ops.h',
         'rte_mbuf_dyn.h',
 )
-deps += ['mempool']
+deps = ['mempool']
lib/member/meson.build +1 -1
index 02ef59795e..b951aa566e 100644
@@ -16,7 +16,7 @@ sources = files(
         'rte_member_vbf.c',
 )
 
-deps += ['hash', 'ring']
+deps = ['hash']
 
 # compile AVX512 version if:
 if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
lib/mempool/meson.build +1 -1
index acce66cb97..25b26a50fa 100644
@@ -25,4 +25,4 @@ headers = files(
         'rte_mempool.h',
         'rte_mempool_trace_fp.h',
 )
-deps += ['ring', 'telemetry']
+deps = ['ring']
lib/metrics/meson.build +1 -1
index 8c1c4b4b49..5165967646 100644
@@ -8,4 +8,4 @@ if dpdk_conf.has('RTE_HAS_JANSSON')
     ext_deps += jansson_dep
 endif
 
-deps += ['ethdev', 'telemetry']
+deps = ['ethdev']
lib/mldev/meson.build +1 -1
index 2c933baad6..6069fff1f0 100644
@@ -41,7 +41,7 @@ driver_sdk_headers += files(
         'mldev_utils.h',
 )
 
-deps += ['mempool', 'mbuf']
+deps = ['mbuf']
 
 if get_option('buildtype').contains('debug')
         cflags += [ '-DRTE_LIBRTE_ML_DEV_DEBUG' ]
lib/net/meson.build +1 -1
index 0b69138949..2cb511f046 100644
@@ -34,7 +34,7 @@ sources = files(
         'rte_net.c',
         'rte_net_crc.c',
 )
-deps += ['mbuf']
+deps = ['mbuf']
 
 if dpdk_conf.has('RTE_ARCH_X86_64')
     net_crc_sse42_cpu_support = (cc.get_define('__PCLMUL__', args: machine_args) != '')
lib/node/meson.build +1 -1
index 0bed97a96c..368ce1dc63 100644
@@ -34,4 +34,4 @@ headers = files(
 
 # Strict-aliasing rules are violated by uint8_t[] to context size casts.
 cflags += '-fno-strict-aliasing'
-deps += ['graph', 'mbuf', 'lpm', 'ethdev', 'mempool', 'cryptodev', 'ip_frag']
+deps = ['graph', 'lpm', 'cryptodev', 'ip_frag']
lib/pcapng/meson.build +1 -1
index 4549925d41..e8f059a9b0 100644
@@ -4,4 +4,4 @@
 sources = files('rte_pcapng.c')
 headers = files('rte_pcapng.h')
 
-deps += ['ethdev']
+deps = ['ethdev']
lib/pdcp/meson.build +1 -1
index f4f9246bcb..f6f3d6237a 100644
@@ -18,4 +18,4 @@ sources = files(
 headers = files('rte_pdcp.h')
 indirect_headers += files('rte_pdcp_group.h')
 
-deps += ['mbuf', 'net', 'cryptodev', 'security', 'reorder']
+deps = ['security', 'reorder']
lib/pdump/meson.build +1 -1
index da8d51b616..23d7db794b 100644
@@ -9,4 +9,4 @@ endif
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev', 'bpf', 'pcapng']
+deps = ['bpf', 'pcapng']
lib/pipeline/meson.build +1 -1
index fd5e0dc6bb..f08eca70d1 100644
@@ -25,4 +25,4 @@ headers = files(
         'rte_swx_extern.h',
         'rte_swx_ctl.h',
 )
-deps += ['port', 'table', 'meter', 'sched', 'cryptodev', 'ipsec']
+deps = ['table', 'ipsec']
lib/port/meson.build +1 -1
index b597772872..0524c3c049 100644
@@ -40,7 +40,7 @@ headers = files(
         'rte_swx_port_ring.h',
         'rte_swx_port_source_sink.h',
 )
-deps += ['ethdev', 'sched', 'ip_frag', 'cryptodev', 'eventdev']
+deps = ['sched', 'ip_frag', 'eventdev']
 
 if dpdk_conf.has('RTE_HAS_LIBPCAP')
     dpdk_conf.set('RTE_PORT_PCAP', 1)
lib/power/meson.build +1 -1
index b8426589b2..190bbf90a2 100644
@@ -33,4 +33,4 @@ headers = files(
 if cc.has_argument('-Wno-cast-qual')
     cflags += '-Wno-cast-qual'
 endif
-deps += ['timer', 'ethdev']
+deps = ['timer', 'ethdev']
lib/rawdev/meson.build +0 -2
index 7dfc3d5cf9..8841f003d7 100644
@@ -9,5 +9,3 @@ endif
 
 sources = files('rte_rawdev.c')
 headers = files('rte_rawdev.h', 'rte_rawdev_pmd.h')
-
-deps += ['telemetry']
lib/rcu/meson.build +1 -1
index 71143f5210..b78f46fad7 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_rcu_qsbr.c')
 headers = files('rte_rcu_qsbr.h')
 
-deps += ['ring']
+deps = ['ring']
lib/regexdev/meson.build +1 -1
index 426e764ece..3e20fa387d 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_regexdev.c')
 headers = files('rte_regexdev.h', 'rte_regexdev_driver.h')
 indirect_headers += files('rte_regexdev_core.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/reorder/meson.build +1 -1
index 03aed53d90..1e088a7d97 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_reorder.c')
 headers = files('rte_reorder.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/rib/meson.build +1 -1
index 7bacbb4535..2085beb444 100644
@@ -4,4 +4,4 @@
 
 sources = files('rte_rib.c', 'rte_rib6.c')
 headers = files('rte_rib.h', 'rte_rib6.h')
-deps += ['mempool']
+deps = ['mempool']
lib/ring/meson.build +0 -1
index 7fca958ed7..c20685c689 100644
@@ -18,4 +18,3 @@ indirect_headers += files (
         'rte_ring_rts.h',
         'rte_ring_rts_elem_pvt.h',
 )
-deps += ['telemetry']
lib/sched/meson.build +1 -1
index df75db51ed..7ca8ec09df 100644
@@ -15,4 +15,4 @@ headers = files(
         'rte_sched_common.h',
         'rte_pie.h',
 )
-deps += ['mbuf', 'meter']
+deps = ['mbuf', 'meter']
lib/security/meson.build +1 -1
index 1034a7a299..e4545a8c72 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_security.c')
 headers = files('rte_security.h', 'rte_security_driver.h')
-deps += ['mempool', 'cryptodev', 'net']
+deps = ['cryptodev', 'net']
lib/table/meson.build +1 -1
index 9b3d9ac759..78d7e87eab 100644
@@ -39,7 +39,7 @@ headers = files(
         'rte_table_lpm_ipv6.h',
         'rte_table_stub.h',
 )
-deps += ['mbuf', 'port', 'lpm', 'hash', 'acl']
+deps = ['port', 'lpm', 'acl']
 
 indirect_headers += files(
         'rte_lru_arm64.h',
lib/telemetry/meson.build +1 -1
index 489d000047..3e3a2cfc32 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-deps += 'log'
+deps = ['log']
 sources = files('telemetry.c', 'telemetry_data.c', 'telemetry_legacy.c')
 headers = files('rte_telemetry.h')
 includes += include_directories('../metrics')
lib/vhost/meson.build +1 -1
index 41b622a9be..51bbd87397 100644
@@ -42,4 +42,4 @@ headers = files(
 driver_sdk_headers = files(
         'vdpa_driver.h',
 )
-deps += ['ethdev', 'cryptodev', 'hash', 'pci', 'dmadev']
+deps = ['ethdev', 'cryptodev', 'hash', 'pci', 'dmadev']
Signature · 1 line
2.43.5
#28 lore raw

PATCH v3 6/8 build: reduce driver dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Remove any unnecessary dependencies from the driver dependency lists. This will give each driver a near-minimum set of required dependencies.

---
 drivers/baseband/fpga_5gnr_fec/meson.build | 2 +-
 drivers/baseband/fpga_lte_fec/meson.build  | 2 +-
 drivers/baseband/la12xx/meson.build        | 2 +-
 drivers/baseband/null/meson.build          | 2 +-
 drivers/baseband/turbo_sw/meson.build      | 2 +-
 drivers/bus/auxiliary/meson.build          | 2 --
 drivers/bus/dpaa/meson.build               | 2 +-
 drivers/bus/fslmc/meson.build              | 2 +-
 drivers/bus/ifpga/meson.build              | 2 +-
 drivers/bus/pci/meson.build                | 4 +---
 drivers/bus/platform/meson.build           | 1 -
 drivers/bus/uacce/meson.build              | 2 --
 drivers/bus/vdev/meson.build               | 2 --
 drivers/common/cnxk/meson.build            | 4 ++--
 drivers/common/cpt/meson.build             | 2 +-
 drivers/common/idpf/meson.build            | 2 +-
 drivers/common/mlx5/meson.build            | 2 +-
 drivers/compress/mlx5/meson.build          | 2 +-
 drivers/compress/nitrox/meson.build        | 2 +-
 drivers/compress/octeontx/meson.build      | 2 +-
 drivers/crypto/bcmfs/meson.build           | 2 +-
 drivers/crypto/cnxk/meson.build            | 2 +-
 drivers/crypto/dpaa_sec/meson.build        | 2 +-
 drivers/crypto/ipsec_mb/meson.build        | 2 +-
 drivers/crypto/mlx5/meson.build            | 2 +-
 drivers/crypto/nitrox/meson.build          | 2 +-
 drivers/dma/cnxk/meson.build               | 2 +-
 drivers/dma/dpaa/meson.build               | 2 +-
 drivers/dma/dpaa2/meson.build              | 2 +-
 drivers/dma/odm/meson.build                | 2 +-
 drivers/dma/skeleton/meson.build           | 2 +-
 drivers/event/cnxk/meson.build             | 2 +-
 drivers/event/dlb2/meson.build             | 2 +-
 drivers/event/dpaa2/meson.build            | 2 +-
 drivers/event/octeontx/meson.build         | 3 +--
 drivers/event/sw/meson.build               | 2 +-
 drivers/mempool/cnxk/meson.build           | 2 +-
 drivers/mempool/dpaa/meson.build           | 2 +-
 drivers/mempool/dpaa2/meson.build          | 2 +-
 drivers/mempool/octeontx/meson.build       | 2 +-
 drivers/net/cnxk/meson.build               | 3 +--
 drivers/net/iavf/meson.build               | 2 +-
 drivers/net/ice/meson.build                | 2 +-
 drivers/net/mana/meson.build               | 2 +-
 drivers/net/mlx5/meson.build               | 2 +-
 drivers/net/sfc/meson.build                | 2 +-
 drivers/net/softnic/meson.build            | 2 +-
 drivers/raw/cnxk_bphy/meson.build          | 2 +-
 drivers/raw/cnxk_gpio/meson.build          | 2 +-
 drivers/raw/ntb/meson.build                | 2 +-
 drivers/raw/skeleton/meson.build           | 2 +-
 drivers/regex/mlx5/meson.build             | 2 +-
 drivers/vdpa/ifc/meson.build               | 2 +-
 drivers/vdpa/meson.build                   | 3 +--
 drivers/vdpa/mlx5/meson.build              | 2 +-
 drivers/vdpa/sfc/meson.build               | 2 +-
 56 files changed, 53 insertions(+), 65 deletions(-)
drivers/baseband/fpga_5gnr_fec/meson.build +1 -1
index c3678d23eb..31b9e92fbb 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2020 Intel Corporation
 
-deps += ['bus_vdev', 'ring', 'pci', 'bus_pci']
+deps += ['bus_vdev', 'bus_pci']
 
 sources = files('rte_fpga_5gnr_fec.c')
 
drivers/baseband/fpga_lte_fec/meson.build +1 -1
index 14e07826ef..fbf24755db 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Intel Corporation
 
-deps += ['bus_vdev', 'ring', 'pci', 'bus_pci']
+deps += ['bus_vdev', 'bus_pci']
 sources = files('fpga_lte_fec.c')
drivers/baseband/la12xx/meson.build +1 -1
index 7b7e41c961..e1dbdd0fa7 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2020-2021 NXP
 
-deps += ['bus_vdev', 'ring']
+deps += ['bus_vdev']
 
 sources = files('bbdev_la12xx.c')
drivers/baseband/null/meson.build +1 -1
index 22863f0bd8..716d6c6fdb 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <[email protected]>
 
-deps += ['bus_vdev', 'ring']
+deps += ['bus_vdev']
 sources = files('bbdev_null.c')
drivers/baseband/turbo_sw/meson.build +1 -1
index a9035a753e..ac18e8a9b6 100644
@@ -26,5 +26,5 @@ if dep_dec5g.found()
     cflags += ['-DRTE_BBDEV_SDK_AVX512']
 endif
 
-deps += ['bus_vdev', 'ring']
+deps += ['bus_vdev']
 sources = files('bbdev_turbo_software.c')
drivers/bus/auxiliary/meson.build +0 -2
index 10468fd130..a113f11743 100644
@@ -13,5 +13,3 @@ if is_linux
 endif
 
 require_iova_in_mbuf = false
-
-deps += ['kvargs']
drivers/bus/dpaa/meson.build +1 -1
index 114e0a2265..d0ae5a9ff0 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_dpaax', 'eventdev']
+deps = ['common_dpaax', 'eventdev']
 sources = files(
         'base/fman/fman.c',
         'base/fman/fman_hw.c',
drivers/bus/fslmc/meson.build +1 -1
index 162ca286fe..989a47c7a0 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_dpaax', 'eventdev', 'kvargs']
+deps = ['common_dpaax', 'eventdev']
 sources = files(
         'fslmc_bus.c',
         'fslmc_vfio.c',
drivers/bus/ifpga/meson.build +1 -1
index dedc94db2d..e87b08eaf4 100644
@@ -7,6 +7,6 @@ if is_windows
     subdir_done()
 endif
 
-deps += ['pci', 'kvargs', 'rawdev']
+deps = ['pci', 'rawdev']
 driver_sdk_headers += files('bus_ifpga_driver.h')
 sources = files('ifpga_bus.c')
drivers/bus/pci/meson.build +1 -3
index fede114dc7..776c3d1550 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-deps += ['pci']
+deps = ['pci']
 headers = files('rte_bus_pci.h')
 driver_sdk_headers = files('bus_pci_driver.h')
 sources = files('pci_common.c',
@@ -31,5 +31,3 @@ if is_windows
 endif
 
 require_iova_in_mbuf = false
-
-deps += ['kvargs']
drivers/bus/platform/meson.build +0 -1
index 8633cc4e75..2039c23ac6 100644
@@ -10,7 +10,6 @@ endif
 
 require_iova_in_mbuf = false
 
-deps += ['kvargs']
 sources = files(
         'platform_params.c',
         'platform.c',
drivers/bus/uacce/meson.build +0 -2
index a659d65f23..130148a315 100644
@@ -8,5 +8,3 @@ endif
 
 sources = files('uacce.c')
 driver_sdk_headers += files('bus_uacce_driver.h')
-
-deps += ['kvargs']
drivers/bus/vdev/meson.build +0 -2
index 50f0c8918d..24993c88a3 100644
@@ -9,5 +9,3 @@ headers = files('rte_bus_vdev.h')
 driver_sdk_headers = files('bus_vdev_driver.h')
 
 require_iova_in_mbuf = false
-
-deps += ['kvargs']
drivers/common/cnxk/meson.build +2 -2
index e0e4600989..8ff080ee19 100644
@@ -8,7 +8,7 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     subdir_done()
 endif
 
-deps = ['eal', 'pci', 'bus_pci', 'mbuf', 'security']
+deps = ['bus_pci', 'security']
 sources = files(
         'roc_ae.c',
         'roc_aes.c',
@@ -91,7 +91,7 @@ sources += files('cnxk_telemetry_bphy.c',
                  'cnxk_telemetry_sso.c',
 )
 
-deps += ['bus_pci', 'net', 'telemetry']
+deps += ['bus_pci']
 
 require_iova_in_mbuf = false
 
drivers/common/cpt/meson.build +1 -1
index c09824a651..a4b000dc37 100644
@@ -9,5 +9,5 @@ endif
 
 sources = files('cpt_fpm_tables.c', 'cpt_pmd_ops_helper.c')
 
-deps = ['kvargs', 'pci', 'cryptodev']
+deps = ['pci', 'cryptodev']
 includes += include_directories('../../crypto/octeontx')
drivers/common/idpf/meson.build +1 -1
index 80c8906f80..adf5430487 100644
@@ -7,7 +7,7 @@ endif
 
 includes += include_directories('../iavf')
 
-deps += ['mbuf']
+deps = ['mbuf']
 
 sources = files(
         'idpf_common_device.c',
drivers/common/mlx5/meson.build +1 -1
index 1eefc02f06..b94c956495 100644
@@ -12,7 +12,7 @@ if is_windows and not is_ms_linker and not meson.is_cross_build()
     subdir_done()
 endif
 
-deps += ['hash', 'pci', 'bus_pci', 'bus_auxiliary', 'net', 'eal', 'kvargs']
+deps += ['hash', 'bus_pci', 'bus_auxiliary']
 sources += files(
         'mlx5_devx_cmds.c',
         'mlx5_common.c',
drivers/compress/mlx5/meson.build +1 -1
index 26a0e0cd09..ddb9e0f82c 100644
@@ -7,7 +7,7 @@ if not is_linux
     subdir_done()
 endif
 
-deps += ['common_mlx5', 'eal', 'compressdev']
+deps += ['common_mlx5', 'compressdev']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/compress/nitrox/meson.build +1 -1
index 1becc66912..c3db4ac2bb 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_nitrox', 'bus_pci', 'compressdev']
+deps += ['common_nitrox', 'compressdev']
 
 sources += files(
         'nitrox_comp.c',
drivers/compress/octeontx/meson.build +1 -1
index 16f973f4d7..0ccde449e8 100644
@@ -9,7 +9,7 @@ endif
 
 sources = files('otx_zip.c', 'otx_zip_pmd.c')
 includes += include_directories('include')
-deps += ['mempool_octeontx', 'bus_pci']
+deps += ['mempool_octeontx']
 ext_deps += dep
 
 require_iova_in_mbuf = false
drivers/crypto/bcmfs/meson.build +1 -1
index 5842f83a3b..678bab7398 100644
@@ -9,7 +9,7 @@ if is_windows
     subdir_done()
 endif
 
-deps += ['eal', 'bus_vdev']
+deps += ['bus_vdev']
 sources = files(
         'bcmfs_logs.c',
         'bcmfs_device.c',
drivers/crypto/cnxk/meson.build +1 -1
index aa840fb7bb..c5a5725e1a 100644
@@ -25,7 +25,7 @@ sources = files(
 )
 
 headers = files('rte_pmd_cnxk_crypto.h')
-deps += ['bus_pci', 'common_cnxk', 'security', 'eventdev']
+deps += ['common_cnxk', 'eventdev']
 includes += include_directories('../../../lib/net', '../../event/cnxk')
 
 if get_option('buildtype').contains('debug')
drivers/crypto/dpaa_sec/meson.build +1 -1
index f87ad6c7e7..9efac952c4 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['bus_dpaa', 'mempool_dpaa', 'security']
+deps += ['mempool_dpaa', 'security']
 sources = files('dpaa_sec.c', 'dpaa_sec_raw_dp.c')
 
 includes += include_directories('../../bus/dpaa/include')
drivers/crypto/ipsec_mb/meson.build +1 -1
index 87bf965554..739cbd1b6e 100644
@@ -45,5 +45,5 @@ sources = files(
         'pmd_snow3g.c',
         'pmd_zuc.c',
 )
-deps += ['bus_vdev', 'net', 'security']
+deps += ['bus_vdev', 'security']
 require_iova_in_mbuf = false
drivers/crypto/mlx5/meson.build +1 -1
index d7bc8ec967..595053d8cd 100644
@@ -7,7 +7,7 @@ if not (is_linux or is_windows)
     subdir_done()
 endif
 
-deps += ['common_mlx5', 'eal', 'cryptodev']
+deps += ['common_mlx5', 'cryptodev']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/crypto/nitrox/meson.build +1 -1
index f8887713d2..85e3ca2b28 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_nitrox', 'bus_pci', 'cryptodev']
+deps += ['common_nitrox', 'cryptodev']
 
 sources += files(
         'nitrox_sym.c',
drivers/dma/cnxk/meson.build +1 -1
index 8ccc1c2cb7..738774d542 100644
@@ -12,7 +12,7 @@ driver_sdk_headers = files(
         'cnxk_dma_event_dp.h',
 )
 
-deps += ['bus_pci', 'common_cnxk', 'dmadev', 'eventdev']
+deps += ['common_cnxk', 'eventdev']
 
 includes += include_directories('../../event/cnxk')
 
drivers/dma/dpaa/meson.build +1 -1
index c31a6d91fe..fec4a45767 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on linux'
 endif
 
-deps += ['dmadev', 'bus_dpaa']
+deps += ['bus_dpaa']
 sources = files('dpaa_qdma.c')
 
 if cc.has_argument('-Wno-pointer-arith')
drivers/dma/dpaa2/meson.build +1 -1
index a99151e2a5..2b5b76ec5f 100644
@@ -8,7 +8,7 @@ endif
 
 build = dpdk_conf.has('RTE_MEMPOOL_DPAA2')
 reason = 'missing dependency, DPDK DPAA2 mempool driver'
-deps += ['dmadev', 'bus_fslmc', 'mempool_dpaa2', 'ring', 'kvargs']
+deps += ['mempool_dpaa2']
 sources = files('dpaa2_qdma.c')
 
 if cc.has_argument('-Wno-pointer-arith')
drivers/dma/odm/meson.build +1 -1
index d597762d37..959e7e685d 100644
@@ -7,7 +7,7 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     subdir_done()
 endif
 
-deps += ['bus_pci', 'dmadev', 'eal', 'mempool', 'pci']
+deps += ['bus_pci', 'dmadev', 'mempool']
 
 sources = files('odm_dmadev.c', 'odm.c')
 
drivers/dma/skeleton/meson.build +1 -1
index 77055683ad..0d703a36eb 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2021 HiSilicon Limited
 
-deps += ['dmadev', 'kvargs', 'ring', 'bus_vdev']
+deps += ['dmadev', 'ring', 'bus_vdev']
 sources = files(
         'skeleton_dmadev.c',
 )
drivers/event/cnxk/meson.build +1 -1
index e0e350570d..b365fff0cb 100644
@@ -337,7 +337,7 @@ foreach flag: extra_flags
 endforeach
 
 headers = files('rte_pmd_cnxk_eventdev.h')
-deps += ['bus_pci', 'common_cnxk', 'net_cnxk', 'crypto_cnxk', 'dma_cnxk']
+deps += ['net_cnxk', 'crypto_cnxk', 'dma_cnxk']
 
 require_iova_in_mbuf = false
 
drivers/event/dlb2/meson.build +1 -1
index 515d1795fe..217abc174d 100644
@@ -67,4 +67,4 @@ endif
 
 headers = files('rte_pmd_dlb2.h')
 
-deps += ['mbuf', 'mempool', 'ring', 'pci', 'bus_pci']
+deps += ['bus_pci']
drivers/event/dpaa2/meson.build +1 -1
index dd5063af43..7dae1da32b 100644
@@ -5,7 +5,7 @@ if not is_linux
     build = false
     reason = 'only supported on Linux'
 endif
-deps += ['bus_vdev', 'net_dpaa2', 'crypto_dpaa2_sec']
+deps += ['net_dpaa2', 'crypto_dpaa2_sec']
 sources = files(
         'dpaa2_hw_dpcon.c',
         'dpaa2_eventdev.c',
drivers/event/octeontx/meson.build +1 -2
index eb17e059d8..1227b2e18d 100644
@@ -17,5 +17,4 @@ sources = files(
         'timvf_probe.c',
 )
 
-deps += ['common_octeontx', 'mempool_octeontx', 'bus_vdev', 'net_octeontx']
-deps += ['crypto_octeontx']
+deps = ['net_octeontx', 'crypto_octeontx']
drivers/event/sw/meson.build +1 -1
index 3a3ebd72a3..450969aa7a 100644
@@ -8,5 +8,5 @@ sources = files(
         'sw_evdev_xstats.c',
         'sw_evdev.c',
 )
-deps += ['hash', 'bus_vdev']
+deps += ['bus_vdev']
 require_iova_in_mbuf = false
drivers/mempool/cnxk/meson.build +1 -1
index e388cce26a..7bbed325df 100644
@@ -18,5 +18,5 @@ sources = files(
 )
 
 headers = files('rte_pmd_cnxk_mempool.h')
-deps += ['eal', 'mbuf', 'kvargs', 'bus_pci', 'common_cnxk', 'mempool']
+deps = ['common_cnxk']
 require_iova_in_mbuf = false
drivers/mempool/dpaa/meson.build +1 -1
index c4e9994b83..39fc312344 100644
@@ -6,5 +6,5 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['bus_dpaa']
+deps = ['bus_dpaa']
 sources = files('dpaa_mempool.c')
drivers/mempool/dpaa2/meson.build +1 -1
index 3d16d44158..0099b20b97 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['bus_fslmc']
+deps = ['bus_fslmc']
 sources = files('dpaa2_hw_mempool.c')
 
 headers = files('rte_dpaa2_mempool.h')
drivers/mempool/octeontx/meson.build +1 -1
index 3ccecac75d..f97bcf4a5a 100644
@@ -12,6 +12,6 @@ sources = files(
         'rte_mempool_octeontx.c',
 )
 
-deps += ['mbuf', 'bus_pci', 'common_octeontx']
+deps = ['mbuf', 'bus_pci', 'common_octeontx']
 
 require_iova_in_mbuf = false
drivers/net/cnxk/meson.build +1 -2
index 7bce80098a..f2f8f60f83 100644
@@ -231,8 +231,7 @@ sources += files(
 endif
 endif
 
-deps += ['bus_pci', 'cryptodev', 'eventdev', 'security']
-deps += ['common_cnxk', 'mempool_cnxk']
+deps = ['eventdev', 'mempool_cnxk']
 
 # Allow implicit vector conversions and strict aliasing warning
 extra_flags = ['-flax-vector-conversions', '-Wno-strict-aliasing']
drivers/net/iavf/meson.build +1 -1
index 83aebd5596..a96d9c0bc0 100644
@@ -11,7 +11,7 @@ includes += include_directories('../../common/iavf')
 
 testpmd_sources = files('iavf_testpmd.c')
 
-deps += ['common_iavf', 'security', 'cryptodev']
+deps += ['common_iavf', 'security']
 
 sources = files(
         'iavf_ethdev.c',
drivers/net/ice/meson.build +1 -1
index b7f2188e62..99344211cb 100644
@@ -18,7 +18,7 @@ sources = files(
 
 testpmd_sources = files('ice_testpmd.c')
 
-deps += ['hash', 'net', 'common_iavf']
+deps += ['hash', 'common_iavf']
 includes += include_directories('base', '../../common/iavf')
 
 if arch_subdir == 'x86'
drivers/net/mana/meson.build +1 -1
index 2d72eca5a8..c97f117fd7 100644
@@ -7,7 +7,7 @@ if not is_linux or not dpdk_conf.has('RTE_ARCH_X86')
     subdir_done()
 endif
 
-deps += ['pci', 'bus_pci', 'net', 'eal', 'kvargs']
+deps += ['bus_pci']
 
 sources += files(
         'gdma.c',
drivers/net/mlx5/meson.build +1 -1
index b279ddf47c..ec679d11ab 100644
@@ -8,7 +8,7 @@ if not (is_linux or is_windows)
     subdir_done()
 endif
 
-deps += ['hash', 'common_mlx5']
+deps += ['common_mlx5']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/net/sfc/meson.build +1 -1
index 5adde68517..820ee6c91e 100644
@@ -71,7 +71,7 @@ if not cc.links(atomic_check_code)
     ext_deps += libatomic_dep
 endif
 
-deps += ['common_sfc_efx', 'bus_pci', 'hash']
+deps += ['common_sfc_efx', 'hash']
 sources = files(
         'sfc_ethdev.c',
         'sfc_kvargs.c',
drivers/net/softnic/meson.build +1 -1
index 5dfbd16c77..1529ef38f9 100644
@@ -15,4 +15,4 @@ sources = files(
         'rte_eth_softnic_swq.c',
         'rte_eth_softnic_thread.c',
 )
-deps += ['pipeline', 'port', 'table']
+deps += ['pipeline']
drivers/raw/cnxk_bphy/meson.build +1 -1
index bb5d2ffb80..b38b071697 100644
@@ -2,7 +2,7 @@
 # Copyright(C) 2021 Marvell.
 #
 
-deps += ['bus_pci', 'common_cnxk', 'rawdev']
+deps += ['common_cnxk', 'rawdev']
 sources = files(
         'cnxk_bphy.c',
         'cnxk_bphy_cgx.c',
drivers/raw/cnxk_gpio/meson.build +1 -1
index 9d9a527392..6d17fe573f 100644
@@ -2,7 +2,7 @@
 # Copyright(C) 2021 Marvell.
 #
 
-deps += ['bus_vdev', 'common_cnxk', 'rawdev', 'kvargs']
+deps += ['bus_vdev', 'common_cnxk', 'rawdev']
 sources = files(
         'cnxk_gpio.c',
         'cnxk_gpio_irq.c',
drivers/raw/ntb/meson.build +1 -1
index 9096f2b25a..8f79d3b16a 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Intel Corporation.
 
-deps += ['rawdev', 'mbuf', 'mempool', 'pci', 'bus_pci']
+deps += ['rawdev', 'mbuf', 'bus_pci']
 sources = files('ntb.c',
                 'ntb_hw_intel.c')
 headers = files('rte_pmd_ntb.h')
drivers/raw/skeleton/meson.build +1 -1
index 9d5fcf6514..7d76fe71b3 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-deps += ['rawdev', 'kvargs', 'mbuf', 'bus_vdev']
+deps += ['rawdev', 'mbuf', 'bus_vdev']
 sources = files(
         'skeleton_rawdev.c',
         'skeleton_rawdev_test.c',
drivers/regex/mlx5/meson.build +1 -1
index 6070b37501..f75bf2e084 100644
@@ -7,7 +7,7 @@ if not is_linux
     subdir_done()
 endif
 
-deps += ['common_mlx5', 'eal']
+deps += ['common_mlx5']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/vdpa/ifc/meson.build +1 -1
index f78d36a715..f4ed4f491f 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-deps += 'vhost'
+deps += 'bus_pci'
 sources = files('ifcvf_vdpa.c', 'base/ifcvf.c')
 includes += include_directories('base')
drivers/vdpa/meson.build +1 -2
index e01c277b9e..747cdc7c55 100644
@@ -11,5 +11,4 @@ drivers = [
         'nfp',
         'sfc',
 ]
-std_deps = ['bus_pci']
-std_deps += ['vhost']
+std_deps = ['vhost']
drivers/vdpa/mlx5/meson.build +1 -1
index e224d1bcc9..1263ac43a4 100644
@@ -7,7 +7,7 @@ if not is_linux
     subdir_done()
 endif
 
-deps += ['hash', 'common_mlx5', 'vhost', 'pci', 'eal', 'sched']
+deps += ['common_mlx5', 'vhost', 'sched']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/vdpa/sfc/meson.build +1 -1
index 933f3f18f3..465ca9f220 100644
@@ -16,7 +16,7 @@ foreach flag: extra_flags
     endif
 endforeach
 
-deps += ['common_sfc_efx', 'bus_pci']
+deps += ['common_sfc_efx']
 sources = files(
         'sfc_vdpa.c',
         'sfc_vdpa_hw.c',
Signature · 1 line
2.43.5
#29 lore raw

PATCH v3 7/8 build: reduce app dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Remove any unnecessary dependencies from the app dependency lists. This will give each app a near-minimum set of required dependencies.

---
 app/dumpcap/meson.build          | 2 +-
 app/graph/meson.build            | 2 +-
 app/pdump/meson.build            | 2 +-
 app/proc-info/meson.build        | 2 +-
 app/test-crypto-perf/meson.build | 2 +-
 app/test-fib/meson.build         | 2 +-
 app/test-sad/meson.build         | 2 +-
 app/test/meson.build             | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)
app/dumpcap/meson.build +1 -1
index 69c016c780..6204cf051a 100644
@@ -14,4 +14,4 @@ endif
 
 ext_deps += pcap_dep
 sources = files('main.c')
-deps += ['ethdev', 'pdump', 'pcapng', 'bpf']
+deps += ['pdump']
app/graph/meson.build +1 -1
index 6dc54d5ee6..9c4cd080d9 100644
@@ -9,7 +9,7 @@ if not build
     subdir_done()
 endif
 
-deps += ['graph', 'eal', 'lpm', 'ethdev', 'node', 'cmdline']
+deps += ['node', 'cmdline']
 sources = files(
         'cli.c',
         'conn.c',
app/pdump/meson.build +1 -1
index fb282bba1f..a10f9d6124 100644
@@ -8,4 +8,4 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ethdev', 'kvargs', 'pdump']
+deps += ['pdump']
app/proc-info/meson.build +1 -1
index 156592119b..24b75b9ace 100644
@@ -8,7 +8,7 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ethdev', 'security', 'eventdev']
+deps += ['security', 'eventdev']
 if dpdk_conf.has('RTE_LIB_METRICS')
     optional_deps += 'metrics'
 endif
app/test-crypto-perf/meson.build +1 -1
index 05c71e0a0c..8904f8607d 100644
@@ -19,7 +19,7 @@ sources = files(
         'cperf_test_verify.c',
         'main.c',
 )
-deps += ['cryptodev', 'net', 'security']
+deps += ['cryptodev']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
     optional_deps += 'crypto_scheduler'
 endif
app/test-fib/meson.build +1 -1
index eb36772cf3..25e2ea1a1d 100644
@@ -8,4 +8,4 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['fib', 'lpm', 'net']
+deps += ['fib', 'lpm']
app/test-sad/meson.build +1 -1
index a50616a9c7..414e2a05cb 100644
@@ -8,4 +8,4 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ipsec', 'net']
+deps += ['ipsec']
app/test/meson.build +1 -1
index bb0a38b3a5..f0a8e58218 100644
@@ -2,7 +2,7 @@
 # Copyright(c) 2017-2023 Intel Corporation
 
 # the main test files [test.c and commands.c] relies on these libraries
-deps += ['cmdline', 'ring', 'mempool', 'mbuf']
+deps += ['cmdline']
 sources += files('commands.c', 'test.c')
 
 # optional dependencies: some files may use these - and so we should link them in -
Signature · 1 line
2.43.5
#30 lore raw

PATCH v3 8/8 devtools: add script to generate DPDK dependency graphs

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Rather than the single monolithic graph that would be output from the deps.dot file in a build directory, we can post-process that to generate simpler graphs for different tasks. This new "draw_dependency_graphs" script takes the "deps.dot" as input and generates an output file that has the nodes categorized, filtering them based off the requested node or category. For example, use "--match net/ice" to show the dependency tree from that driver, or "--match lib" to show just the library dependency tree.

---
 devtools/draw-dependency-graphs.py | 223 +++++++++++++++++++++++++++++
 1 file changed, 223 insertions(+)
 create mode 100755 devtools/draw-dependency-graphs.py
devtools/draw-dependency-graphs.py new file +223 -0
new file mode 100755
index 0000000000..4fb765498d
@@ -0,0 +1,223 @@
+#! /usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 Intel Corporation
+
+import argparse
+import collections
+import sys
+import typing as T
+
+# typedef for dependency data types
+Deps = T.Set[str]
+DepData = T.Dict[str, T.Dict[str, T.Dict[bool, Deps]]]
+
+
+def parse_dep_line(line: str) -> T.Tuple[str, Deps, str, bool]:
+    """Parse digraph line into (component, {dependencies}, type, optional)."""
+    # extract attributes first
+    first, last = line.index("["), line.rindex("]")
+    edge_str, attr_str = line[:first], line[first + 1 : last]
+    # key=value, key=value, ...
+    attrs = {
+        key.strip('" '): value.strip('" ')
+        for attr_kv in attr_str.split(",")
+        for key, value in [attr_kv.strip().split("=", 1)]
+    }
+    # check if edge is defined as dotted line, meaning it's optional
+    optional = "dotted" in attrs.get("style", "")
+    try:
+        component_type = attrs["dpdk_componentType"]
+    except KeyError as _e:
+        raise ValueError(f"Error: missing component type: {line}") from _e
+
+    # now, extract component name and any of its dependencies
+    deps: T.Set[str] = set()
+    try:
+        component, deps_str = edge_str.strip('" ').split("->", 1)
+        component = component.strip().strip('" ')
+        deps_str = deps_str.strip().strip("{}")
+        deps = {d.strip('" ') for d in deps_str.split(",")}
+    except ValueError as _e:
+        component = edge_str.strip('" ')
+
+    return component, deps, component_type, optional
+
+
+def gen_dep_line(component: str, deps: T.Set[str], optional: bool) -> str:
+    """Generate a dependency line for a component."""
+    # we use dotted line to represent optional components
+    attr_str = ' [style="dotted"]' if optional else ""
+    dep_list_str = '", "'.join(deps)
+    deps_str = "" if not deps else f' -> {{ "{dep_list_str}" }}'
+    return f'    "{component}"{deps_str}{attr_str}\n'
+
+
+def read_deps_list(lines: T.List[str]) -> DepData:
+    """Read a list of dependency lines into a dictionary."""
+    deps_data: T.Dict[str, T.Any] = {}
+    for ln in lines:
+        if ln.startswith("digraph") or ln == "}":
+            continue
+
+        component, deps, component_type, optional = parse_dep_line(ln)
+
+        # each component will have two sets of dependencies - required and optional
+        c_dict = deps_data.setdefault(component_type, {}).setdefault(component, {})
+        c_dict[optional] = deps
+    return deps_data
+
+
+def create_classified_graph(deps_data: DepData) -> T.Iterator[str]:
+    """Create a graph of dependencies with components classified by type."""
+    yield "digraph dpdk_dependencies {\n  overlap=false\n  model=subset\n"
+    for n, deps_t in enumerate(deps_data.items()):
+        component_type, component_dict = deps_t
+        yield f'  subgraph cluster_{n} {{\n    label = "{component_type}"\n'
+        for component, optional_d in component_dict.items():
+            for optional, deps in optional_d.items():
+                yield gen_dep_line(component, deps, optional)
+        yield "  }\n"
+    yield "}\n"
+
+
+def parse_match(line: str, dep_data: DepData) -> T.List[str]:
+    """Extract list of components from a category string."""
+    # if this is not a compound string, we have very few valid choices
+    if "/" not in line:
+        # is this a category?
+        if line in dep_data:
+            return list(dep_data[line].keys())
+        # this isn't a category. maybe an app name?
+        maybe_app_name = f"dpdk-{line}"
+        if maybe_app_name in dep_data["app"]:
+            return [maybe_app_name]
+        if maybe_app_name in dep_data["examples"]:
+            return [maybe_app_name]
+        # this isn't an app name either, so just look for component with that name
+        for _, component_dict in dep_data.items():
+            if line in component_dict:
+                return [line]
+        # nothing found still. one last try: maybe it's a driver? we have to be careful though
+        # because a driver name may not be unique, e.g. common/iavf and net/iavf. so, only pick
+        # a driver if we can find exactly one driver that matches.
+        found_drivers: T.List[str] = []
+        for component in dep_data["drivers"].keys():
+            _, drv_name = component.split("_", 1)
+            if drv_name == line:
+                found_drivers.append(component)
+        if len(found_drivers) == 1:
+            return found_drivers
+        # we failed to find anything, report error
+        raise ValueError(f"Error: unknown component: {line}")
+
+    # this is a compound string, so we have to do some matching. we may have two or three levels
+    # of hierarchy, as driver/net/ice and net/ice should both be valid.
+
+    # if there are three levels of hierarchy, this must be a driver
+    try:
+        ctype, drv_class, drv_name = line.split("/", 2)
+        component_name = f"{drv_class}_{drv_name}"
+        # we want to directly access the dict to trigger KeyError, and not catch them here
+        if component_name in dep_data[ctype]:
+            return [component_name]
+        else:
+            raise KeyError(f"Unknown category: {line}")
+    except ValueError:
+        # not three levels of hierarchy, try two
+        pass
+
+    first, second = line.split("/", 1)
+
+    # this could still be a driver, just without the "drivers" prefix
+    for component in dep_data["drivers"].keys():
+        if component == f"{first}_{second}":
+            return [component]
+    # could be driver wildcard, e.g. drivers/net
+    if first == "drivers":
+        drv_match: T.List[str] = [
+            drv_name
+            for drv_name in dep_data["drivers"]
+            if drv_name.startswith(f"{second}_")
+        ]
+        if drv_match:
+            return drv_match
+    # may be category + component
+    if first in dep_data:
+        # go through all components in the category
+        if second in dep_data[first]:
+            return [second]
+        # if it's an app or an example, it may have "dpdk-" in front
+        if first in ["app", "examples"]:
+            maybe_app_name = f"dpdk-{second}"
+            if maybe_app_name in dep_data[first]:
+                return [maybe_app_name]
+    # and nothing of value was found
+    raise ValueError(f"Error: unknown component: {line}")
+
+
+def filter_deps(dep_data: DepData, criteria: T.List[str]) -> None:
+    """Filter dependency data to include only specified components."""
+    # this is a two step process: when we get a list of components, we need to
+    # go through all of them and note any dependencies they have, and expand the
+    # list of components with those dependencies. then we filter.
+
+    # walk the dependency list and include all possible dependencies
+    deps_seen: Deps = set()
+    deps_stack = collections.deque(criteria)
+    while deps_stack:
+        component = deps_stack.popleft()
+        if component in deps_seen:
+            continue
+        deps_seen.add(component)
+        for component_type, component_dict in dep_data.items():
+            try:
+                deps = component_dict[component]
+            except KeyError:
+                # wrong component type
+                continue
+            for _, dep_list in deps.items():
+                deps_stack.extend(dep_list)
+    criteria += list(deps_seen)
+
+    # now, "components" has all the dependencies we need to include, so we can filter
+    for component_type, component_dict in dep_data.items():
+        dep_data[component_type] = {
+            component: deps
+            for component, deps in component_dict.items()
+            if component in criteria
+        }
+
+
+def main():
+    parser = argparse.ArgumentParser(
+        description="Utility to generate dependency tree graphs for DPDK"
+    )
+    parser.add_argument(
+        "--match",
+        type=str,
+        help="Output hierarchy for component or category, e.g. net/ice, lib, app, drivers/net, etc.",
+    )
+    parser.add_argument(
+        "input_file",
+        type=argparse.FileType("r"),
+        help="Path to the deps.dot file from a DPDK build directory",
+    )
+    parser.add_argument(
+        "output_file",
+        type=argparse.FileType("w"),
+        help="Path to the desired output dot file",
+    )
+    args = parser.parse_args()
+
+    deps = read_deps_list([ln.strip() for ln in args.input_file.readlines()])
+    if args.match:
+        try:
+            filter_deps(deps, parse_match(args.match, deps))
+        except (KeyError, ValueError) as e:
+            print(e, file=sys.stderr)
+            return
+    args.output_file.writelines(create_classified_graph(deps))
+
+
+if __name__ == "__main__":
+    main()
Signature · 1 line
2.43.5
Acked-by on the v3 series
#31 lore raw

RE: [PATCH v3 0/8] record and rework component dependencies

In reply to Anatoly Burakov
Quoted 15 lines

From: Anatoly Burakov [mailto:[email protected]]

As part of the meson build, we can record the dependencies for each component as we process it, logging them to a file. This file can be used as input to a number of other scripts and tools, for example, to graph the dependencies, or to allow higher-level build-config tools to automatically enable component requirements, etc.

The first patch of this set separates dependencies inside meson into optional or mandatory. The second patch of this set generates the basic dependency tree. The third patch does some processing of that dependency tree to identify cases where dependencies are being unnecessarily specified. Reducing these makes it easier to have readable dependency graphs in future, without affecting the build.

Quoted 8 lines

The following 4 patches are based on the output of the second patch, and greatly cut down the number of direct dependency links between components. Even with the cut-down dependencies, the full dependency graph is nigh-unreadable, so the final patch adds a new script to generate dependency tree subgraphs, creating dot files for e.g. the dependencies of a particular component, or a component class such as mempool drivers.

For the series,

#32 lore raw

v4 cover Record and rework component dependencies

In reply to Anatoly Burakov

As part of the meson build, we can record the dependencies for each component as we process it, logging them to a file. This file can be used as input to a number of other scripts and tools, for example, to graph the dependencies, or to allow higher-level build-config tools to automatically enable component requirements, etc.

The first patch of this set separates dependencies inside meson into optional or mandatory. The second patch of this set generates the basic dependency tree. The third patch does some processing of that dependency tree to identify cases where dependencies are being unnecessarily specified. Reducing these makes it easier to have readable dependency graphs in future, without affecting the build.

The following 4 patches are based on the output of the second patch, and greatly cut down the number of direct dependency links between components. Even with the cut-down dependencies, the full dependency graph is nigh-unreadable, so the final patch adds a new script to generate dependency tree subgraphs, creating dot files for e.g. the dependencies of a particular component, or a component class such as mempool drivers.

v3 -> v4:
- Update to latest main

v2 -> v3:
- Split dependencies into optional and mandatory
- Fixup graph scripts to read and generate graphs that encode optional dependencies into the graph
- Python version fixes to avoid using features not available in minimum supported Python version
- Formatting with Ruff, and PEP-484 compliance

Anatoly Burakov (1):
build: split dependencies into mandatory and optional

Bruce Richardson (7):
build: output a dependency log in build directory
devtools: add script to flag unneeded dependencies
build: remove kvargs from driver class dependencies
build: reduce library dependencies
build: reduce driver dependencies
build: reduce app dependencies
devtools: add script to generate DPDK dependency graphs

 app/dumpcap/meson.build                    |   2 +-
 app/graph/meson.build                      |   2 +-
 app/meson.build                            |  11 +-
 app/pdump/meson.build                      |   2 +-
 app/proc-info/meson.build                  |   4 +-
 app/test-bbdev/meson.build                 |   8 +-
 app/test-crypto-perf/meson.build           |   4 +-
 app/test-fib/meson.build                   |   2 +-
 app/test-pmd/meson.build                   |  26 +--
 app/test-sad/meson.build                   |   2 +-
 app/test/meson.build                       |  14 +-
 buildtools/log-deps.py                     |  81 ++++++++
 buildtools/meson.build                     |   2 +
 devtools/draw-dependency-graphs.py         | 223 +++++++++++++++++++++
 devtools/find-duplicate-deps.py            |  53 +++++
 drivers/baseband/fpga_5gnr_fec/meson.build |   2 +-
 drivers/baseband/fpga_lte_fec/meson.build  |   2 +-
 drivers/baseband/la12xx/meson.build        |   2 +-
 drivers/baseband/null/meson.build          |   2 +-
 drivers/baseband/turbo_sw/meson.build      |   2 +-
 drivers/bus/auxiliary/meson.build          |   2 -
 drivers/bus/dpaa/meson.build               |   2 +-
 drivers/bus/fslmc/meson.build              |   2 +-
 drivers/bus/ifpga/meson.build              |   2 +-
 drivers/bus/pci/meson.build                |   4 +-
 drivers/bus/platform/meson.build           |   1 -
 drivers/bus/uacce/meson.build              |   2 -
 drivers/bus/vdev/meson.build               |   2 -
 drivers/common/cnxk/meson.build            |   4 +-
 drivers/common/cpt/meson.build             |   2 +-
 drivers/common/idpf/meson.build            |   2 +-
 drivers/common/mlx5/meson.build            |   2 +-
 drivers/compress/mlx5/meson.build          |   2 +-
 drivers/compress/nitrox/meson.build        |   2 +-
 drivers/compress/octeontx/meson.build      |   2 +-
 drivers/crypto/bcmfs/meson.build           |   2 +-
 drivers/crypto/cnxk/meson.build            |   2 +-
 drivers/crypto/dpaa_sec/meson.build        |   2 +-
 drivers/crypto/ipsec_mb/meson.build        |   2 +-
 drivers/crypto/mlx5/meson.build            |   2 +-
 drivers/crypto/nitrox/meson.build          |   2 +-
 drivers/dma/cnxk/meson.build               |   2 +-
 drivers/dma/dpaa/meson.build               |   2 +-
 drivers/dma/dpaa2/meson.build              |   2 +-
 drivers/dma/odm/meson.build                |   2 +-
 drivers/dma/skeleton/meson.build           |   2 +-
 drivers/event/cnxk/meson.build             |   2 +-
 drivers/event/dlb2/meson.build             |   2 +-
 drivers/event/dpaa2/meson.build            |   2 +-
 drivers/event/meson.build                  |   2 +-
 drivers/event/octeontx/meson.build         |   3 +-
 drivers/event/sw/meson.build               |   2 +-
 drivers/mempool/cnxk/meson.build           |   2 +-
 drivers/mempool/dpaa/meson.build           |   2 +-
 drivers/mempool/dpaa2/meson.build          |   2 +-
 drivers/mempool/octeontx/meson.build       |   2 +-
 drivers/meson.build                        |   9 +-
 drivers/net/cnxk/meson.build               |   4 +-
 drivers/net/iavf/meson.build               |   2 +-
 drivers/net/ice/meson.build                |   2 +-
 drivers/net/mana/meson.build               |   2 +-
 drivers/net/meson.build                    |   2 +-
 drivers/net/mlx5/meson.build               |   2 +-
 drivers/net/sfc/meson.build                |   2 +-
 drivers/net/softnic/meson.build            |   2 +-
 drivers/raw/cnxk_bphy/meson.build          |   2 +-
 drivers/raw/cnxk_gpio/meson.build          |   2 +-
 drivers/raw/ntb/meson.build                |   2 +-
 drivers/raw/skeleton/meson.build           |   2 +-
 drivers/regex/meson.build                  |   2 +-
 drivers/regex/mlx5/meson.build             |   2 +-
 drivers/vdpa/ifc/meson.build               |   2 +-
 drivers/vdpa/meson.build                   |   3 +-
 drivers/vdpa/mlx5/meson.build              |   2 +-
 drivers/vdpa/sfc/meson.build               |   2 +-
 examples/ethtool/meson.build               |   2 +-
 examples/l2fwd-crypto/meson.build          |   2 +-
 examples/l3fwd/meson.build                 |   2 +-
 examples/meson.build                       |  11 +-
 examples/vm_power_manager/meson.build      |   6 +-
 lib/argparse/meson.build                   |   2 +-
 lib/bbdev/meson.build                      |   2 +-
 lib/bitratestats/meson.build               |   2 +-
 lib/bpf/meson.build                        |   2 +-
 lib/cmdline/meson.build                    |   2 +-
 lib/compressdev/meson.build                |   2 +-
 lib/cryptodev/meson.build                  |   2 +-
 lib/dispatcher/meson.build                 |   2 +-
 lib/distributor/meson.build                |   2 +-
 lib/dmadev/meson.build                     |   2 -
 lib/eal/meson.build                        |   5 +-
 lib/efd/meson.build                        |   2 +-
 lib/ethdev/meson.build                     |   2 +-
 lib/eventdev/meson.build                   |   3 +-
 lib/fib/meson.build                        |   4 +-
 lib/gpudev/meson.build                     |   2 +-
 lib/graph/meson.build                      |   2 +-
 lib/gro/meson.build                        |   2 +-
 lib/gso/meson.build                        |   2 +-
 lib/hash/meson.build                       |   4 +-
 lib/ip_frag/meson.build                    |   2 +-
 lib/ipsec/meson.build                      |   2 +-
 lib/kvargs/meson.build                     |   2 +-
 lib/latencystats/meson.build               |   2 +-
 lib/lpm/meson.build                        |   3 +-
 lib/mbuf/meson.build                       |   2 +-
 lib/member/meson.build                     |   2 +-
 lib/mempool/meson.build                    |   2 +-
 lib/meson.build                            |   8 +-
 lib/metrics/meson.build                    |   2 +-
 lib/mldev/meson.build                      |   2 +-
 lib/net/meson.build                        |   2 +-
 lib/node/meson.build                       |   2 +-
 lib/pcapng/meson.build                     |   2 +-
 lib/pdcp/meson.build                       |   2 +-
 lib/pdump/meson.build                      |   2 +-
 lib/pipeline/meson.build                   |   2 +-
 lib/port/meson.build                       |   2 +-
 lib/power/meson.build                      |   3 +-
 lib/rawdev/meson.build                     |   2 -
 lib/rcu/meson.build                        |   2 +-
 lib/regexdev/meson.build                   |   2 +-
 lib/reorder/meson.build                    |   2 +-
 lib/rib/meson.build                        |   2 +-
 lib/ring/meson.build                       |   1 -
 lib/sched/meson.build                      |   2 +-
 lib/security/meson.build                   |   2 +-
 lib/table/meson.build                      |   2 +-
 lib/telemetry/meson.build                  |   2 +-
 lib/vhost/meson.build                      |   2 +-
 130 files changed, 533 insertions(+), 175 deletions(-)
 create mode 100644 buildtools/log-deps.py
 create mode 100755 devtools/draw-dependency-graphs.py
 create mode 100755 devtools/find-duplicate-deps.py
Signature · 1 line
2.43.5
#33 lore raw

PATCH v4 1/8 build: split dependencies into mandatory and optional

Allow specifying dependencies as either mandatory or optional. This does not change anything about the build, but it is useful for tooling to know if a dependency is required or not.

---
 app/meson.build                       |  3 ++-
 app/proc-info/meson.build             |  2 +-
 app/test-bbdev/meson.build            |  8 ++++----
 app/test-crypto-perf/meson.build      |  2 +-
 app/test-pmd/meson.build              | 26 +++++++++++++-------------
 app/test/meson.build                  | 12 ++++++------
 drivers/meson.build                   |  3 ++-
 examples/ethtool/meson.build          |  2 +-
 examples/l2fwd-crypto/meson.build     |  2 +-
 examples/l3fwd/meson.build            |  2 +-
 examples/meson.build                  |  3 ++-
 examples/vm_power_manager/meson.build |  6 +++---
 lib/meson.build                       |  3 ++-
 13 files changed, 39 insertions(+), 35 deletions(-)
app/meson.build +2 -1
index e2db888ae1..4e88e652ca 100644
@@ -66,6 +66,7 @@ foreach app:apps
     # external package/library requirements
     ext_deps = []
     deps = []
+    optional_deps = []
 
     if not enable_apps.contains(app)
         build = false
@@ -85,7 +86,7 @@ foreach app:apps
 
     if build
         dep_objs = []
-        foreach d:deps
+        foreach d:deps + optional_deps
             var_name = get_option('default_library') + '_rte_' + d
             if not is_variable(var_name)
                 build = false
app/proc-info/meson.build +1 -1
index 4f83f29a64..156592119b 100644
@@ -10,5 +10,5 @@ endif
 sources = files('main.c')
 deps += ['ethdev', 'security', 'eventdev']
 if dpdk_conf.has('RTE_LIB_METRICS')
-    deps += 'metrics'
+    optional_deps += 'metrics'
 endif
app/test-bbdev/meson.build +4 -4
index 926e0a5271..c26e46a987 100644
@@ -15,14 +15,14 @@ sources = files(
 )
 deps += ['bbdev', 'bus_vdev']
 if dpdk_conf.has('RTE_BASEBAND_FPGA_LTE_FEC')
-    deps += ['baseband_fpga_lte_fec']
+    optional_deps += ['baseband_fpga_lte_fec']
 endif
 if dpdk_conf.has('RTE_BASEBAND_FPGA_5GNR_FEC')
-    deps += ['baseband_fpga_5gnr_fec']
+    optional_deps += ['baseband_fpga_5gnr_fec']
 endif
 if dpdk_conf.has('RTE_BASEBAND_ACC')
-    deps += ['baseband_acc']
+    optional_deps += ['baseband_acc']
 endif
 if dpdk_conf.has('RTE_BASEBAND_LA12XX')
-    deps += ['baseband_la12xx']
+    optional_deps += ['baseband_la12xx']
 endif
app/test-crypto-perf/meson.build +1 -1
index 7b02b518f0..05c71e0a0c 100644
@@ -21,5 +21,5 @@ sources = files(
 )
 deps += ['cryptodev', 'net', 'security']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
+    optional_deps += 'crypto_scheduler'
 endif
app/test-pmd/meson.build +13 -13
index f1c36529b4..1b54e479fe 100644
@@ -37,44 +37,44 @@ endif
 
 deps += ['ethdev', 'cmdline']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
+    optional_deps += 'crypto_scheduler'
 endif
 if dpdk_conf.has('RTE_LIB_BITRATESTATS')
-    deps += 'bitratestats'
+    optional_deps += 'bitratestats'
 endif
 if dpdk_conf.has('RTE_LIB_BPF')
     sources += files('bpf_cmd.c')
-    deps += 'bpf'
+    optional_deps += 'bpf'
 endif
 if dpdk_conf.has('RTE_LIB_GRO')
-    deps += 'gro'
+    optional_deps += 'gro'
 endif
 if dpdk_conf.has('RTE_LIB_GSO')
-    deps += 'gso'
+    optional_deps += 'gso'
 endif
 if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
-    deps += 'latencystats'
+    optional_deps += 'latencystats'
 endif
 if dpdk_conf.has('RTE_LIB_METRICS')
-    deps += 'metrics'
+    optional_deps += 'metrics'
 endif
 if dpdk_conf.has('RTE_LIB_PDUMP')
-    deps += 'pdump'
+    optional_deps += 'pdump'
 endif
 if dpdk_conf.has('RTE_NET_BNXT')
-    deps += 'net_bnxt'
+    optional_deps += 'net_bnxt'
 endif
 if dpdk_conf.has('RTE_NET_I40E')
-    deps += 'net_i40e'
+    optional_deps += 'net_i40e'
 endif
 if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += 'net_ixgbe'
+    optional_deps += 'net_ixgbe'
 endif
 if dpdk_conf.has('RTE_NET_DPAA')
-    deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa']
+    optional_deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa']
 endif
 
 # Driver-specific commands are located in driver directories.
 includes = include_directories('.')
 sources += testpmd_drivers_sources
-deps += testpmd_drivers_deps
+optional_deps += testpmd_drivers_deps
app/test/meson.build +6 -6
index d5cb6a7f7a..9383b241a5 100644
@@ -7,7 +7,7 @@ sources += files('commands.c', 'test.c')
 
 # optional dependencies: some files may use these - and so we should link them in -
 # but do not explicitly require them so they are not listed in the per-file lists below
-optional_deps = ['crypto_scheduler', 'lpm']
+opt_deps = ['crypto_scheduler', 'lpm']
 
 # some other utility C files, providing functions used by various tests
 # so we need to include these deps in the dependency list for the files using those fns.
@@ -219,8 +219,8 @@ foreach f, f_deps : source_file_deps
             break
         else
             # technically we might not need this dep, but adding it is harmless
-            if d not in deps
-                deps += d
+            if d not in optional_deps
+                optional_deps += d
             endif
         endif
     endforeach
@@ -241,9 +241,9 @@ foreach f, f_deps : source_file_deps
     endif
 endforeach
 # add the optional dependencies
-foreach d:optional_deps
-    if is_variable(def_lib + '_rte_' + d) and d not in deps
-        deps += d
+foreach d:opt_deps
+    if is_variable(def_lib + '_rte_' + d) and d not in optional_deps
+        optional_deps += d
     endif
 endforeach
 
drivers/meson.build +2 -1
index 495e21b54a..7a144cc527 100644
@@ -132,6 +132,7 @@ foreach subpath:subdirs
         includes = [include_directories(drv_path)]
         # set up internal deps. Drivers can append/override as necessary
         deps = std_deps
+        optional_deps = []
         # ext_deps: Stores external library dependency got
         # using dependency() (preferred) or find_library().
         # For the find_library() case (but not with dependency()) we also
@@ -173,7 +174,7 @@ foreach subpath:subdirs
             # get dependency objs from strings
             shared_deps = ext_deps
             static_deps = ext_deps
-            foreach d:deps
+            foreach d:deps + optional_deps
                 if not build
                     break
                 endif
examples/ethtool/meson.build +1 -1
index d7f63d48af..e8638a8607 100644
@@ -20,7 +20,7 @@ includes = include_directories('lib', 'ethtool-app')
 
 deps += 'bus_pci'
 if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += 'net_ixgbe'
+    optional_deps += 'net_ixgbe'
 endif
 
 allow_experimental_apis = true
examples/l2fwd-crypto/meson.build +1 -1
index bb44c88882..f16ebadc74 100644
@@ -8,7 +8,7 @@
 
 deps += 'cryptodev'
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
+    optional_deps += 'crypto_scheduler'
 endif
 allow_experimental_apis = true
 sources = files(
examples/l3fwd/meson.build +1 -1
index c25de77bba..5938452607 100644
@@ -19,5 +19,5 @@ sources = files(
         'main.c',
 )
 if dpdk_conf.has('RTE_LIB_EVENTDEV')
-    deps += 'eventdev'
+    optional_deps += 'eventdev'
 endif
examples/meson.build +2 -1
index 8e8968a1fa..82151d09b4 100644
@@ -98,11 +98,12 @@ foreach example: examples
     ext_deps = []
     includes = [include_directories(example, 'common')]
     deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
+    optional_deps = []
     subdir(example)
 
     if build
         dep_objs = ext_deps
-        foreach d:deps
+        foreach d:deps + optional_deps
             var_name = get_option('default_library') + '_rte_' + d
             if not is_variable(var_name)
                 build = false
examples/vm_power_manager/meson.build +3 -3
index dcf23198eb..82841e4339 100644
@@ -9,15 +9,15 @@
 deps += ['power', 'power_kvm_vm']
 
 if dpdk_conf.has('RTE_NET_BNXT')
-    deps += ['net_bnxt']
+    optional_deps += ['net_bnxt']
 endif
 
 if dpdk_conf.has('RTE_NET_I40E')
-    deps += ['net_i40e']
+    optional_deps += ['net_i40e']
 endif
 
 if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += ['net_ixgbe']
+    optional_deps += ['net_ixgbe']
 endif
 
 allow_experimental_apis = true
lib/meson.build +2 -1
index ce92cb5537..82ad5dba67 100644
@@ -134,6 +134,7 @@ foreach l:libraries
     # external package/library requirements
     ext_deps = []
     deps = []
+    optional_deps = []
     # eal is standard dependency once built
     if dpdk_conf.has('RTE_LIB_EAL')
         deps += ['eal']
@@ -171,7 +172,7 @@ foreach l:libraries
 
     shared_deps = ext_deps
     static_deps = ext_deps
-    foreach d:deps
+    foreach d:deps + optional_deps
         if not build
             break
         endif
Signature · 1 line
2.43.5
#34 lore raw

PATCH v4 2/8 build: output a dependency log in build directory

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

As meson processes our DPDK source tree it manages dependencies specified by each individual driver. To enable future analysis of the dependency links between components, log the dependencies of each DPDK component as it gets processed. This could potentially allow other tools to automatically enable or disable components based on the desired end components to be built, e.g. if the user requests net/ice, ensure that common/iavf is also enabled in the drivers.

The output file produced is in "dot" or "graphviz" format, which allows producing a graphical representation of the DPDK dependency tree if so desired. For example: "dot -Tpng -O build/deps.dot" to produce the image file "build/deps.dot.png".

---
 app/meson.build        |  8 ++++-
 buildtools/log-deps.py | 81 ++++++++++++++++++++++++++++++++++++++++++
 buildtools/meson.build |  2 ++
 drivers/meson.build    |  6 ++++
 examples/meson.build   |  8 ++++-
 lib/meson.build        |  5 +++
 6 files changed, 108 insertions(+), 2 deletions(-)
 create mode 100644 buildtools/log-deps.py
app/meson.build +7 -1
index 4e88e652ca..a770fed802 100644
@@ -76,8 +76,14 @@ foreach app:apps
         reason = 'explicitly disabled via build config'
     endif
 
+    app_name = 'dpdk-' + name
     if build
         subdir(name)
+        type_cmd = '--type=app'
+        run_command([log_deps_cmd, type_cmd, app_name, deps], check: false)
+        if optional_deps.length() > 0
+            run_command([log_deps_cmd, '--optional', type_cmd, app_name, optional_deps], check: false)
+        endif
         if not build and require_apps
             error('Cannot build explicitly requested app "@0@".\n'.format(name)
                   + '\tReason: ' + reason)
@@ -116,7 +122,7 @@ foreach app:apps
         link_libs = dpdk_static_libraries + dpdk_drivers
     endif
 
-    exec = executable('dpdk-' + name,
+    exec = executable(app_name,
             [ sources, resources ],
             c_args: cflags,
             link_args: ldflags,
buildtools/log-deps.py new file +81 -0

81 lines not on this page · raw message

buildtools/meson.build +2 -0
index 4e2c1217a2..13a0477245 100644
@@ -26,6 +26,8 @@ header_gen_cmd = py3 + files('gen-header.py')
 has_hugepages_cmd = py3 + files('has-hugepages.py')
 cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py')
 check_dts_requirements = py3 + files('check-dts-requirements.py')
+log_deps_cmd = py3 + files('log-deps.py')
+run_command(log_deps_cmd, check: false)  # call with no parameters to reset the file
 
 # install any build tools that end-users might want also
 install_data([
drivers/meson.build +6 -0
index 7a144cc527..338efe42b8 100644
@@ -159,6 +159,12 @@ foreach subpath:subdirs
         if build
             # pull in driver directory which should update all the local variables
             subdir(drv_path)
+            type_cmd = '--type=drivers'
+            drv_name = class + '_' + name
+            run_command([log_deps_cmd, type_cmd, drv_name, deps], check: false)
+            if optional_deps.length() > 0
+                run_command([log_deps_cmd, '--optional', type_cmd, drv_name, optional_deps], check: false)
+            endif
 
             if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0 and require_iova_in_mbuf
                 build = false
examples/meson.build +7 -1
index 82151d09b4..1589a3057e 100644
@@ -101,8 +101,14 @@ foreach example: examples
     optional_deps = []
     subdir(example)
 
+    example_name = 'dpdk-' + name
     if build
         dep_objs = ext_deps
+        type_cmd = '--type=examples'
+        run_command([log_deps_cmd, type_cmd, example_name, deps], check: false)
+        if optional_deps.length() > 0
+            run_command([log_deps_cmd, '--optional', type_cmd, example_name, optional_deps], check: false)
+        endif
         foreach d:deps + optional_deps
             var_name = get_option('default_library') + '_rte_' + d
             if not is_variable(var_name)
@@ -125,7 +131,7 @@ foreach example: examples
     if allow_experimental_apis
         cflags += '-DALLOW_EXPERIMENTAL_API'
     endif
-    executable('dpdk-' + name, sources,
+    executable(example_name, sources,
             include_directories: includes,
             link_whole: link_whole_libs,
             link_args: ldflags,
lib/meson.build +5 -0
index 82ad5dba67..d1d772d4f4 100644
@@ -161,6 +161,11 @@ foreach l:libraries
 
     if build
         subdir(l)
+        type_cmd = '--type=lib'
+        run_command([log_deps_cmd, type_cmd, l, deps], check: false)
+        if optional_deps.length() > 0
+            run_command([log_deps_cmd, '--optional', type_cmd, l, optional_deps], check: false)
+        endif
         if not build and require_libs
             error('Cannot build explicitly requested lib "@0@".\n'.format(name)
                     +'\tReason: ' + reason)
Signature · 1 line
2.43.5
#35 lore raw

PATCH v4 3/8 devtools: add script to flag unneeded dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

While not a serious problem, DPDK components often list more dependencies than are actually necessary to build, due to the use of recursive dependencies. In extreme cases, such as with core libraries, this can lead to longer configuration times due to meson having to deduplicate long lists of dependencies. Therefore we can add a script to identify when a component has got unnecessary dependencies listed.

---
 devtools/find-duplicate-deps.py | 53 +++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100755 devtools/find-duplicate-deps.py
devtools/find-duplicate-deps.py new file +53 -0
new file mode 100755
index 0000000000..b1eacf21ce
@@ -0,0 +1,53 @@
+#! /usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 Intel Corporation
+
+"""Identify any superfluous dependencies listed in DPDK deps graph."""
+
+import sys
+
+all_deps = {}
+
+
+class dep:
+    """Holds a component and its dependencies."""
+
+    def __init__(self, name, dep_names):
+        """Create and process a component and its deps."""
+        self.name = name.strip('" ')
+        self.base_deps = [all_deps[dn.strip('" ')] for dn in dep_names]
+        self.recursive_deps = []
+        for d in self.base_deps:
+            self.recursive_deps.extend(d.base_deps)
+            self.recursive_deps.extend(d.recursive_deps)
+        self.extra_deps = []
+        for d in self.base_deps:
+            if d in self.recursive_deps:
+                self.extra_deps.append(d.name)
+        if self.extra_deps:
+            print(f'{self.name}: extra deps {self.extra_deps}')
+
+    def dict_add(self, d):
+        """Add this object to a dictionary by name."""
+        d[self.name] = self
+
+
+def main(argv):
+    """Read the dependency tree from a dot file and process it."""
+    if len(argv) != 2:
+        print(f'Usage: {argv[0]} <build-directory>/deps.dot', file=sys.stderr)
+        sys.exit(1)
+
+    with open(argv[1]) as f:
+        for ln in f.readlines():
+            ln = ln.strip()
+            if '->' in ln:
+                name, deps = ln.split('->')
+                deps = deps.strip(' {}')
+                dep(name, deps.split(',')).dict_add(all_deps)
+            elif ln.startswith('"') and ln.endswith('"'):
+                dep(ln.strip('"'), []).dict_add(all_deps)
+
+
+if __name__ == '__main__':
+    main(sys.argv)
Signature · 1 line
2.43.5
#36 lore raw

PATCH v4 4/8 build: remove kvargs from driver class dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

The kvargs library is used by EAL, and therefore is implicitly a dependency of every DPDK driver. Remove it from the minimum set of dependencies for each driver class as it's unnecessary to call it out there.

---
 drivers/event/meson.build | 2 +-
 drivers/net/meson.build   | 2 +-
 drivers/regex/meson.build | 2 +-
 drivers/vdpa/meson.build  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/event/meson.build +1 -1
index d6706b57f7..2708833adf 100644
@@ -19,4 +19,4 @@ if not (toolchain == 'gcc' and cc.version().version_compare('<4.8.6') and
         dpdk_conf.has('RTE_ARCH_ARM64'))
     drivers += 'octeontx'
 endif
-std_deps = ['eventdev', 'kvargs']
+std_deps = ['eventdev']
drivers/net/meson.build +1 -1
index dafd637ba4..3b388ead24 100644
@@ -65,6 +65,6 @@ drivers = [
         'vmxnet3',
         'zxdh',
 ]
-std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
+std_deps = ['ethdev']           # 'ethdev' also pulls in mbuf, net, eal etc
 std_deps += ['bus_pci']         # very many PMDs depend on PCI, so make std
 std_deps += ['bus_vdev']        # same with vdev bus
drivers/regex/meson.build +1 -1
index ff2a8fea89..10192e7c77 100644
@@ -5,4 +5,4 @@ drivers = [
         'mlx5',
         'cn9k',
 ]
-std_deps = ['ethdev', 'kvargs', 'regexdev'] # 'ethdev' also pulls in mbuf, net, eal etc
+std_deps = ['ethdev', 'regexdev'] # 'ethdev' also pulls in mbuf, net, eal etc
drivers/vdpa/meson.build +1 -1
index 896e8e0304..e01c277b9e 100644
@@ -11,5 +11,5 @@ drivers = [
         'nfp',
         'sfc',
 ]
-std_deps = ['bus_pci', 'kvargs']
+std_deps = ['bus_pci']
 std_deps += ['vhost']
Signature · 1 line
2.43.5
#37 lore raw

PATCH v4 5/8 build: reduce library dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Rather than having each library depend up on EAL + any extra libs, we can take advantage of recursive dependency support in meson and just assign the dependencies of each directory directly, rather than appending to the array. For libraries which only depend upon EAL, keep that as a default, but for libraries which depend upon even a single extra lib, that EAL dependency is unnecessary.

Going further, we can identify using the find_duplicate_deps.py script any unnecessary deps in each library's list, and remove them to slim the dependency tree down.

Reducing number of dependencies means that meson takes less time processing and deduplicating the dependency tree for each component, and also shrinks the dependency graph for DPDK itself.

---
 lib/argparse/meson.build     | 2 +-
 lib/bbdev/meson.build        | 2 +-
 lib/bitratestats/meson.build | 2 +-
 lib/bpf/meson.build          | 2 +-
 lib/cmdline/meson.build      | 2 +-
 lib/compressdev/meson.build  | 2 +-
 lib/cryptodev/meson.build    | 2 +-
 lib/dispatcher/meson.build   | 2 +-
 lib/distributor/meson.build  | 2 +-
 lib/dmadev/meson.build       | 2 --
 lib/eal/meson.build          | 5 +----
 lib/efd/meson.build          | 2 +-
 lib/ethdev/meson.build       | 2 +-
 lib/eventdev/meson.build     | 3 +--
 lib/fib/meson.build          | 4 +---
 lib/gpudev/meson.build       | 2 +-
 lib/graph/meson.build        | 2 +-
 lib/gro/meson.build          | 2 +-
 lib/gso/meson.build          | 2 +-
 lib/hash/meson.build         | 4 +---
 lib/ip_frag/meson.build      | 2 +-
 lib/ipsec/meson.build        | 2 +-
 lib/kvargs/meson.build       | 2 +-
 lib/latencystats/meson.build | 2 +-
 lib/lpm/meson.build          | 3 +--
 lib/mbuf/meson.build         | 2 +-
 lib/member/meson.build       | 2 +-
 lib/mempool/meson.build      | 2 +-
 lib/metrics/meson.build      | 2 +-
 lib/mldev/meson.build        | 2 +-
 lib/net/meson.build          | 2 +-
 lib/node/meson.build         | 2 +-
 lib/pcapng/meson.build       | 2 +-
 lib/pdcp/meson.build         | 2 +-
 lib/pdump/meson.build        | 2 +-
 lib/pipeline/meson.build     | 2 +-
 lib/port/meson.build         | 2 +-
 lib/power/meson.build        | 3 +--
 lib/rawdev/meson.build       | 2 --
 lib/rcu/meson.build          | 2 +-
 lib/regexdev/meson.build     | 2 +-
 lib/reorder/meson.build      | 2 +-
 lib/rib/meson.build          | 2 +-
 lib/ring/meson.build         | 1 -
 lib/sched/meson.build        | 2 +-
 lib/security/meson.build     | 2 +-
 lib/table/meson.build        | 2 +-
 lib/telemetry/meson.build    | 2 +-
 lib/vhost/meson.build        | 2 +-
 49 files changed, 46 insertions(+), 61 deletions(-)
lib/argparse/meson.build +1 -1
index b6a08ca049..96abc8766f 100644
@@ -4,4 +4,4 @@
 sources = files('rte_argparse.c')
 headers = files('rte_argparse.h')
 
-deps += ['log']
+deps = ['log']
lib/bbdev/meson.build +1 -1
index 07685e7578..2e68aa7873 100644
@@ -11,4 +11,4 @@ sources = files('rte_bbdev.c')
 headers = files('rte_bbdev.h',
         'rte_bbdev_pmd.h',
         'rte_bbdev_op.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/bitratestats/meson.build +1 -1
index ede7e0a579..8defcd53bf 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_bitrate.c')
 headers = files('rte_bitrate.h')
-deps += ['ethdev', 'metrics']
+deps = ['metrics']
lib/bpf/meson.build +1 -1
index aa258a9061..82127bc657 100644
@@ -31,7 +31,7 @@ headers = files('bpf_def.h',
         'rte_bpf.h',
         'rte_bpf_ethdev.h')
 
-deps += ['mbuf', 'net', 'ethdev']
+deps = ['ethdev']
 
 dep = dependency('libelf', required: false, method: 'pkg-config')
 if dep.found()
lib/cmdline/meson.build +1 -1
index 63fb69100d..4451f3da29 100644
@@ -31,4 +31,4 @@ else
     sources += files('cmdline_os_unix.c')
 endif
 
-deps += ['net']
+deps = ['net']
lib/compressdev/meson.build +1 -1
index c80295dc0d..4b86955baf 100644
@@ -16,4 +16,4 @@ driver_sdk_headers = files(
         'rte_compressdev_pmd.h',
         'rte_compressdev_internal.h',
     )
-deps += ['kvargs', 'mbuf']
+deps = ['mbuf']
lib/cryptodev/meson.build +1 -1
index 4734acf321..74e42ac700 100644
@@ -20,4 +20,4 @@ driver_sdk_headers += files(
         'cryptodev_pmd.h',
 )
 
-deps += ['kvargs', 'mbuf', 'rcu', 'telemetry']
+deps = ['mbuf', 'rcu']
lib/dispatcher/meson.build +1 -1
index ffaef26a6d..4dc1759951 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_dispatcher.c')
 headers = files('rte_dispatcher.h')
 
-deps += ['eventdev']
+deps = ['eventdev']
lib/distributor/meson.build +1 -1
index 24988c5827..ba43273bc3 100644
@@ -14,4 +14,4 @@ else
     sources += files('rte_distributor_match_generic.c')
 endif
 headers = files('rte_distributor.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/dmadev/meson.build +0 -2
index e66dcb66b0..70b375f1cb 100644
@@ -11,5 +11,3 @@ sources = files('rte_dmadev.c', 'rte_dmadev_trace_points.c')
 headers = files('rte_dmadev.h')
 indirect_headers += files('rte_dmadev_core.h', 'rte_dmadev_trace_fp.h')
 driver_sdk_headers += files('rte_dmadev_pmd.h')
-
-deps += ['telemetry']
lib/eal/meson.build +1 -4
index e1d6c4cf17..d25443d097 100644
@@ -14,10 +14,7 @@ subdir(exec_env)
 
 subdir(arch_subdir)
 
-deps += ['log', 'kvargs']
-if not is_windows
-    deps += ['telemetry']
-endif
+deps = ['kvargs', 'telemetry']
 if dpdk_conf.has('RTE_USE_LIBBSD')
     ext_deps += libbsd
 endif
lib/efd/meson.build +1 -1
index 343f14e1f3..da0ee7f803 100644
@@ -9,4 +9,4 @@ endif
 
 sources = files('rte_efd.c')
 headers = files('rte_efd.h')
-deps += ['ring', 'hash']
+deps = ['hash']
lib/ethdev/meson.build +1 -1
index f1d2586591..fc53a9c309 100644
@@ -53,7 +53,7 @@ if is_linux
     )
 endif
 
-deps += ['net', 'kvargs', 'meter', 'telemetry']
+deps = ['net', 'meter']
 
 if is_freebsd
     annotate_locks = false
lib/eventdev/meson.build +1 -2
index a04bb86f0f..237df998ce 100644
@@ -38,5 +38,4 @@ driver_sdk_headers += files(
         'event_timer_adapter_pmd.h',
 )
 
-deps += ['ring', 'ethdev', 'hash', 'mempool', 'mbuf', 'timer', 'cryptodev', 'dmadev']
-deps += ['telemetry']
+deps = ['ethdev', 'hash', 'timer', 'cryptodev', 'dmadev']
lib/fib/meson.build +1 -3
index 0c19cc8201..ac040d5372 100644
@@ -10,9 +10,7 @@ endif
 
 sources = files('rte_fib.c', 'rte_fib6.c', 'dir24_8.c', 'trie.c')
 headers = files('rte_fib.h', 'rte_fib6.h')
-deps += ['rib']
-deps += ['rcu']
-deps += ['net']
+deps = ['rib', 'rcu']
 
 if dpdk_conf.has('RTE_ARCH_X86_64')
     if target_has_avx512
lib/gpudev/meson.build +1 -1
index d21fadc052..5d883b85a1 100644
@@ -13,4 +13,4 @@ sources = files(
         'gpudev.c',
 )
 
-deps += ['mbuf']
+deps = ['mbuf']
lib/graph/meson.build +1 -1
index 0cb15442ab..f58f107d52 100644
@@ -25,4 +25,4 @@ indirect_headers += files(
         'rte_graph_worker_common.h',
 )
 
-deps += ['eal', 'pcapng', 'mempool', 'ring']
+deps = ['pcapng']
lib/gro/meson.build +1 -1
index dbce05220d..c6de6ceebc 100644
@@ -10,4 +10,4 @@ sources = files(
         'gro_vxlan_udp4.c',
 )
 headers = files('rte_gro.h')
-deps += ['ethdev']
+deps = ['ethdev']
lib/gso/meson.build +1 -1
index 622411df8f..bc99109933 100644
@@ -10,4 +10,4 @@ sources = files(
         'rte_gso.c',
 )
 headers = files('rte_gso.h')
-deps += ['ethdev']
+deps = ['ethdev']
lib/hash/meson.build +1 -3
index 7ce504ee8b..e6cb1ebe3b 100644
@@ -26,6 +26,4 @@ sources = files(
         'rte_thash_gf2_poly_math.c',
 )
 
-deps += ['net']
-deps += ['ring']
-deps += ['rcu']
+deps = ['net', 'rcu']
lib/ip_frag/meson.build +1 -1
index ea2de09f75..cacf391460 100644
@@ -10,4 +10,4 @@ sources = files(
         'ip_frag_internal.c',
 )
 headers = files('rte_ip_frag.h')
-deps += ['ethdev', 'hash']
+deps = ['ethdev', 'hash']
lib/ipsec/meson.build +1 -1
index 5c5a4aae78..7abbac5b6a 100644
@@ -14,6 +14,6 @@ sources = files('esp_inb.c', 'esp_outb.c',
 headers = files('rte_ipsec.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h')
 indirect_headers += files('rte_ipsec_group.h')
 
-deps += ['mbuf', 'net', 'cryptodev', 'security', 'hash', 'telemetry']
+deps = ['security', 'hash']
 
 annotate_locks = false
lib/kvargs/meson.build +1 -1
index 7eae744a8f..7282b0ff8d 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-deps += 'log'
+deps = ['log']
 sources = files('rte_kvargs.c')
 headers = files('rte_kvargs.h')
lib/latencystats/meson.build +1 -1
index 286558dd79..f8b9a8aeec 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_latencystats.c')
 headers = files('rte_latencystats.h')
-deps += ['metrics', 'ethdev']
+deps = ['metrics']
lib/lpm/meson.build +1 -2
index fae4f79fb9..53c2af6f39 100644
@@ -18,6 +18,5 @@ indirect_headers += files(
         'rte_lpm_sse.h',
         'rte_lpm_sve.h',
 )
-deps += ['hash']
+deps = ['hash']
 deps += ['rcu']
-deps += ['net']
lib/mbuf/meson.build +1 -1
index 2cee9057a5..22f5a3038b 100644
@@ -20,4 +20,4 @@ headers = files(
         'rte_mbuf_pool_ops.h',
         'rte_mbuf_dyn.h',
 )
-deps += ['mempool']
+deps = ['mempool']
lib/member/meson.build +1 -1
index 02ef59795e..b951aa566e 100644
@@ -16,7 +16,7 @@ sources = files(
         'rte_member_vbf.c',
 )
 
-deps += ['hash', 'ring']
+deps = ['hash']
 
 # compile AVX512 version if:
 if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
lib/mempool/meson.build +1 -1
index 8099a56466..0c0b3ea0c5 100644
@@ -19,4 +19,4 @@ headers = files(
         'rte_mempool.h',
         'rte_mempool_trace_fp.h',
 )
-deps += ['ring', 'telemetry']
+deps = ['ring']
lib/metrics/meson.build +1 -1
index 8c1c4b4b49..5165967646 100644
@@ -8,4 +8,4 @@ if dpdk_conf.has('RTE_HAS_JANSSON')
     ext_deps += jansson_dep
 endif
 
-deps += ['ethdev', 'telemetry']
+deps = ['ethdev']
lib/mldev/meson.build +1 -1
index 2c933baad6..6069fff1f0 100644
@@ -41,7 +41,7 @@ driver_sdk_headers += files(
         'mldev_utils.h',
 )
 
-deps += ['mempool', 'mbuf']
+deps = ['mbuf']
 
 if get_option('buildtype').contains('debug')
         cflags += [ '-DRTE_LIBRTE_ML_DEV_DEBUG' ]
lib/net/meson.build +1 -1
index 8afcc4ed37..a99d57e514 100644
@@ -37,7 +37,7 @@ sources = files(
         'rte_net.c',
         'rte_net_crc.c',
 )
-deps += ['mbuf']
+deps = ['mbuf']
 
 if dpdk_conf.has('RTE_ARCH_X86_64')
     net_crc_sse42_cpu_support = (cc.get_define('__PCLMUL__', args: machine_args) != '')
lib/node/meson.build +1 -1
index 0bed97a96c..368ce1dc63 100644
@@ -34,4 +34,4 @@ headers = files(
 
 # Strict-aliasing rules are violated by uint8_t[] to context size casts.
 cflags += '-fno-strict-aliasing'
-deps += ['graph', 'mbuf', 'lpm', 'ethdev', 'mempool', 'cryptodev', 'ip_frag']
+deps = ['graph', 'lpm', 'cryptodev', 'ip_frag']
lib/pcapng/meson.build +1 -1
index 4549925d41..e8f059a9b0 100644
@@ -4,4 +4,4 @@
 sources = files('rte_pcapng.c')
 headers = files('rte_pcapng.h')
 
-deps += ['ethdev']
+deps = ['ethdev']
lib/pdcp/meson.build +1 -1
index f4f9246bcb..f6f3d6237a 100644
@@ -18,4 +18,4 @@ sources = files(
 headers = files('rte_pdcp.h')
 indirect_headers += files('rte_pdcp_group.h')
 
-deps += ['mbuf', 'net', 'cryptodev', 'security', 'reorder']
+deps = ['security', 'reorder']
lib/pdump/meson.build +1 -1
index da8d51b616..23d7db794b 100644
@@ -9,4 +9,4 @@ endif
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev', 'bpf', 'pcapng']
+deps = ['bpf', 'pcapng']
lib/pipeline/meson.build +1 -1
index fd5e0dc6bb..f08eca70d1 100644
@@ -25,4 +25,4 @@ headers = files(
         'rte_swx_extern.h',
         'rte_swx_ctl.h',
 )
-deps += ['port', 'table', 'meter', 'sched', 'cryptodev', 'ipsec']
+deps = ['table', 'ipsec']
lib/port/meson.build +1 -1
index b597772872..0524c3c049 100644
@@ -40,7 +40,7 @@ headers = files(
         'rte_swx_port_ring.h',
         'rte_swx_port_source_sink.h',
 )
-deps += ['ethdev', 'sched', 'ip_frag', 'cryptodev', 'eventdev']
+deps = ['sched', 'ip_frag', 'eventdev']
 
 if dpdk_conf.has('RTE_HAS_LIBPCAP')
     dpdk_conf.set('RTE_PORT_PCAP', 1)
lib/power/meson.build +1 -2
index b3a7bc7b2e..5673db4e5c 100644
@@ -26,5 +26,4 @@ headers = files(
         'rte_power_qos.h',
         'rte_power_uncore.h',
 )
-
-deps += ['timer', 'ethdev']
+deps = ['timer', 'ethdev']
lib/rawdev/meson.build +0 -2
index 7dfc3d5cf9..8841f003d7 100644
@@ -9,5 +9,3 @@ endif
 
 sources = files('rte_rawdev.c')
 headers = files('rte_rawdev.h', 'rte_rawdev_pmd.h')
-
-deps += ['telemetry']
lib/rcu/meson.build +1 -1
index 71143f5210..b78f46fad7 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_rcu_qsbr.c')
 headers = files('rte_rcu_qsbr.h')
 
-deps += ['ring']
+deps = ['ring']
lib/regexdev/meson.build +1 -1
index 426e764ece..3e20fa387d 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_regexdev.c')
 headers = files('rte_regexdev.h', 'rte_regexdev_driver.h')
 indirect_headers += files('rte_regexdev_core.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/reorder/meson.build +1 -1
index 03aed53d90..1e088a7d97 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_reorder.c')
 headers = files('rte_reorder.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/rib/meson.build +1 -1
index e98f708481..2cb6580874 100644
@@ -4,4 +4,4 @@
 
 sources = files('rte_rib.c', 'rte_rib6.c')
 headers = files('rte_rib.h', 'rte_rib6.h')
-deps += ['net', 'mempool']
+deps = ['net', 'mempool']
lib/ring/meson.build +0 -1
index 7fca958ed7..c20685c689 100644
@@ -18,4 +18,3 @@ indirect_headers += files (
         'rte_ring_rts.h',
         'rte_ring_rts_elem_pvt.h',
 )
-deps += ['telemetry']
lib/sched/meson.build +1 -1
index df75db51ed..7ca8ec09df 100644
@@ -15,4 +15,4 @@ headers = files(
         'rte_sched_common.h',
         'rte_pie.h',
 )
-deps += ['mbuf', 'meter']
+deps = ['mbuf', 'meter']
lib/security/meson.build +1 -1
index 1034a7a299..e4545a8c72 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_security.c')
 headers = files('rte_security.h', 'rte_security_driver.h')
-deps += ['mempool', 'cryptodev', 'net']
+deps = ['cryptodev', 'net']
lib/table/meson.build +1 -1
index 9b3d9ac759..78d7e87eab 100644
@@ -39,7 +39,7 @@ headers = files(
         'rte_table_lpm_ipv6.h',
         'rte_table_stub.h',
 )
-deps += ['mbuf', 'port', 'lpm', 'hash', 'acl']
+deps = ['port', 'lpm', 'acl']
 
 indirect_headers += files(
         'rte_lru_arm64.h',
lib/telemetry/meson.build +1 -1
index 489d000047..3e3a2cfc32 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-deps += 'log'
+deps = ['log']
 sources = files('telemetry.c', 'telemetry_data.c', 'telemetry_legacy.c')
 headers = files('rte_telemetry.h')
 includes += include_directories('../metrics')
lib/vhost/meson.build +1 -1
index 51bcf17244..5103bca069 100644
@@ -45,4 +45,4 @@ headers = files(
 driver_sdk_headers = files(
         'vdpa_driver.h',
 )
-deps += ['ethdev', 'cryptodev', 'hash', 'pci', 'dmadev']
+deps = ['ethdev', 'cryptodev', 'hash', 'pci', 'dmadev']
Signature · 1 line
2.43.5
#38 lore raw

PATCH v4 6/8 build: reduce driver dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Remove any unnecessary dependencies from the driver dependency lists. This will give each driver a near-minimum set of required dependencies.

---
 drivers/baseband/fpga_5gnr_fec/meson.build | 2 +-
 drivers/baseband/fpga_lte_fec/meson.build  | 2 +-
 drivers/baseband/la12xx/meson.build        | 2 +-
 drivers/baseband/null/meson.build          | 2 +-
 drivers/baseband/turbo_sw/meson.build      | 2 +-
 drivers/bus/auxiliary/meson.build          | 2 --
 drivers/bus/dpaa/meson.build               | 2 +-
 drivers/bus/fslmc/meson.build              | 2 +-
 drivers/bus/ifpga/meson.build              | 2 +-
 drivers/bus/pci/meson.build                | 4 +---
 drivers/bus/platform/meson.build           | 1 -
 drivers/bus/uacce/meson.build              | 2 --
 drivers/bus/vdev/meson.build               | 2 --
 drivers/common/cnxk/meson.build            | 4 ++--
 drivers/common/cpt/meson.build             | 2 +-
 drivers/common/idpf/meson.build            | 2 +-
 drivers/common/mlx5/meson.build            | 2 +-
 drivers/compress/mlx5/meson.build          | 2 +-
 drivers/compress/nitrox/meson.build        | 2 +-
 drivers/compress/octeontx/meson.build      | 2 +-
 drivers/crypto/bcmfs/meson.build           | 2 +-
 drivers/crypto/cnxk/meson.build            | 2 +-
 drivers/crypto/dpaa_sec/meson.build        | 2 +-
 drivers/crypto/ipsec_mb/meson.build        | 2 +-
 drivers/crypto/mlx5/meson.build            | 2 +-
 drivers/crypto/nitrox/meson.build          | 2 +-
 drivers/dma/cnxk/meson.build               | 2 +-
 drivers/dma/dpaa/meson.build               | 2 +-
 drivers/dma/dpaa2/meson.build              | 2 +-
 drivers/dma/odm/meson.build                | 2 +-
 drivers/dma/skeleton/meson.build           | 2 +-
 drivers/event/cnxk/meson.build             | 2 +-
 drivers/event/dlb2/meson.build             | 2 +-
 drivers/event/dpaa2/meson.build            | 2 +-
 drivers/event/octeontx/meson.build         | 3 +--
 drivers/event/sw/meson.build               | 2 +-
 drivers/mempool/cnxk/meson.build           | 2 +-
 drivers/mempool/dpaa/meson.build           | 2 +-
 drivers/mempool/dpaa2/meson.build          | 2 +-
 drivers/mempool/octeontx/meson.build       | 2 +-
 drivers/net/cnxk/meson.build               | 4 +---
 drivers/net/iavf/meson.build               | 2 +-
 drivers/net/ice/meson.build                | 2 +-
 drivers/net/mana/meson.build               | 2 +-
 drivers/net/mlx5/meson.build               | 2 +-
 drivers/net/sfc/meson.build                | 2 +-
 drivers/net/softnic/meson.build            | 2 +-
 drivers/raw/cnxk_bphy/meson.build          | 2 +-
 drivers/raw/cnxk_gpio/meson.build          | 2 +-
 drivers/raw/ntb/meson.build                | 2 +-
 drivers/raw/skeleton/meson.build           | 2 +-
 drivers/regex/mlx5/meson.build             | 2 +-
 drivers/vdpa/ifc/meson.build               | 2 +-
 drivers/vdpa/meson.build                   | 3 +--
 drivers/vdpa/mlx5/meson.build              | 2 +-
 drivers/vdpa/sfc/meson.build               | 2 +-
 56 files changed, 53 insertions(+), 66 deletions(-)
drivers/baseband/fpga_5gnr_fec/meson.build +1 -1
index c3678d23eb..31b9e92fbb 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2020 Intel Corporation
 
-deps += ['bus_vdev', 'ring', 'pci', 'bus_pci']
+deps += ['bus_vdev', 'bus_pci']
 
 sources = files('rte_fpga_5gnr_fec.c')
 
drivers/baseband/fpga_lte_fec/meson.build +1 -1
index 14e07826ef..fbf24755db 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Intel Corporation
 
-deps += ['bus_vdev', 'ring', 'pci', 'bus_pci']
+deps += ['bus_vdev', 'bus_pci']
 sources = files('fpga_lte_fec.c')
drivers/baseband/la12xx/meson.build +1 -1
index 7b7e41c961..e1dbdd0fa7 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2020-2021 NXP
 
-deps += ['bus_vdev', 'ring']
+deps += ['bus_vdev']
 
 sources = files('bbdev_la12xx.c')
drivers/baseband/null/meson.build +1 -1
index 22863f0bd8..716d6c6fdb 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <[email protected]>
 
-deps += ['bus_vdev', 'ring']
+deps += ['bus_vdev']
 sources = files('bbdev_null.c')
drivers/baseband/turbo_sw/meson.build +1 -1
index a9035a753e..ac18e8a9b6 100644
@@ -26,5 +26,5 @@ if dep_dec5g.found()
     cflags += ['-DRTE_BBDEV_SDK_AVX512']
 endif
 
-deps += ['bus_vdev', 'ring']
+deps += ['bus_vdev']
 sources = files('bbdev_turbo_software.c')
drivers/bus/auxiliary/meson.build +0 -2
index 10468fd130..a113f11743 100644
@@ -13,5 +13,3 @@ if is_linux
 endif
 
 require_iova_in_mbuf = false
-
-deps += ['kvargs']
drivers/bus/dpaa/meson.build +1 -1
index 5506f2bffc..a2314fdebe 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_dpaax', 'eventdev']
+deps = ['common_dpaax', 'eventdev']
 sources = files(
         'base/fman/fman.c',
         'base/fman/fman_hw.c',
drivers/bus/fslmc/meson.build +1 -1
index 70098ad778..a0e11f7081 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_dpaax', 'eventdev', 'kvargs']
+deps = ['common_dpaax', 'eventdev']
 sources = files(
         'fslmc_bus.c',
         'fslmc_vfio.c',
drivers/bus/ifpga/meson.build +1 -1
index dedc94db2d..e87b08eaf4 100644
@@ -7,6 +7,6 @@ if is_windows
     subdir_done()
 endif
 
-deps += ['pci', 'kvargs', 'rawdev']
+deps = ['pci', 'rawdev']
 driver_sdk_headers += files('bus_ifpga_driver.h')
 sources = files('ifpga_bus.c')
drivers/bus/pci/meson.build +1 -3
index fede114dc7..776c3d1550 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-deps += ['pci']
+deps = ['pci']
 headers = files('rte_bus_pci.h')
 driver_sdk_headers = files('bus_pci_driver.h')
 sources = files('pci_common.c',
@@ -31,5 +31,3 @@ if is_windows
 endif
 
 require_iova_in_mbuf = false
-
-deps += ['kvargs']
drivers/bus/platform/meson.build +0 -1
index 8633cc4e75..2039c23ac6 100644
@@ -10,7 +10,6 @@ endif
 
 require_iova_in_mbuf = false
 
-deps += ['kvargs']
 sources = files(
         'platform_params.c',
         'platform.c',
drivers/bus/uacce/meson.build +0 -2
index a659d65f23..130148a315 100644
@@ -8,5 +8,3 @@ endif
 
 sources = files('uacce.c')
 driver_sdk_headers += files('bus_uacce_driver.h')
-
-deps += ['kvargs']
drivers/bus/vdev/meson.build +0 -2
index 50f0c8918d..24993c88a3 100644
@@ -9,5 +9,3 @@ headers = files('rte_bus_vdev.h')
 driver_sdk_headers = files('bus_vdev_driver.h')
 
 require_iova_in_mbuf = false
-
-deps += ['kvargs']
drivers/common/cnxk/meson.build +2 -2
index 9e3fd44317..e4ee9474f6 100644
@@ -8,7 +8,7 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     subdir_done()
 endif
 
-deps = ['eal', 'pci', 'bus_pci', 'mbuf', 'security']
+deps = ['bus_pci', 'security']
 sources = files(
         'roc_ae.c',
         'roc_aes.c',
@@ -105,7 +105,7 @@ elif soc_type == 'cn20k'
     dpdk_conf.set('ROC_PLATFORM_CN20K', 1)
 endif
 
-deps += ['bus_pci', 'net', 'telemetry']
+deps += ['bus_pci']
 
 require_iova_in_mbuf = false
 
drivers/common/cpt/meson.build +1 -1
index c09824a651..a4b000dc37 100644
@@ -9,5 +9,5 @@ endif
 
 sources = files('cpt_fpm_tables.c', 'cpt_pmd_ops_helper.c')
 
-deps = ['kvargs', 'pci', 'cryptodev']
+deps = ['pci', 'cryptodev']
 includes += include_directories('../../crypto/octeontx')
drivers/common/idpf/meson.build +1 -1
index 46fd45c03b..e24daac761 100644
@@ -7,7 +7,7 @@ endif
 
 includes += include_directories('../iavf')
 
-deps += ['mbuf']
+deps = ['mbuf']
 
 sources = files(
         'idpf_common_device.c',
drivers/common/mlx5/meson.build +1 -1
index 1eefc02f06..b94c956495 100644
@@ -12,7 +12,7 @@ if is_windows and not is_ms_linker and not meson.is_cross_build()
     subdir_done()
 endif
 
-deps += ['hash', 'pci', 'bus_pci', 'bus_auxiliary', 'net', 'eal', 'kvargs']
+deps += ['hash', 'bus_pci', 'bus_auxiliary']
 sources += files(
         'mlx5_devx_cmds.c',
         'mlx5_common.c',
drivers/compress/mlx5/meson.build +1 -1
index 26a0e0cd09..ddb9e0f82c 100644
@@ -7,7 +7,7 @@ if not is_linux
     subdir_done()
 endif
 
-deps += ['common_mlx5', 'eal', 'compressdev']
+deps += ['common_mlx5', 'compressdev']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/compress/nitrox/meson.build +1 -1
index 1becc66912..c3db4ac2bb 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_nitrox', 'bus_pci', 'compressdev']
+deps += ['common_nitrox', 'compressdev']
 
 sources += files(
         'nitrox_comp.c',
drivers/compress/octeontx/meson.build +1 -1
index 16f973f4d7..0ccde449e8 100644
@@ -9,7 +9,7 @@ endif
 
 sources = files('otx_zip.c', 'otx_zip_pmd.c')
 includes += include_directories('include')
-deps += ['mempool_octeontx', 'bus_pci']
+deps += ['mempool_octeontx']
 ext_deps += dep
 
 require_iova_in_mbuf = false
drivers/crypto/bcmfs/meson.build +1 -1
index 5842f83a3b..678bab7398 100644
@@ -9,7 +9,7 @@ if is_windows
     subdir_done()
 endif
 
-deps += ['eal', 'bus_vdev']
+deps += ['bus_vdev']
 sources = files(
         'bcmfs_logs.c',
         'bcmfs_device.c',
drivers/crypto/cnxk/meson.build +1 -1
index aa840fb7bb..c5a5725e1a 100644
@@ -25,7 +25,7 @@ sources = files(
 )
 
 headers = files('rte_pmd_cnxk_crypto.h')
-deps += ['bus_pci', 'common_cnxk', 'security', 'eventdev']
+deps += ['common_cnxk', 'eventdev']
 includes += include_directories('../../../lib/net', '../../event/cnxk')
 
 if get_option('buildtype').contains('debug')
drivers/crypto/dpaa_sec/meson.build +1 -1
index f87ad6c7e7..9efac952c4 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['bus_dpaa', 'mempool_dpaa', 'security']
+deps += ['mempool_dpaa', 'security']
 sources = files('dpaa_sec.c', 'dpaa_sec_raw_dp.c')
 
 includes += include_directories('../../bus/dpaa/include')
drivers/crypto/ipsec_mb/meson.build +1 -1
index 89ee03454b..01198cca68 100644
@@ -45,5 +45,5 @@ sources = files(
         'pmd_snow3g.c',
         'pmd_zuc.c',
 )
-deps += ['bus_vdev', 'net', 'security']
+deps += ['bus_vdev', 'security']
 require_iova_in_mbuf = false
drivers/crypto/mlx5/meson.build +1 -1
index d7bc8ec967..595053d8cd 100644
@@ -7,7 +7,7 @@ if not (is_linux or is_windows)
     subdir_done()
 endif
 
-deps += ['common_mlx5', 'eal', 'cryptodev']
+deps += ['common_mlx5', 'cryptodev']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/crypto/nitrox/meson.build +1 -1
index f8887713d2..85e3ca2b28 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_nitrox', 'bus_pci', 'cryptodev']
+deps += ['common_nitrox', 'cryptodev']
 
 sources += files(
         'nitrox_sym.c',
drivers/dma/cnxk/meson.build +1 -1
index 8ccc1c2cb7..738774d542 100644
@@ -12,7 +12,7 @@ driver_sdk_headers = files(
         'cnxk_dma_event_dp.h',
 )
 
-deps += ['bus_pci', 'common_cnxk', 'dmadev', 'eventdev']
+deps += ['common_cnxk', 'eventdev']
 
 includes += include_directories('../../event/cnxk')
 
drivers/dma/dpaa/meson.build +1 -1
index c31a6d91fe..fec4a45767 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on linux'
 endif
 
-deps += ['dmadev', 'bus_dpaa']
+deps += ['bus_dpaa']
 sources = files('dpaa_qdma.c')
 
 if cc.has_argument('-Wno-pointer-arith')
drivers/dma/dpaa2/meson.build +1 -1
index a523f5edb4..cc4a02440e 100644
@@ -8,7 +8,7 @@ endif
 
 build = dpdk_conf.has('RTE_MEMPOOL_DPAA2')
 reason = 'missing dependency, DPDK DPAA2 mempool driver'
-deps += ['dmadev', 'bus_fslmc', 'mempool_dpaa2', 'ring', 'kvargs']
+deps += ['mempool_dpaa2']
 sources = files('dpaa2_qdma.c')
 
 if cc.has_argument('-Wno-pointer-arith')
drivers/dma/odm/meson.build +1 -1
index d597762d37..959e7e685d 100644
@@ -7,7 +7,7 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     subdir_done()
 endif
 
-deps += ['bus_pci', 'dmadev', 'eal', 'mempool', 'pci']
+deps += ['bus_pci', 'dmadev', 'mempool']
 
 sources = files('odm_dmadev.c', 'odm.c')
 
drivers/dma/skeleton/meson.build +1 -1
index 77055683ad..0d703a36eb 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2021 HiSilicon Limited
 
-deps += ['dmadev', 'kvargs', 'ring', 'bus_vdev']
+deps += ['dmadev', 'ring', 'bus_vdev']
 sources = files(
         'skeleton_dmadev.c',
 )
drivers/event/cnxk/meson.build +1 -1
index 8aaf8116f7..e944f4277f 100644
@@ -311,7 +311,7 @@ foreach flag: extra_flags
 endforeach
 
 headers = files('rte_pmd_cnxk_eventdev.h')
-deps += ['bus_pci', 'common_cnxk', 'net_cnxk', 'crypto_cnxk', 'dma_cnxk']
+deps += ['net_cnxk', 'crypto_cnxk', 'dma_cnxk']
 
 require_iova_in_mbuf = false
 
drivers/event/dlb2/meson.build +1 -1
index c024edb311..2bb1b97686 100644
@@ -39,4 +39,4 @@ endif
 
 headers = files('rte_pmd_dlb2.h')
 
-deps += ['mbuf', 'mempool', 'ring', 'pci', 'bus_pci']
+deps += ['bus_pci']
drivers/event/dpaa2/meson.build +1 -1
index dd5063af43..7dae1da32b 100644
@@ -5,7 +5,7 @@ if not is_linux
     build = false
     reason = 'only supported on Linux'
 endif
-deps += ['bus_vdev', 'net_dpaa2', 'crypto_dpaa2_sec']
+deps += ['net_dpaa2', 'crypto_dpaa2_sec']
 sources = files(
         'dpaa2_hw_dpcon.c',
         'dpaa2_eventdev.c',
drivers/event/octeontx/meson.build +1 -2
index eb17e059d8..1227b2e18d 100644
@@ -17,5 +17,4 @@ sources = files(
         'timvf_probe.c',
 )
 
-deps += ['common_octeontx', 'mempool_octeontx', 'bus_vdev', 'net_octeontx']
-deps += ['crypto_octeontx']
+deps = ['net_octeontx', 'crypto_octeontx']
drivers/event/sw/meson.build +1 -1
index 3a3ebd72a3..450969aa7a 100644
@@ -8,5 +8,5 @@ sources = files(
         'sw_evdev_xstats.c',
         'sw_evdev.c',
 )
-deps += ['hash', 'bus_vdev']
+deps += ['bus_vdev']
 require_iova_in_mbuf = false
drivers/mempool/cnxk/meson.build +1 -1
index e388cce26a..7bbed325df 100644
@@ -18,5 +18,5 @@ sources = files(
 )
 
 headers = files('rte_pmd_cnxk_mempool.h')
-deps += ['eal', 'mbuf', 'kvargs', 'bus_pci', 'common_cnxk', 'mempool']
+deps = ['common_cnxk']
 require_iova_in_mbuf = false
drivers/mempool/dpaa/meson.build +1 -1
index c4e9994b83..39fc312344 100644
@@ -6,5 +6,5 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['bus_dpaa']
+deps = ['bus_dpaa']
 sources = files('dpaa_mempool.c')
drivers/mempool/dpaa2/meson.build +1 -1
index 3d16d44158..0099b20b97 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['bus_fslmc']
+deps = ['bus_fslmc']
 sources = files('dpaa2_hw_mempool.c')
 
 headers = files('rte_dpaa2_mempool.h')
drivers/mempool/octeontx/meson.build +1 -1
index 3ccecac75d..f97bcf4a5a 100644
@@ -12,6 +12,6 @@ sources = files(
         'rte_mempool_octeontx.c',
 )
 
-deps += ['mbuf', 'bus_pci', 'common_octeontx']
+deps = ['mbuf', 'bus_pci', 'common_octeontx']
 
 require_iova_in_mbuf = false
drivers/net/cnxk/meson.build +1 -3
index 32ff8aadc0..48a546adb8 100644
@@ -320,9 +320,7 @@ sources += files(
 endif
 endif
 
-
-deps += ['bus_pci', 'cryptodev', 'eventdev', 'security']
-deps += ['common_cnxk', 'mempool_cnxk']
+deps = ['eventdev', 'mempool_cnxk']
 
 # Allow implicit vector conversions and strict aliasing warning
 extra_flags = ['-flax-vector-conversions', '-Wno-strict-aliasing']
drivers/net/iavf/meson.build +1 -1
index b48bb83438..4849c2341a 100644
@@ -9,7 +9,7 @@ includes += include_directories('../../common/iavf')
 
 testpmd_sources = files('iavf_testpmd.c')
 
-deps += ['common_iavf', 'security', 'cryptodev']
+deps += ['common_iavf', 'security']
 
 sources = files(
         'iavf_ethdev.c',
drivers/net/ice/meson.build +1 -1
index 1c9dc0cc6d..f9e37f5386 100644
@@ -18,7 +18,7 @@ sources = files(
 
 testpmd_sources = files('ice_testpmd.c')
 
-deps += ['hash', 'net', 'common_iavf']
+deps += ['hash', 'common_iavf']
 includes += include_directories('base', '../../common/iavf')
 
 if arch_subdir == 'x86'
drivers/net/mana/meson.build +1 -1
index 4d163fc0f2..68f03fd60d 100644
@@ -7,7 +7,7 @@ if not is_linux or not (dpdk_conf.has('RTE_ARCH_X86') or dpdk_conf.has('RTE_ARCH
     subdir_done()
 endif
 
-deps += ['pci', 'bus_pci', 'net', 'eal', 'kvargs']
+deps += ['bus_pci']
 
 sources += files(
         'gdma.c',
drivers/net/mlx5/meson.build +1 -1
index 78a8648b43..7c4a63524f 100644
@@ -8,7 +8,7 @@ if not (is_linux or is_windows)
     subdir_done()
 endif
 
-deps += ['hash', 'common_mlx5']
+deps += ['common_mlx5']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/net/sfc/meson.build +1 -1
index 5adde68517..820ee6c91e 100644
@@ -71,7 +71,7 @@ if not cc.links(atomic_check_code)
     ext_deps += libatomic_dep
 endif
 
-deps += ['common_sfc_efx', 'bus_pci', 'hash']
+deps += ['common_sfc_efx', 'hash']
 sources = files(
         'sfc_ethdev.c',
         'sfc_kvargs.c',
drivers/net/softnic/meson.build +1 -1
index 5dfbd16c77..1529ef38f9 100644
@@ -15,4 +15,4 @@ sources = files(
         'rte_eth_softnic_swq.c',
         'rte_eth_softnic_thread.c',
 )
-deps += ['pipeline', 'port', 'table']
+deps += ['pipeline']
drivers/raw/cnxk_bphy/meson.build +1 -1
index bb5d2ffb80..b38b071697 100644
@@ -2,7 +2,7 @@
 # Copyright(C) 2021 Marvell.
 #
 
-deps += ['bus_pci', 'common_cnxk', 'rawdev']
+deps += ['common_cnxk', 'rawdev']
 sources = files(
         'cnxk_bphy.c',
         'cnxk_bphy_cgx.c',
drivers/raw/cnxk_gpio/meson.build +1 -1
index 9d9a527392..6d17fe573f 100644
@@ -2,7 +2,7 @@
 # Copyright(C) 2021 Marvell.
 #
 
-deps += ['bus_vdev', 'common_cnxk', 'rawdev', 'kvargs']
+deps += ['bus_vdev', 'common_cnxk', 'rawdev']
 sources = files(
         'cnxk_gpio.c',
         'cnxk_gpio_irq.c',
drivers/raw/ntb/meson.build +1 -1
index 9096f2b25a..8f79d3b16a 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Intel Corporation.
 
-deps += ['rawdev', 'mbuf', 'mempool', 'pci', 'bus_pci']
+deps += ['rawdev', 'mbuf', 'bus_pci']
 sources = files('ntb.c',
                 'ntb_hw_intel.c')
 headers = files('rte_pmd_ntb.h')
drivers/raw/skeleton/meson.build +1 -1
index 9d5fcf6514..7d76fe71b3 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-deps += ['rawdev', 'kvargs', 'mbuf', 'bus_vdev']
+deps += ['rawdev', 'mbuf', 'bus_vdev']
 sources = files(
         'skeleton_rawdev.c',
         'skeleton_rawdev_test.c',
drivers/regex/mlx5/meson.build +1 -1
index 6070b37501..f75bf2e084 100644
@@ -7,7 +7,7 @@ if not is_linux
     subdir_done()
 endif
 
-deps += ['common_mlx5', 'eal']
+deps += ['common_mlx5']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/vdpa/ifc/meson.build +1 -1
index f78d36a715..f4ed4f491f 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-deps += 'vhost'
+deps += 'bus_pci'
 sources = files('ifcvf_vdpa.c', 'base/ifcvf.c')
 includes += include_directories('base')
drivers/vdpa/meson.build +1 -2
index e01c277b9e..747cdc7c55 100644
@@ -11,5 +11,4 @@ drivers = [
         'nfp',
         'sfc',
 ]
-std_deps = ['bus_pci']
-std_deps += ['vhost']
+std_deps = ['vhost']
drivers/vdpa/mlx5/meson.build +1 -1
index e224d1bcc9..1263ac43a4 100644
@@ -7,7 +7,7 @@ if not is_linux
     subdir_done()
 endif
 
-deps += ['hash', 'common_mlx5', 'vhost', 'pci', 'eal', 'sched']
+deps += ['common_mlx5', 'vhost', 'sched']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/vdpa/sfc/meson.build +1 -1
index 933f3f18f3..465ca9f220 100644
@@ -16,7 +16,7 @@ foreach flag: extra_flags
     endif
 endforeach
 
-deps += ['common_sfc_efx', 'bus_pci']
+deps += ['common_sfc_efx']
 sources = files(
         'sfc_vdpa.c',
         'sfc_vdpa_hw.c',
Signature · 1 line
2.43.5
Reviewed-by on v4 6/8
#39 lore raw

RE: [PATCH v4 6/8] build: reduce driver dependencies

Hi,

Quoted 60 lines

-----Original Message-----
From: Burakov, Anatoly <[email protected]>
Sent: Tuesday, November 26, 2024 10:40 PM
To: [email protected]; Chautru, Nicolas <[email protected]>; Gagandeep Singh <[email protected]>; Hemant Agrawal <[email protected]>; Parav Pandit <[email protected]>; Xueming Li <[email protected]>; Sachin Saxena <[email protected]>; Xu, Rosen <[email protected]>; Chenbo Xia <[email protected]>; Nipun Gupta <[email protected]>; Tomasz Duszynski <[email protected]>; Chengwen Feng <[email protected]>; Nithin Dabilpuram <[email protected]>; Kiran Kumar K <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Rao <[email protected]>; Harman Kalra <[email protected]>; Anoob Joseph <[email protected]>; Wu, Jingjing <[email protected]>; Shetty, Praveen <[email protected]>; Dariusz Sosnowski <[email protected]>; Viacheslav Ovsiienko <[email protected]>; Bing Zhao <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>; Matan Azrad <[email protected]>; Fan Zhang <[email protected]>; Ashish Gupta <[email protected]>; Nagadheeraj Rottela <[email protected]>; Ajit Khaparde <[email protected]>; Vikas Gupta <[email protected]>; Ankur Dwivedi <[email protected]>; Tejasree Kondoj <[email protected]>; Ji, Kai <[email protected]>; De Lara Guarch, Pablo <[email protected]>; Srikanth Jampala <[email protected]>; Vamsi Attunuru <[email protected]>; Gowrishankar Muthukrishnan <[email protected]>; Vidya Sagar Velumuri <[email protected]>; Laatz, Kevin <[email protected]>; Richardson, Bruce <[email protected]>; Pavan Nikhilesh <[email protected]>; Shijith Thotton <[email protected]>; Pathak, Pravin <[email protected]>; Jerin Jacob <[email protected]>; Van Haaren, Harry <[email protected]>; Ashwin Sekhar T K <[email protected]>; Medvedkin, Vladimir <[email protected]>; Stokes, Ian <[email protected]>; Long Li <[email protected]>; Wei Hu <[email protected]>; Andrew Rybchenko <[email protected]>; Dumitrescu, Cristian <[email protected]>; Jakub Palider <[email protected]>; Vijay Kumar Srivastava <[email protected]>
Subject: [PATCH v4 6/8] build: reduce driver dependencies

From: Bruce Richardson <[email protected]>

Remove any unnecessary dependencies from the driver dependency lists. This will give each driver a near-minimum set of required dependencies.

---
 drivers/bus/ifpga/meson.build              | 2 +-
drivers/bus/ifpga/meson.build +1 -1
index dedc94db2d..e87b08eaf4 100644
@@ -7,6 +7,6 @@ if is_windows
     subdir_done()
 endif
 
-deps += ['pci', 'kvargs', 'rawdev']
+deps = ['pci', 'rawdev']
 driver_sdk_headers += files('bus_ifpga_driver.h')  sources =
Quoted 2 lines

files('ifpga_bus.c') diff --git a/drivers/bus/pci/meson.build b/drivers/bus/pci/meson.build index fede114dc7..776c3d1550 100644

#40 lore raw

PATCH v4 7/8 build: reduce app dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Remove any unnecessary dependencies from the app dependency lists. This will give each app a near-minimum set of required dependencies.

---
 app/dumpcap/meson.build          | 2 +-
 app/graph/meson.build            | 2 +-
 app/pdump/meson.build            | 2 +-
 app/proc-info/meson.build        | 2 +-
 app/test-crypto-perf/meson.build | 2 +-
 app/test-fib/meson.build         | 2 +-
 app/test-sad/meson.build         | 2 +-
 app/test/meson.build             | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)
app/dumpcap/meson.build +1 -1
index 69c016c780..6204cf051a 100644
@@ -14,4 +14,4 @@ endif
 
 ext_deps += pcap_dep
 sources = files('main.c')
-deps += ['ethdev', 'pdump', 'pcapng', 'bpf']
+deps += ['pdump']
app/graph/meson.build +1 -1
index 344e4a418f..9c4cd080d9 100644
@@ -9,7 +9,7 @@ if not build
     subdir_done()
 endif
 
-deps += ['graph', 'eal', 'lpm', 'ethdev', 'node', 'cmdline', 'net']
+deps += ['node', 'cmdline']
 sources = files(
         'cli.c',
         'conn.c',
app/pdump/meson.build +1 -1
index fb282bba1f..a10f9d6124 100644
@@ -8,4 +8,4 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ethdev', 'kvargs', 'pdump']
+deps += ['pdump']
app/proc-info/meson.build +1 -1
index 156592119b..24b75b9ace 100644
@@ -8,7 +8,7 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ethdev', 'security', 'eventdev']
+deps += ['security', 'eventdev']
 if dpdk_conf.has('RTE_LIB_METRICS')
     optional_deps += 'metrics'
 endif
app/test-crypto-perf/meson.build +1 -1
index 05c71e0a0c..8904f8607d 100644
@@ -19,7 +19,7 @@ sources = files(
         'cperf_test_verify.c',
         'main.c',
 )
-deps += ['cryptodev', 'net', 'security']
+deps += ['cryptodev']
 if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
     optional_deps += 'crypto_scheduler'
 endif
app/test-fib/meson.build +1 -1
index eb36772cf3..25e2ea1a1d 100644
@@ -8,4 +8,4 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['fib', 'lpm', 'net']
+deps += ['fib', 'lpm']
app/test-sad/meson.build +1 -1
index a50616a9c7..414e2a05cb 100644
@@ -8,4 +8,4 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ipsec', 'net']
+deps += ['ipsec']
app/test/meson.build +1 -1
index 9383b241a5..c7c90f1267 100644
@@ -2,7 +2,7 @@
 # Copyright(c) 2017-2023 Intel Corporation
 
 # the main test files [test.c and commands.c] relies on these libraries
-deps += ['cmdline', 'ring', 'mempool', 'mbuf']
+deps += ['cmdline']
 sources += files('commands.c', 'test.c')
 
 # optional dependencies: some files may use these - and so we should link them in -
Signature · 1 line
2.43.5
#41 lore raw

PATCH v4 8/8 devtools: add script to generate DPDK dependency graphs

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Rather than the single monolithic graph that would be output from the deps.dot file in a build directory, we can post-process that to generate simpler graphs for different tasks. This new "draw_dependency_graphs" script takes the "deps.dot" as input and generates an output file that has the nodes categorized, filtering them based off the requested node or category. For example, use "--match net/ice" to show the dependency tree from that driver, or "--match lib" to show just the library dependency tree.

---
 devtools/draw-dependency-graphs.py | 223 +++++++++++++++++++++++++++++
 1 file changed, 223 insertions(+)
 create mode 100755 devtools/draw-dependency-graphs.py
devtools/draw-dependency-graphs.py new file +223 -0
new file mode 100755
index 0000000000..4fb765498d
@@ -0,0 +1,223 @@
+#! /usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 Intel Corporation
+
+import argparse
+import collections
+import sys
+import typing as T
+
+# typedef for dependency data types
+Deps = T.Set[str]
+DepData = T.Dict[str, T.Dict[str, T.Dict[bool, Deps]]]
+
+
+def parse_dep_line(line: str) -> T.Tuple[str, Deps, str, bool]:
+    """Parse digraph line into (component, {dependencies}, type, optional)."""
+    # extract attributes first
+    first, last = line.index("["), line.rindex("]")
+    edge_str, attr_str = line[:first], line[first + 1 : last]
+    # key=value, key=value, ...
+    attrs = {
+        key.strip('" '): value.strip('" ')
+        for attr_kv in attr_str.split(",")
+        for key, value in [attr_kv.strip().split("=", 1)]
+    }
+    # check if edge is defined as dotted line, meaning it's optional
+    optional = "dotted" in attrs.get("style", "")
+    try:
+        component_type = attrs["dpdk_componentType"]
+    except KeyError as _e:
+        raise ValueError(f"Error: missing component type: {line}") from _e
+
+    # now, extract component name and any of its dependencies
+    deps: T.Set[str] = set()
+    try:
+        component, deps_str = edge_str.strip('" ').split("->", 1)
+        component = component.strip().strip('" ')
+        deps_str = deps_str.strip().strip("{}")
+        deps = {d.strip('" ') for d in deps_str.split(",")}
+    except ValueError as _e:
+        component = edge_str.strip('" ')
+
+    return component, deps, component_type, optional
+
+
+def gen_dep_line(component: str, deps: T.Set[str], optional: bool) -> str:
+    """Generate a dependency line for a component."""
+    # we use dotted line to represent optional components
+    attr_str = ' [style="dotted"]' if optional else ""
+    dep_list_str = '", "'.join(deps)
+    deps_str = "" if not deps else f' -> {{ "{dep_list_str}" }}'
+    return f'    "{component}"{deps_str}{attr_str}\n'
+
+
+def read_deps_list(lines: T.List[str]) -> DepData:
+    """Read a list of dependency lines into a dictionary."""
+    deps_data: T.Dict[str, T.Any] = {}
+    for ln in lines:
+        if ln.startswith("digraph") or ln == "}":
+            continue
+
+        component, deps, component_type, optional = parse_dep_line(ln)
+
+        # each component will have two sets of dependencies - required and optional
+        c_dict = deps_data.setdefault(component_type, {}).setdefault(component, {})
+        c_dict[optional] = deps
+    return deps_data
+
+
+def create_classified_graph(deps_data: DepData) -> T.Iterator[str]:
+    """Create a graph of dependencies with components classified by type."""
+    yield "digraph dpdk_dependencies {\n  overlap=false\n  model=subset\n"
+    for n, deps_t in enumerate(deps_data.items()):
+        component_type, component_dict = deps_t
+        yield f'  subgraph cluster_{n} {{\n    label = "{component_type}"\n'
+        for component, optional_d in component_dict.items():
+            for optional, deps in optional_d.items():
+                yield gen_dep_line(component, deps, optional)
+        yield "  }\n"
+    yield "}\n"
+
+
+def parse_match(line: str, dep_data: DepData) -> T.List[str]:
+    """Extract list of components from a category string."""
+    # if this is not a compound string, we have very few valid choices
+    if "/" not in line:
+        # is this a category?
+        if line in dep_data:
+            return list(dep_data[line].keys())
+        # this isn't a category. maybe an app name?
+        maybe_app_name = f"dpdk-{line}"
+        if maybe_app_name in dep_data["app"]:
+            return [maybe_app_name]
+        if maybe_app_name in dep_data["examples"]:
+            return [maybe_app_name]
+        # this isn't an app name either, so just look for component with that name
+        for _, component_dict in dep_data.items():
+            if line in component_dict:
+                return [line]
+        # nothing found still. one last try: maybe it's a driver? we have to be careful though
+        # because a driver name may not be unique, e.g. common/iavf and net/iavf. so, only pick
+        # a driver if we can find exactly one driver that matches.
+        found_drivers: T.List[str] = []
+        for component in dep_data["drivers"].keys():
+            _, drv_name = component.split("_", 1)
+            if drv_name == line:
+                found_drivers.append(component)
+        if len(found_drivers) == 1:
+            return found_drivers
+        # we failed to find anything, report error
+        raise ValueError(f"Error: unknown component: {line}")
+
+    # this is a compound string, so we have to do some matching. we may have two or three levels
+    # of hierarchy, as driver/net/ice and net/ice should both be valid.
+
+    # if there are three levels of hierarchy, this must be a driver
+    try:
+        ctype, drv_class, drv_name = line.split("/", 2)
+        component_name = f"{drv_class}_{drv_name}"
+        # we want to directly access the dict to trigger KeyError, and not catch them here
+        if component_name in dep_data[ctype]:
+            return [component_name]
+        else:
+            raise KeyError(f"Unknown category: {line}")
+    except ValueError:
+        # not three levels of hierarchy, try two
+        pass
+
+    first, second = line.split("/", 1)
+
+    # this could still be a driver, just without the "drivers" prefix
+    for component in dep_data["drivers"].keys():
+        if component == f"{first}_{second}":
+            return [component]
+    # could be driver wildcard, e.g. drivers/net
+    if first == "drivers":
+        drv_match: T.List[str] = [
+            drv_name
+            for drv_name in dep_data["drivers"]
+            if drv_name.startswith(f"{second}_")
+        ]
+        if drv_match:
+            return drv_match
+    # may be category + component
+    if first in dep_data:
+        # go through all components in the category
+        if second in dep_data[first]:
+            return [second]
+        # if it's an app or an example, it may have "dpdk-" in front
+        if first in ["app", "examples"]:
+            maybe_app_name = f"dpdk-{second}"
+            if maybe_app_name in dep_data[first]:
+                return [maybe_app_name]
+    # and nothing of value was found
+    raise ValueError(f"Error: unknown component: {line}")
+
+
+def filter_deps(dep_data: DepData, criteria: T.List[str]) -> None:
+    """Filter dependency data to include only specified components."""
+    # this is a two step process: when we get a list of components, we need to
+    # go through all of them and note any dependencies they have, and expand the
+    # list of components with those dependencies. then we filter.
+
+    # walk the dependency list and include all possible dependencies
+    deps_seen: Deps = set()
+    deps_stack = collections.deque(criteria)
+    while deps_stack:
+        component = deps_stack.popleft()
+        if component in deps_seen:
+            continue
+        deps_seen.add(component)
+        for component_type, component_dict in dep_data.items():
+            try:
+                deps = component_dict[component]
+            except KeyError:
+                # wrong component type
+                continue
+            for _, dep_list in deps.items():
+                deps_stack.extend(dep_list)
+    criteria += list(deps_seen)
+
+    # now, "components" has all the dependencies we need to include, so we can filter
+    for component_type, component_dict in dep_data.items():
+        dep_data[component_type] = {
+            component: deps
+            for component, deps in component_dict.items()
+            if component in criteria
+        }
+
+
+def main():
+    parser = argparse.ArgumentParser(
+        description="Utility to generate dependency tree graphs for DPDK"
+    )
+    parser.add_argument(
+        "--match",
+        type=str,
+        help="Output hierarchy for component or category, e.g. net/ice, lib, app, drivers/net, etc.",
+    )
+    parser.add_argument(
+        "input_file",
+        type=argparse.FileType("r"),
+        help="Path to the deps.dot file from a DPDK build directory",
+    )
+    parser.add_argument(
+        "output_file",
+        type=argparse.FileType("w"),
+        help="Path to the desired output dot file",
+    )
+    args = parser.parse_args()
+
+    deps = read_deps_list([ln.strip() for ln in args.input_file.readlines()])
+    if args.match:
+        try:
+            filter_deps(deps, parse_match(args.match, deps))
+        except (KeyError, ValueError) as e:
+            print(e, file=sys.stderr)
+            return
+    args.output_file.writelines(create_classified_graph(deps))
+
+
+if __name__ == "__main__":
+    main()
Signature · 1 line
2.43.5
Acked-by Morten Brørup on the v4 series
#42 lore raw

Re: [PATCH v4 0/8] Record and rework component dependencies

In reply to Anatoly Burakov
Quoted 24 lines · Anatoly Burakov

As part of the meson build, we can record the dependencies for each component as we process it, logging them to a file. This file can be used as input to a number of other scripts and tools, for example, to graph the dependencies, or to allow higher-level build-config tools to automatically enable component requirements, etc.

The first patch of this set separates dependencies inside meson into optional or mandatory. The second patch of this set generates the basic dependency tree. The third patch does some processing of that dependency tree to identify cases where dependencies are being unnecessarily specified. Reducing these makes it easier to have readable dependency graphs in future, without affecting the build.

The following 4 patches are based on the output of the second patch, and greatly cut down the number of direct dependency links between components. Even with the cut-down dependencies, the full dependency graph is nigh-unreadable, so the final patch adds a new script to generate dependency tree subgraphs, creating dot files for e.g. the dependencies of a particular component, or a component class such as mempool drivers.

v3 -> v4:
- Update to latest main

Quoted 7 lines

v2 -> v3:
- Split dependencies into optional and mandatory
- Fixup graph scripts to read and generate graphs that encode optional dependencies into the graph
- Python version fixes to avoid using features not available in minimum supported Python version
- Formatting with Ruff, and PEP-484 compliance

Forgot the series ack:

Signature · 2 lines
Thanks,
Anatoly
#43 lore raw

v5 cover Record and rework component dependencies

In reply to Anatoly Burakov

As part of the meson build, we can record the dependencies for each component as we process it, logging them to a file. This file can be used as input to a number of other scripts and tools, for example, to graph the dependencies, or to allow higher-level build-config tools to automatically enable component requirements, etc.

The first patch of this set separates dependencies inside meson into optional or mandatory. The second patch of this set generates the basic dependency tree. The third patch does some processing of that dependency tree to identify cases where dependencies are being unnecessarily specified. Reducing these makes it easier to have readable dependency graphs in future, without affecting the build.

The following 4 patches are based on the output of the second patch, and greatly cut down the number of direct dependency links between components. Even with the cut-down dependencies, the full dependency graph is nigh-unreadable, so the final patch adds a new script to generate dependency tree subgraphs, creating dot files for e.g. the dependencies of a particular component, or a component class such as mempool drivers.

v4 -> v5:
- Improve optional dependency handling by making it (mostly) automatic
- Fix CI issue from accidentally changing testpmd binary filename
- Explicitly encode display name vs binary name information in the graph
- Reduce some more dependencies
- Update all scripts to handle new graph output format

v3 -> v4:
- Update to latest main

v2 -> v3:
- Split dependencies into optional and mandatory
- Fixup graph scripts to read and generate graphs that encode optional dependencies into the graph
- Python version fixes to avoid using features not available in minimum supported Python version
- Formatting with Ruff, and PEP-484 compliance

Anatoly Burakov (1):
build: introduce optional internal dependencies

Bruce Richardson (7):
build: output a dependency log in build directory
devtools: add script to flag unneeded dependencies
build: remove kvargs from driver class dependencies
build: reduce library dependencies
build: reduce driver dependencies
build: reduce app dependencies
devtools: add script to generate DPDK dependency graphs

 app/dumpcap/meson.build                    |   2 +-
 app/graph/meson.build                      |   2 +-
 app/meson.build                            |  31 ++-
 app/pdump/meson.build                      |   2 +-
 app/proc-info/meson.build                  |   6 +-
 app/test-bbdev/meson.build                 |  18 +-
 app/test-crypto-perf/meson.build           |   6 +-
 app/test-fib/meson.build                   |   2 +-
 app/test-pmd/meson.build                   |  56 ++----
 app/test-sad/meson.build                   |   2 +-
 app/test/meson.build                       |  14 +-
 buildtools/log-deps.py                     |  94 +++++++++
 buildtools/meson.build                     |   2 +
 devtools/draw-dependency-graphs.py         | 223 +++++++++++++++++++++
 devtools/find-duplicate-deps.py            |  62 ++++++
 drivers/baseband/fpga_5gnr_fec/meson.build |   2 +-
 drivers/baseband/fpga_lte_fec/meson.build  |   2 +-
 drivers/baseband/la12xx/meson.build        |   2 +-
 drivers/baseband/null/meson.build          |   2 +-
 drivers/baseband/turbo_sw/meson.build      |   2 +-
 drivers/bus/auxiliary/meson.build          |   2 -
 drivers/bus/dpaa/meson.build               |   2 +-
 drivers/bus/fslmc/meson.build              |   2 +-
 drivers/bus/ifpga/meson.build              |   2 +-
 drivers/bus/pci/meson.build                |   4 +-
 drivers/bus/platform/meson.build           |   1 -
 drivers/bus/uacce/meson.build              |   2 -
 drivers/bus/vdev/meson.build               |   2 -
 drivers/common/cnxk/meson.build            |   4 +-
 drivers/common/cpt/meson.build             |   2 +-
 drivers/common/idpf/meson.build            |   2 +-
 drivers/common/mlx5/meson.build            |   2 +-
 drivers/common/qat/meson.build             |   3 +-
 drivers/compress/mlx5/meson.build          |   2 +-
 drivers/compress/nitrox/meson.build        |   2 +-
 drivers/compress/octeontx/meson.build      |   2 +-
 drivers/crypto/bcmfs/meson.build           |   2 +-
 drivers/crypto/cnxk/meson.build            |   2 +-
 drivers/crypto/dpaa_sec/meson.build        |   2 +-
 drivers/crypto/ipsec_mb/meson.build        |   2 +-
 drivers/crypto/mlx5/meson.build            |   2 +-
 drivers/crypto/nitrox/meson.build          |   2 +-
 drivers/dma/cnxk/meson.build               |   2 +-
 drivers/dma/dpaa/meson.build               |   2 +-
 drivers/dma/dpaa2/meson.build              |   2 +-
 drivers/dma/odm/meson.build                |   2 +-
 drivers/dma/skeleton/meson.build           |   2 +-
 drivers/event/cnxk/meson.build             |   2 +-
 drivers/event/dlb2/meson.build             |   2 +-
 drivers/event/dpaa2/meson.build            |   2 +-
 drivers/event/meson.build                  |   2 +-
 drivers/event/octeontx/meson.build         |   3 +-
 drivers/event/sw/meson.build               |   2 +-
 drivers/mempool/cnxk/meson.build           |   2 +-
 drivers/mempool/dpaa/meson.build           |   2 +-
 drivers/mempool/dpaa2/meson.build          |   2 +-
 drivers/mempool/octeontx/meson.build       |   2 +-
 drivers/meson.build                        |  27 ++-
 drivers/ml/cnxk/meson.build                |   2 +-
 drivers/net/cnxk/meson.build               |   4 +-
 drivers/net/iavf/meson.build               |   2 +-
 drivers/net/ice/meson.build                |   2 +-
 drivers/net/mana/meson.build               |   2 +-
 drivers/net/meson.build                    |   2 +-
 drivers/net/mlx5/meson.build               |   2 +-
 drivers/net/sfc/meson.build                |   2 +-
 drivers/net/softnic/meson.build            |   2 +-
 drivers/net/virtio/meson.build             |   2 +-
 drivers/raw/cnxk_bphy/meson.build          |   2 +-
 drivers/raw/cnxk_gpio/meson.build          |   2 +-
 drivers/raw/gdtc/meson.build               |   2 +-
 drivers/raw/ntb/meson.build                |   2 +-
 drivers/raw/skeleton/meson.build           |   2 +-
 drivers/regex/cn9k/meson.build             |   2 +-
 drivers/regex/meson.build                  |   2 +-
 drivers/regex/mlx5/meson.build             |   2 +-
 drivers/vdpa/ifc/meson.build               |   2 +-
 drivers/vdpa/meson.build                   |   3 +-
 drivers/vdpa/mlx5/meson.build              |   2 +-
 drivers/vdpa/sfc/meson.build               |   2 +-
 examples/ethtool/meson.build               |   4 +-
 examples/l2fwd-crypto/meson.build          |   4 +-
 examples/l3fwd/meson.build                 |   4 +-
 examples/meson.build                       |  31 ++-
 examples/vm_power_manager/meson.build      |  16 +-
 lib/argparse/meson.build                   |   2 +-
 lib/bbdev/meson.build                      |   2 +-
 lib/bitratestats/meson.build               |   2 +-
 lib/bpf/meson.build                        |   2 +-
 lib/cmdline/meson.build                    |   2 +-
 lib/compressdev/meson.build                |   2 +-
 lib/cryptodev/meson.build                  |   2 +-
 lib/dispatcher/meson.build                 |   2 +-
 lib/distributor/meson.build                |   2 +-
 lib/dmadev/meson.build                     |   2 -
 lib/eal/meson.build                        |   5 +-
 lib/efd/meson.build                        |   2 +-
 lib/ethdev/meson.build                     |   2 +-
 lib/eventdev/meson.build                   |   3 +-
 lib/fib/meson.build                        |   4 +-
 lib/gpudev/meson.build                     |   2 +-
 lib/graph/meson.build                      |   2 +-
 lib/gro/meson.build                        |   2 +-
 lib/gso/meson.build                        |   2 +-
 lib/hash/meson.build                       |   4 +-
 lib/ip_frag/meson.build                    |   2 +-
 lib/ipsec/meson.build                      |   2 +-
 lib/kvargs/meson.build                     |   2 +-
 lib/latencystats/meson.build               |   2 +-
 lib/lpm/meson.build                        |   4 +-
 lib/mbuf/meson.build                       |   2 +-
 lib/member/meson.build                     |   2 +-
 lib/mempool/meson.build                    |   2 +-
 lib/meson.build                            |  27 ++-
 lib/metrics/meson.build                    |   2 +-
 lib/mldev/meson.build                      |   2 +-
 lib/net/meson.build                        |   2 +-
 lib/node/meson.build                       |   2 +-
 lib/pcapng/meson.build                     |   2 +-
 lib/pdcp/meson.build                       |   2 +-
 lib/pdump/meson.build                      |   2 +-
 lib/pipeline/meson.build                   |   2 +-
 lib/port/meson.build                       |   2 +-
 lib/power/meson.build                      |   3 +-
 lib/rawdev/meson.build                     |   2 -
 lib/rcu/meson.build                        |   2 +-
 lib/regexdev/meson.build                   |   2 +-
 lib/reorder/meson.build                    |   2 +-
 lib/rib/meson.build                        |   2 +-
 lib/ring/meson.build                       |   1 -
 lib/sched/meson.build                      |   2 +-
 lib/security/meson.build                   |   2 +-
 lib/table/meson.build                      |   2 +-
 lib/telemetry/meson.build                  |   2 +-
 lib/vhost/meson.build                      |   2 +-
 135 files changed, 647 insertions(+), 232 deletions(-)
 create mode 100644 buildtools/log-deps.py
 create mode 100755 devtools/draw-dependency-graphs.py
 create mode 100755 devtools/find-duplicate-deps.py
Signature · 1 line
2.43.5
#44 lore raw

PATCH v5 1/8 build: introduce optional internal dependencies

Allow specifying internal dependencies as either mandatory or optional. Specifying a dependency as optional will mean that the component being built will not be skipped if said dependency is not being built. At build time, the build system will resolve any optional dependencies and add them to the list of dependencies to be built. Any source files requiring said optional depepdencies will still have to be added explicitly to the build by the respective component (e.g. adding BPF-related files when BPF support is being built).

---

Notes:
v4 -> v5:
- Automatically handle optional dependencies based on Bruce's earlier patch [1]

[1] https://patches.dpdk.org/project/dpdk/patch/[email protected]/

 app/meson.build                       | 14 ++++++-
 app/proc-info/meson.build             |  4 +-
 app/test-bbdev/meson.build            | 18 +++------
 app/test-crypto-perf/meson.build      |  4 +-
 app/test-pmd/meson.build              | 56 +++++++++------------------
 app/test/meson.build                  | 12 +++---
 drivers/meson.build                   | 13 ++++++-
 examples/ethtool/meson.build          |  4 +-
 examples/l2fwd-crypto/meson.build     |  4 +-
 examples/l3fwd/meson.build            |  4 +-
 examples/meson.build                  | 13 ++++++-
 examples/vm_power_manager/meson.build | 16 +++-----
 lib/meson.build                       | 13 ++++++-
 13 files changed, 89 insertions(+), 86 deletions(-)
app/meson.build +12 -2
index e2db888ae1..61202495bd 100644
@@ -66,6 +66,7 @@ foreach app:apps
     # external package/library requirements
     ext_deps = []
     deps = []
+    optional_deps = []
 
     if not enable_apps.contains(app)
         build = false
@@ -83,10 +84,19 @@ foreach app:apps
         endif
     endif
 
+    # resolve any optional internal dependencies
+    def_lib = get_option('default_library')
+    foreach d: optional_deps
+        # if optional dependency is defined, add it to the deps list
+        if is_variable(def_lib + '_rte_' + d)
+            deps += [d]
+        endif
+    endforeach
+
     if build
         dep_objs = []
         foreach d:deps
-            var_name = get_option('default_library') + '_rte_' + d
+            var_name = def_lib + '_rte_' + d
             if not is_variable(var_name)
                 build = false
                 reason = 'missing internal dependency, "@0@"'.format(d)
@@ -111,7 +121,7 @@ foreach app:apps
 
     dpdk_apps_enabled += app
     link_libs = []
-    if get_option('default_library') == 'static'
+    if def_lib == 'static'
         link_libs = dpdk_static_libraries + dpdk_drivers
     endif
 
app/proc-info/meson.build +1 -3
index 4f83f29a64..5fefb0857e 100644
@@ -9,6 +9,4 @@ endif
 
 sources = files('main.c')
 deps += ['ethdev', 'security', 'eventdev']
-if dpdk_conf.has('RTE_LIB_METRICS')
-    deps += 'metrics'
-endif
+optional_deps += 'metrics'
app/test-bbdev/meson.build +6 -12
index 926e0a5271..bd38694eaf 100644
@@ -14,15 +14,9 @@ sources = files(
         'test_bbdev_vector.c',
 )
 deps += ['bbdev', 'bus_vdev']
-if dpdk_conf.has('RTE_BASEBAND_FPGA_LTE_FEC')
-    deps += ['baseband_fpga_lte_fec']
-endif
-if dpdk_conf.has('RTE_BASEBAND_FPGA_5GNR_FEC')
-    deps += ['baseband_fpga_5gnr_fec']
-endif
-if dpdk_conf.has('RTE_BASEBAND_ACC')
-    deps += ['baseband_acc']
-endif
-if dpdk_conf.has('RTE_BASEBAND_LA12XX')
-    deps += ['baseband_la12xx']
-endif
+optional_deps += [
+    'baseband_fpga_lte_fec',
+    'baseband_fpga_5gnr_fec',
+    'baseband_acc',
+    'baseband_la12xx'
+]
app/test-crypto-perf/meson.build +1 -3
index 7b02b518f0..1ac0ac1099 100644
@@ -20,6 +20,4 @@ sources = files(
         'main.c',
 )
 deps += ['cryptodev', 'net', 'security']
-if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
-endif
+optional_deps += 'crypto_scheduler'
app/test-pmd/meson.build +19 -37

66 lines not on this page · raw message

app/test/meson.build +6 -6
index d5cb6a7f7a..36c2016a49 100644
@@ -7,7 +7,7 @@ sources += files('commands.c', 'test.c')
 
 # optional dependencies: some files may use these - and so we should link them in -
 # but do not explicitly require them so they are not listed in the per-file lists below
-optional_deps = ['crypto_scheduler', 'lpm']
+opt_deps = ['crypto_scheduler', 'lpm']
 
 # some other utility C files, providing functions used by various tests
 # so we need to include these deps in the dependency list for the files using those fns.
@@ -219,8 +219,8 @@ foreach f, f_deps : source_file_deps
             break
         else
             # technically we might not need this dep, but adding it is harmless
-            if d not in deps
-                deps += d
+            if d not in optional_deps and d not in deps
+                optional_deps += d
             endif
         endif
     endforeach
@@ -241,9 +241,9 @@ foreach f, f_deps : source_file_deps
     endif
 endforeach
 # add the optional dependencies
-foreach d:optional_deps
-    if is_variable(def_lib + '_rte_' + d) and d not in deps
-        deps += d
+foreach d:opt_deps
+    if d not in optional_deps and d not in deps
+        optional_deps += d
     endif
 endforeach
 
drivers/meson.build +12 -1
index 495e21b54a..63b0bc1e37 100644
@@ -132,6 +132,7 @@ foreach subpath:subdirs
         includes = [include_directories(drv_path)]
         # set up internal deps. Drivers can append/override as necessary
         deps = std_deps
+        optional_deps = []
         # ext_deps: Stores external library dependency got
         # using dependency() (preferred) or find_library().
         # For the find_library() case (but not with dependency()) we also
@@ -173,11 +174,21 @@ foreach subpath:subdirs
             # get dependency objs from strings
             shared_deps = ext_deps
             static_deps = ext_deps
+
+            # resolve any optional internal dependencies
+            def_lib = get_option('default_library')
+            foreach d: optional_deps
+                # if optional dependency is defined, add it to the deps list
+                if is_variable(def_lib + '_rte_' + d)
+                    deps += [d]
+                endif
+            endforeach
+
             foreach d:deps
                 if not build
                     break
                 endif
-                if not is_variable('shared_rte_' + d)
+                if not is_variable(def_lib + '_rte_' + d)
                     build = false
                     reason = 'missing internal dependency, "@0@"'.format(d)
                     if dpdk_libs_deprecated.contains(d)
examples/ethtool/meson.build +1 -3
index d7f63d48af..bb2a7fbb89 100644
@@ -19,8 +19,6 @@ sources = files(
 includes = include_directories('lib', 'ethtool-app')
 
 deps += 'bus_pci'
-if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += 'net_ixgbe'
-endif
+optional_deps += 'net_ixgbe'
 
 allow_experimental_apis = true
examples/l2fwd-crypto/meson.build +1 -3
index bb44c88882..3081573f05 100644
@@ -7,9 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'cryptodev'
-if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
-endif
+optional_deps += 'crypto_scheduler'
 allow_experimental_apis = true
 sources = files(
         'main.c',
examples/l3fwd/meson.build +1 -3
index c25de77bba..9a5f487429 100644
@@ -18,6 +18,4 @@ sources = files(
         'l3fwd_lpm.c',
         'main.c',
 )
-if dpdk_conf.has('RTE_LIB_EVENTDEV')
-    deps += 'eventdev'
-endif
+optional_deps += 'eventdev'
examples/meson.build +12 -1
index 8e8968a1fa..14b8aadf68 100644
@@ -98,12 +98,23 @@ foreach example: examples
     ext_deps = []
     includes = [include_directories(example, 'common')]
     deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
+    optional_deps = []
     subdir(example)
 
     if build
         dep_objs = ext_deps
+
+        # resolve any optional internal dependencies
+        def_lib = get_option('default_library')
+        foreach d: optional_deps
+            # if optional dependency is defined, add it to the deps list
+            if is_variable(def_lib + '_rte_' + d)
+                deps += [d]
+            endif
+        endforeach
+
         foreach d:deps
-            var_name = get_option('default_library') + '_rte_' + d
+            var_name = def_lib + '_rte_' + d
             if not is_variable(var_name)
                 build = false
                 message('Missing dependency "@0@" for example "@1@"'.format(d, name))
examples/vm_power_manager/meson.build +5 -11
index dcf23198eb..ba39b2cfab 100644
@@ -8,17 +8,11 @@
 
 deps += ['power', 'power_kvm_vm']
 
-if dpdk_conf.has('RTE_NET_BNXT')
-    deps += ['net_bnxt']
-endif
-
-if dpdk_conf.has('RTE_NET_I40E')
-    deps += ['net_i40e']
-endif
-
-if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += ['net_ixgbe']
-endif
+optional_deps += [
+    'net_bnxt',
+    'net_i40e',
+    'net_ixgbe'
+]
 
 allow_experimental_apis = true
 sources = files(
lib/meson.build +12 -1
index ce92cb5537..76bf849852 100644
@@ -134,6 +134,7 @@ foreach l:libraries
     # external package/library requirements
     ext_deps = []
     deps = []
+    optional_deps = []
     # eal is standard dependency once built
     if dpdk_conf.has('RTE_LIB_EAL')
         deps += ['eal']
@@ -171,11 +172,21 @@ foreach l:libraries
 
     shared_deps = ext_deps
     static_deps = ext_deps
+
+    # resolve any optional internal dependencies
+    def_lib = get_option('default_library')
+    foreach d: optional_deps
+        # if optional dependency is defined, add it to the deps list
+        if is_variable(def_lib + '_rte_' + d)
+            deps += [d]
+        endif
+    endforeach
+
     foreach d:deps
         if not build
             break
         endif
-        if not is_variable('shared_rte_' + d)
+        if not is_variable(def_lib + '_rte_' + d)
             build = false
             reason = 'missing internal dependency, "@0@"'.format(d)
             if dpdk_libs_deprecated.contains(d)
Signature · 1 line
2.43.5
#45 lore raw

PATCH v5 2/8 build: output a dependency log in build directory

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

As meson processes our DPDK source tree it manages dependencies specified by each individual driver. To enable future analysis of the dependency links between components, log the dependencies of each DPDK component as it gets processed. This could potentially allow other tools to automatically enable or disable components based on the desired end components to be built, e.g. if the user requests net/ice, ensure that common/iavf is also enabled in the drivers.

The output file produced is in "dot" or "graphviz" format, which allows producing a graphical representation of the DPDK dependency tree if so desired. For example: "dot -Tpng -O build/deps.dot" to produce the image file "build/deps.dot.png".

---

Notes:
v4 -> v5:
- Change output format to include display name

 app/meson.build        | 17 +++++++-
 buildtools/log-deps.py | 94 ++++++++++++++++++++++++++++++++++++++++++
 buildtools/meson.build |  2 +
 drivers/meson.build    | 14 +++++++
 examples/meson.build   | 18 +++++++-
 lib/meson.build        | 14 +++++++
 6 files changed, 157 insertions(+), 2 deletions(-)
 create mode 100644 buildtools/log-deps.py
app/meson.build +16 -1
index 61202495bd..a971738d40 100644
@@ -77,7 +77,22 @@ foreach app:apps
     endif
 
     if build
+        # call into subdir may update name so record it here
+        display_name = name
+
         subdir(name)
+        app_name = 'dpdk-' + name
+
+        # log mandatory dependencies
+        cmds = ['--type', 'app']
+        cmds += ['--display-name', display_name]
+        run_command([log_deps_cmd, cmds, app_name, deps], check: false)
+
+        # log optional dependencies, if any
+        if optional_deps.length() > 0
+            cmds += ['--optional']
+            run_command([log_deps_cmd, cmds, app_name, optional_deps], check: false)
+        endif
         if not build and require_apps
             error('Cannot build explicitly requested app "@0@".\n'.format(name)
                   + '\tReason: ' + reason)
@@ -125,7 +140,7 @@ foreach app:apps
         link_libs = dpdk_static_libraries + dpdk_drivers
     endif
 
-    exec = executable('dpdk-' + name,
+    exec = executable(app_name,
             [ sources, resources ],
             c_args: cflags,
             link_args: ldflags,
buildtools/log-deps.py new file +94 -0

94 lines not on this page · raw message

buildtools/meson.build +2 -0
index 4e2c1217a2..13a0477245 100644
@@ -26,6 +26,8 @@ header_gen_cmd = py3 + files('gen-header.py')
 has_hugepages_cmd = py3 + files('has-hugepages.py')
 cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py')
 check_dts_requirements = py3 + files('check-dts-requirements.py')
+log_deps_cmd = py3 + files('log-deps.py')
+run_command(log_deps_cmd, check: false)  # call with no parameters to reset the file
 
 # install any build tools that end-users might want also
 install_data([
drivers/meson.build +14 -0
index 63b0bc1e37..e9df747a24 100644
@@ -157,6 +157,8 @@ foreach subpath:subdirs
         endif
 
         if build
+            # call into subdir may update name so record it here
+            display_name = '@0@/@1@'.format(class, name)
             # pull in driver directory which should update all the local variables
             subdir(drv_path)
 
@@ -171,6 +173,18 @@ foreach subpath:subdirs
                         +'\tReason: ' + reason)
             endif
 
+            # log mandatory dependencies
+            cmds = ['--type', 'drivers']
+            cmds += ['--display-name', display_name]
+            drv_name = class + '_' + name
+            run_command([log_deps_cmd, cmds, drv_name, deps], check: false)
+
+            # log optional dependencies, if any
+            if optional_deps.length() > 0
+                cmds += ['--optional']
+                run_command([log_deps_cmd, cmds, drv_name, optional_deps], check: false)
+            endif
+
             # get dependency objs from strings
             shared_deps = ext_deps
             static_deps = ext_deps
examples/meson.build +17 -1
index 14b8aadf68..d1856dbafc 100644
@@ -99,11 +99,27 @@ foreach example: examples
     includes = [include_directories(example, 'common')]
     deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
     optional_deps = []
+
+    # call into subdir may update name so record it here
+    display_name = example
+
     subdir(example)
+    example_name = 'dpdk-' + name
 
     if build
         dep_objs = ext_deps
 
+        # log mandatory dependencies
+        cmds = ['--type', 'examples']
+        cmds += ['--display-name', display_name]
+        run_command([log_deps_cmd, cmds, example_name, deps], check: false)
+
+        # log optional dependencies, if any
+        if optional_deps.length() > 0
+            cmds += ['--optional']
+            run_command([log_deps_cmd, cmds, example_name, optional_deps], check: false)
+        endif
+
         # resolve any optional internal dependencies
         def_lib = get_option('default_library')
         foreach d: optional_deps
@@ -135,7 +151,7 @@ foreach example: examples
     if allow_experimental_apis
         cflags += '-DALLOW_EXPERIMENTAL_API'
     endif
-    executable('dpdk-' + name, sources,
+    executable(example_name, sources,
             include_directories: includes,
             link_whole: link_whole_libs,
             link_args: ldflags,
lib/meson.build +14 -0
index 76bf849852..db0d121b3c 100644
@@ -160,7 +160,21 @@ foreach l:libraries
     endif
 
     if build
+        # as per warning below, directory name should match library name but it is not considered an error
+        display_name = name
+
         subdir(l)
+
+        # log mandatory dependencies
+        cmds = ['--type', 'lib']
+        cmds += ['--display-name', display_name]
+        run_command([log_deps_cmd, cmds, name, deps], check: false)
+
+        # log optional dependencies, if any
+        if optional_deps.length() > 0
+            cmds += ['--optional']
+            run_command([log_deps_cmd, cmds, name, optional_deps], check: false)
+        endif
         if not build and require_libs
             error('Cannot build explicitly requested lib "@0@".\n'.format(name)
                     +'\tReason: ' + reason)
Signature · 1 line
2.43.5
#46 lore raw

PATCH v5 3/8 devtools: add script to flag unneeded dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

While not a serious problem, DPDK components often list more dependencies than are actually necessary to build, due to the use of recursive dependencies. In extreme cases, such as with core libraries, this can lead to longer configuration times due to meson having to deduplicate long lists of dependencies. Therefore we can add a script to identify when a component has got unnecessary dependencies listed.

---
 devtools/find-duplicate-deps.py | 62 +++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100755 devtools/find-duplicate-deps.py
devtools/find-duplicate-deps.py new file +62 -0
new file mode 100755
index 0000000000..cbd0ca7196
@@ -0,0 +1,62 @@
+#! /usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 Intel Corporation
+
+"""Identify any superfluous dependencies listed in DPDK deps graph."""
+
+import sys
+
+all_deps = {}
+
+
+class dep:
+    """Holds a component and its dependencies."""
+
+    def __init__(self, name, dep_names):
+        """Create and process a component and its deps."""
+        self.name = name.strip('" ')
+        self.base_deps = [all_deps[dn.strip('" ')] for dn in dep_names]
+        self.recursive_deps = []
+        for d in self.base_deps:
+            self.recursive_deps.extend(d.base_deps)
+            self.recursive_deps.extend(d.recursive_deps)
+        self.extra_deps = []
+        for d in self.base_deps:
+            if d in self.recursive_deps:
+                self.extra_deps.append(d.name)
+        if self.extra_deps:
+            print(f'{self.name}: extra deps {self.extra_deps}')
+
+    def dict_add(self, d):
+        """Add this object to a dictionary by name."""
+        d[self.name] = self
+
+
+def remove_attrs(ln):
+    """Remove attributes from a line."""
+    while ln.find("[") != -1:
+        start = ln.find("[")
+        end = ln.find("]")
+        ln = ln[:start] + ln[end + 1 :]
+    return ln.strip()
+
+
+def main(argv):
+    """Read the dependency tree from a dot file and process it."""
+    if len(argv) != 2:
+        print(f'Usage: {argv[0]} <build-directory>/deps.dot', file=sys.stderr)
+        sys.exit(1)
+
+    with open(argv[1]) as f:
+        for ln in f.readlines():
+            ln = remove_attrs(ln.strip())
+            if '->' in ln:
+                name, deps = ln.split('->')
+                deps = deps.strip(' {}')
+                dep(name, deps.split(',')).dict_add(all_deps)
+            elif ln.startswith('"') and ln.endswith('"'):
+                dep(ln.strip('"'), []).dict_add(all_deps)
+
+
+if __name__ == '__main__':
+    main(sys.argv)
Signature · 1 line
2.43.5
#47 lore raw

PATCH v5 4/8 build: remove kvargs from driver class dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

The kvargs library is used by EAL, and therefore is implicitly a dependency of every DPDK driver. Remove it from the minimum set of dependencies for each driver class as it's unnecessary to call it out there.

---
 drivers/event/meson.build | 2 +-
 drivers/net/meson.build   | 2 +-
 drivers/regex/meson.build | 2 +-
 drivers/vdpa/meson.build  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/event/meson.build +1 -1
index d6706b57f7..2708833adf 100644
@@ -19,4 +19,4 @@ if not (toolchain == 'gcc' and cc.version().version_compare('<4.8.6') and
         dpdk_conf.has('RTE_ARCH_ARM64'))
     drivers += 'octeontx'
 endif
-std_deps = ['eventdev', 'kvargs']
+std_deps = ['eventdev']
drivers/net/meson.build +1 -1
index dafd637ba4..3b388ead24 100644
@@ -65,6 +65,6 @@ drivers = [
         'vmxnet3',
         'zxdh',
 ]
-std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
+std_deps = ['ethdev']           # 'ethdev' also pulls in mbuf, net, eal etc
 std_deps += ['bus_pci']         # very many PMDs depend on PCI, so make std
 std_deps += ['bus_vdev']        # same with vdev bus
drivers/regex/meson.build +1 -1
index ff2a8fea89..10192e7c77 100644
@@ -5,4 +5,4 @@ drivers = [
         'mlx5',
         'cn9k',
 ]
-std_deps = ['ethdev', 'kvargs', 'regexdev'] # 'ethdev' also pulls in mbuf, net, eal etc
+std_deps = ['ethdev', 'regexdev'] # 'ethdev' also pulls in mbuf, net, eal etc
drivers/vdpa/meson.build +1 -1
index 896e8e0304..e01c277b9e 100644
@@ -11,5 +11,5 @@ drivers = [
         'nfp',
         'sfc',
 ]
-std_deps = ['bus_pci', 'kvargs']
+std_deps = ['bus_pci']
 std_deps += ['vhost']
Signature · 1 line
2.43.5
#48 lore raw

PATCH v5 5/8 build: reduce library dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Rather than having each library depend up on EAL + any extra libs, we can take advantage of recursive dependency support in meson and just assign the dependencies of each directory directly, rather than appending to the array. For libraries which only depend upon EAL, keep that as a default, but for libraries which depend upon even a single extra lib, that EAL dependency is unnecessary.

Going further, we can identify using the find_duplicate_deps.py script any unnecessary deps in each library's list, and remove them to slim the dependency tree down.

Reducing number of dependencies means that meson takes less time processing and deduplicating the dependency tree for each component, and also shrinks the dependency graph for DPDK itself.

---
 lib/argparse/meson.build     | 2 +-
 lib/bbdev/meson.build        | 2 +-
 lib/bitratestats/meson.build | 2 +-
 lib/bpf/meson.build          | 2 +-
 lib/cmdline/meson.build      | 2 +-
 lib/compressdev/meson.build  | 2 +-
 lib/cryptodev/meson.build    | 2 +-
 lib/dispatcher/meson.build   | 2 +-
 lib/distributor/meson.build  | 2 +-
 lib/dmadev/meson.build       | 2 --
 lib/eal/meson.build          | 5 +----
 lib/efd/meson.build          | 2 +-
 lib/ethdev/meson.build       | 2 +-
 lib/eventdev/meson.build     | 3 +--
 lib/fib/meson.build          | 4 +---
 lib/gpudev/meson.build       | 2 +-
 lib/graph/meson.build        | 2 +-
 lib/gro/meson.build          | 2 +-
 lib/gso/meson.build          | 2 +-
 lib/hash/meson.build         | 4 +---
 lib/ip_frag/meson.build      | 2 +-
 lib/ipsec/meson.build        | 2 +-
 lib/kvargs/meson.build       | 2 +-
 lib/latencystats/meson.build | 2 +-
 lib/lpm/meson.build          | 4 +---
 lib/mbuf/meson.build         | 2 +-
 lib/member/meson.build       | 2 +-
 lib/mempool/meson.build      | 2 +-
 lib/metrics/meson.build      | 2 +-
 lib/mldev/meson.build        | 2 +-
 lib/net/meson.build          | 2 +-
 lib/node/meson.build         | 2 +-
 lib/pcapng/meson.build       | 2 +-
 lib/pdcp/meson.build         | 2 +-
 lib/pdump/meson.build        | 2 +-
 lib/pipeline/meson.build     | 2 +-
 lib/port/meson.build         | 2 +-
 lib/power/meson.build        | 3 +--
 lib/rawdev/meson.build       | 2 --
 lib/rcu/meson.build          | 2 +-
 lib/regexdev/meson.build     | 2 +-
 lib/reorder/meson.build      | 2 +-
 lib/rib/meson.build          | 2 +-
 lib/ring/meson.build         | 1 -
 lib/sched/meson.build        | 2 +-
 lib/security/meson.build     | 2 +-
 lib/table/meson.build        | 2 +-
 lib/telemetry/meson.build    | 2 +-
 lib/vhost/meson.build        | 2 +-
 49 files changed, 46 insertions(+), 62 deletions(-)
lib/argparse/meson.build +1 -1
index b6a08ca049..96abc8766f 100644
@@ -4,4 +4,4 @@
 sources = files('rte_argparse.c')
 headers = files('rte_argparse.h')
 
-deps += ['log']
+deps = ['log']
lib/bbdev/meson.build +1 -1
index 07685e7578..2e68aa7873 100644
@@ -11,4 +11,4 @@ sources = files('rte_bbdev.c')
 headers = files('rte_bbdev.h',
         'rte_bbdev_pmd.h',
         'rte_bbdev_op.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/bitratestats/meson.build +1 -1
index ede7e0a579..8defcd53bf 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_bitrate.c')
 headers = files('rte_bitrate.h')
-deps += ['ethdev', 'metrics']
+deps = ['metrics']
lib/bpf/meson.build +1 -1
index aa258a9061..82127bc657 100644
@@ -31,7 +31,7 @@ headers = files('bpf_def.h',
         'rte_bpf.h',
         'rte_bpf_ethdev.h')
 
-deps += ['mbuf', 'net', 'ethdev']
+deps = ['ethdev']
 
 dep = dependency('libelf', required: false, method: 'pkg-config')
 if dep.found()
lib/cmdline/meson.build +1 -1
index 63fb69100d..4451f3da29 100644
@@ -31,4 +31,4 @@ else
     sources += files('cmdline_os_unix.c')
 endif
 
-deps += ['net']
+deps = ['net']
lib/compressdev/meson.build +1 -1
index c80295dc0d..4b86955baf 100644
@@ -16,4 +16,4 @@ driver_sdk_headers = files(
         'rte_compressdev_pmd.h',
         'rte_compressdev_internal.h',
     )
-deps += ['kvargs', 'mbuf']
+deps = ['mbuf']
lib/cryptodev/meson.build +1 -1
index 4734acf321..74e42ac700 100644
@@ -20,4 +20,4 @@ driver_sdk_headers += files(
         'cryptodev_pmd.h',
 )
 
-deps += ['kvargs', 'mbuf', 'rcu', 'telemetry']
+deps = ['mbuf', 'rcu']
lib/dispatcher/meson.build +1 -1
index ffaef26a6d..4dc1759951 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_dispatcher.c')
 headers = files('rte_dispatcher.h')
 
-deps += ['eventdev']
+deps = ['eventdev']
lib/distributor/meson.build +1 -1
index 24988c5827..ba43273bc3 100644
@@ -14,4 +14,4 @@ else
     sources += files('rte_distributor_match_generic.c')
 endif
 headers = files('rte_distributor.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/dmadev/meson.build +0 -2
index e66dcb66b0..70b375f1cb 100644
@@ -11,5 +11,3 @@ sources = files('rte_dmadev.c', 'rte_dmadev_trace_points.c')
 headers = files('rte_dmadev.h')
 indirect_headers += files('rte_dmadev_core.h', 'rte_dmadev_trace_fp.h')
 driver_sdk_headers += files('rte_dmadev_pmd.h')
-
-deps += ['telemetry']
lib/eal/meson.build +1 -4
index e1d6c4cf17..d25443d097 100644
@@ -14,10 +14,7 @@ subdir(exec_env)
 
 subdir(arch_subdir)
 
-deps += ['log', 'kvargs']
-if not is_windows
-    deps += ['telemetry']
-endif
+deps = ['kvargs', 'telemetry']
 if dpdk_conf.has('RTE_USE_LIBBSD')
     ext_deps += libbsd
 endif
lib/efd/meson.build +1 -1
index 343f14e1f3..da0ee7f803 100644
@@ -9,4 +9,4 @@ endif
 
 sources = files('rte_efd.c')
 headers = files('rte_efd.h')
-deps += ['ring', 'hash']
+deps = ['hash']
lib/ethdev/meson.build +1 -1
index f1d2586591..fc53a9c309 100644
@@ -53,7 +53,7 @@ if is_linux
     )
 endif
 
-deps += ['net', 'kvargs', 'meter', 'telemetry']
+deps = ['net', 'meter']
 
 if is_freebsd
     annotate_locks = false
lib/eventdev/meson.build +1 -2
index a04bb86f0f..237df998ce 100644
@@ -38,5 +38,4 @@ driver_sdk_headers += files(
         'event_timer_adapter_pmd.h',
 )
 
-deps += ['ring', 'ethdev', 'hash', 'mempool', 'mbuf', 'timer', 'cryptodev', 'dmadev']
-deps += ['telemetry']
+deps = ['ethdev', 'hash', 'timer', 'cryptodev', 'dmadev']
lib/fib/meson.build +1 -3
index 0c19cc8201..ac040d5372 100644
@@ -10,9 +10,7 @@ endif
 
 sources = files('rte_fib.c', 'rte_fib6.c', 'dir24_8.c', 'trie.c')
 headers = files('rte_fib.h', 'rte_fib6.h')
-deps += ['rib']
-deps += ['rcu']
-deps += ['net']
+deps = ['rib', 'rcu']
 
 if dpdk_conf.has('RTE_ARCH_X86_64')
     if target_has_avx512
lib/gpudev/meson.build +1 -1
index d21fadc052..5d883b85a1 100644
@@ -13,4 +13,4 @@ sources = files(
         'gpudev.c',
 )
 
-deps += ['mbuf']
+deps = ['mbuf']
lib/graph/meson.build +1 -1
index 0cb15442ab..f58f107d52 100644
@@ -25,4 +25,4 @@ indirect_headers += files(
         'rte_graph_worker_common.h',
 )
 
-deps += ['eal', 'pcapng', 'mempool', 'ring']
+deps = ['pcapng']
lib/gro/meson.build +1 -1
index dbce05220d..c6de6ceebc 100644
@@ -10,4 +10,4 @@ sources = files(
         'gro_vxlan_udp4.c',
 )
 headers = files('rte_gro.h')
-deps += ['ethdev']
+deps = ['ethdev']
lib/gso/meson.build +1 -1
index 622411df8f..bc99109933 100644
@@ -10,4 +10,4 @@ sources = files(
         'rte_gso.c',
 )
 headers = files('rte_gso.h')
-deps += ['ethdev']
+deps = ['ethdev']
lib/hash/meson.build +1 -3
index 7ce504ee8b..e6cb1ebe3b 100644
@@ -26,6 +26,4 @@ sources = files(
         'rte_thash_gf2_poly_math.c',
 )
 
-deps += ['net']
-deps += ['ring']
-deps += ['rcu']
+deps = ['net', 'rcu']
lib/ip_frag/meson.build +1 -1
index ea2de09f75..cacf391460 100644
@@ -10,4 +10,4 @@ sources = files(
         'ip_frag_internal.c',
 )
 headers = files('rte_ip_frag.h')
-deps += ['ethdev', 'hash']
+deps = ['ethdev', 'hash']
lib/ipsec/meson.build +1 -1
index 5c5a4aae78..7abbac5b6a 100644
@@ -14,6 +14,6 @@ sources = files('esp_inb.c', 'esp_outb.c',
 headers = files('rte_ipsec.h', 'rte_ipsec_sa.h', 'rte_ipsec_sad.h')
 indirect_headers += files('rte_ipsec_group.h')
 
-deps += ['mbuf', 'net', 'cryptodev', 'security', 'hash', 'telemetry']
+deps = ['security', 'hash']
 
 annotate_locks = false
lib/kvargs/meson.build +1 -1
index 7eae744a8f..7282b0ff8d 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-deps += 'log'
+deps = ['log']
 sources = files('rte_kvargs.c')
 headers = files('rte_kvargs.h')
lib/latencystats/meson.build +1 -1
index 286558dd79..f8b9a8aeec 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_latencystats.c')
 headers = files('rte_latencystats.h')
-deps += ['metrics', 'ethdev']
+deps = ['metrics']
lib/lpm/meson.build +1 -3
index fae4f79fb9..5031b085c4 100644
@@ -18,6 +18,4 @@ indirect_headers += files(
         'rte_lpm_sse.h',
         'rte_lpm_sve.h',
 )
-deps += ['hash']
-deps += ['rcu']
-deps += ['net']
+deps = ['hash']
lib/mbuf/meson.build +1 -1
index 2cee9057a5..22f5a3038b 100644
@@ -20,4 +20,4 @@ headers = files(
         'rte_mbuf_pool_ops.h',
         'rte_mbuf_dyn.h',
 )
-deps += ['mempool']
+deps = ['mempool']
lib/member/meson.build +1 -1
index 02ef59795e..b951aa566e 100644
@@ -16,7 +16,7 @@ sources = files(
         'rte_member_vbf.c',
 )
 
-deps += ['hash', 'ring']
+deps = ['hash']
 
 # compile AVX512 version if:
 if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
lib/mempool/meson.build +1 -1
index 8099a56466..0c0b3ea0c5 100644
@@ -19,4 +19,4 @@ headers = files(
         'rte_mempool.h',
         'rte_mempool_trace_fp.h',
 )
-deps += ['ring', 'telemetry']
+deps = ['ring']
lib/metrics/meson.build +1 -1
index 8c1c4b4b49..5165967646 100644
@@ -8,4 +8,4 @@ if dpdk_conf.has('RTE_HAS_JANSSON')
     ext_deps += jansson_dep
 endif
 
-deps += ['ethdev', 'telemetry']
+deps = ['ethdev']
lib/mldev/meson.build +1 -1
index 2c933baad6..6069fff1f0 100644
@@ -41,7 +41,7 @@ driver_sdk_headers += files(
         'mldev_utils.h',
 )
 
-deps += ['mempool', 'mbuf']
+deps = ['mbuf']
 
 if get_option('buildtype').contains('debug')
         cflags += [ '-DRTE_LIBRTE_ML_DEV_DEBUG' ]
lib/net/meson.build +1 -1
index 8afcc4ed37..a99d57e514 100644
@@ -37,7 +37,7 @@ sources = files(
         'rte_net.c',
         'rte_net_crc.c',
 )
-deps += ['mbuf']
+deps = ['mbuf']
 
 if dpdk_conf.has('RTE_ARCH_X86_64')
     net_crc_sse42_cpu_support = (cc.get_define('__PCLMUL__', args: machine_args) != '')
lib/node/meson.build +1 -1
index 0bed97a96c..368ce1dc63 100644
@@ -34,4 +34,4 @@ headers = files(
 
 # Strict-aliasing rules are violated by uint8_t[] to context size casts.
 cflags += '-fno-strict-aliasing'
-deps += ['graph', 'mbuf', 'lpm', 'ethdev', 'mempool', 'cryptodev', 'ip_frag']
+deps = ['graph', 'lpm', 'cryptodev', 'ip_frag']
lib/pcapng/meson.build +1 -1
index 4549925d41..e8f059a9b0 100644
@@ -4,4 +4,4 @@
 sources = files('rte_pcapng.c')
 headers = files('rte_pcapng.h')
 
-deps += ['ethdev']
+deps = ['ethdev']
lib/pdcp/meson.build +1 -1
index f4f9246bcb..f6f3d6237a 100644
@@ -18,4 +18,4 @@ sources = files(
 headers = files('rte_pdcp.h')
 indirect_headers += files('rte_pdcp_group.h')
 
-deps += ['mbuf', 'net', 'cryptodev', 'security', 'reorder']
+deps = ['security', 'reorder']
lib/pdump/meson.build +1 -1
index da8d51b616..23d7db794b 100644
@@ -9,4 +9,4 @@ endif
 
 sources = files('rte_pdump.c')
 headers = files('rte_pdump.h')
-deps += ['ethdev', 'bpf', 'pcapng']
+deps = ['bpf', 'pcapng']
lib/pipeline/meson.build +1 -1
index fd5e0dc6bb..f08eca70d1 100644
@@ -25,4 +25,4 @@ headers = files(
         'rte_swx_extern.h',
         'rte_swx_ctl.h',
 )
-deps += ['port', 'table', 'meter', 'sched', 'cryptodev', 'ipsec']
+deps = ['table', 'ipsec']
lib/port/meson.build +1 -1
index b597772872..0524c3c049 100644
@@ -40,7 +40,7 @@ headers = files(
         'rte_swx_port_ring.h',
         'rte_swx_port_source_sink.h',
 )
-deps += ['ethdev', 'sched', 'ip_frag', 'cryptodev', 'eventdev']
+deps = ['sched', 'ip_frag', 'eventdev']
 
 if dpdk_conf.has('RTE_HAS_LIBPCAP')
     dpdk_conf.set('RTE_PORT_PCAP', 1)
lib/power/meson.build +1 -2
index b3a7bc7b2e..5673db4e5c 100644
@@ -26,5 +26,4 @@ headers = files(
         'rte_power_qos.h',
         'rte_power_uncore.h',
 )
-
-deps += ['timer', 'ethdev']
+deps = ['timer', 'ethdev']
lib/rawdev/meson.build +0 -2
index 7dfc3d5cf9..8841f003d7 100644
@@ -9,5 +9,3 @@ endif
 
 sources = files('rte_rawdev.c')
 headers = files('rte_rawdev.h', 'rte_rawdev_pmd.h')
-
-deps += ['telemetry']
lib/rcu/meson.build +1 -1
index 71143f5210..b78f46fad7 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_rcu_qsbr.c')
 headers = files('rte_rcu_qsbr.h')
 
-deps += ['ring']
+deps = ['ring']
lib/regexdev/meson.build +1 -1
index 426e764ece..3e20fa387d 100644
@@ -10,4 +10,4 @@ endif
 sources = files('rte_regexdev.c')
 headers = files('rte_regexdev.h', 'rte_regexdev_driver.h')
 indirect_headers += files('rte_regexdev_core.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/reorder/meson.build +1 -1
index 03aed53d90..1e088a7d97 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_reorder.c')
 headers = files('rte_reorder.h')
-deps += ['mbuf']
+deps = ['mbuf']
lib/rib/meson.build +1 -1
index e98f708481..70a9072255 100644
@@ -4,4 +4,4 @@
 
 sources = files('rte_rib.c', 'rte_rib6.c')
 headers = files('rte_rib.h', 'rte_rib6.h')
-deps += ['net', 'mempool']
+deps = ['net']
lib/ring/meson.build +0 -1
index 7fca958ed7..c20685c689 100644
@@ -18,4 +18,3 @@ indirect_headers += files (
         'rte_ring_rts.h',
         'rte_ring_rts_elem_pvt.h',
 )
-deps += ['telemetry']
lib/sched/meson.build +1 -1
index df75db51ed..7ca8ec09df 100644
@@ -15,4 +15,4 @@ headers = files(
         'rte_sched_common.h',
         'rte_pie.h',
 )
-deps += ['mbuf', 'meter']
+deps = ['mbuf', 'meter']
lib/security/meson.build +1 -1
index 1034a7a299..e4545a8c72 100644
@@ -3,4 +3,4 @@
 
 sources = files('rte_security.c')
 headers = files('rte_security.h', 'rte_security_driver.h')
-deps += ['mempool', 'cryptodev', 'net']
+deps = ['cryptodev', 'net']
lib/table/meson.build +1 -1
index 9b3d9ac759..78d7e87eab 100644
@@ -39,7 +39,7 @@ headers = files(
         'rte_table_lpm_ipv6.h',
         'rte_table_stub.h',
 )
-deps += ['mbuf', 'port', 'lpm', 'hash', 'acl']
+deps = ['port', 'lpm', 'acl']
 
 indirect_headers += files(
         'rte_lru_arm64.h',
lib/telemetry/meson.build +1 -1
index 489d000047..3e3a2cfc32 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-deps += 'log'
+deps = ['log']
 sources = files('telemetry.c', 'telemetry_data.c', 'telemetry_legacy.c')
 headers = files('rte_telemetry.h')
 includes += include_directories('../metrics')
lib/vhost/meson.build +1 -1
index 51bcf17244..5103bca069 100644
@@ -45,4 +45,4 @@ headers = files(
 driver_sdk_headers = files(
         'vdpa_driver.h',
 )
-deps += ['ethdev', 'cryptodev', 'hash', 'pci', 'dmadev']
+deps = ['ethdev', 'cryptodev', 'hash', 'pci', 'dmadev']
Signature · 1 line
2.43.5
#49 lore raw

PATCH v5 6/8 build: reduce driver dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Remove any unnecessary dependencies from the driver dependency lists. This will give each driver a near-minimum set of required dependencies.

---
 drivers/baseband/fpga_5gnr_fec/meson.build | 2 +-
 drivers/baseband/fpga_lte_fec/meson.build  | 2 +-
 drivers/baseband/la12xx/meson.build        | 2 +-
 drivers/baseband/null/meson.build          | 2 +-
 drivers/baseband/turbo_sw/meson.build      | 2 +-
 drivers/bus/auxiliary/meson.build          | 2 --
 drivers/bus/dpaa/meson.build               | 2 +-
 drivers/bus/fslmc/meson.build              | 2 +-
 drivers/bus/ifpga/meson.build              | 2 +-
 drivers/bus/pci/meson.build                | 4 +---
 drivers/bus/platform/meson.build           | 1 -
 drivers/bus/uacce/meson.build              | 2 --
 drivers/bus/vdev/meson.build               | 2 --
 drivers/common/cnxk/meson.build            | 4 ++--
 drivers/common/cpt/meson.build             | 2 +-
 drivers/common/idpf/meson.build            | 2 +-
 drivers/common/mlx5/meson.build            | 2 +-
 drivers/common/qat/meson.build             | 3 ++-
 drivers/compress/mlx5/meson.build          | 2 +-
 drivers/compress/nitrox/meson.build        | 2 +-
 drivers/compress/octeontx/meson.build      | 2 +-
 drivers/crypto/bcmfs/meson.build           | 2 +-
 drivers/crypto/cnxk/meson.build            | 2 +-
 drivers/crypto/dpaa_sec/meson.build        | 2 +-
 drivers/crypto/ipsec_mb/meson.build        | 2 +-
 drivers/crypto/mlx5/meson.build            | 2 +-
 drivers/crypto/nitrox/meson.build          | 2 +-
 drivers/dma/cnxk/meson.build               | 2 +-
 drivers/dma/dpaa/meson.build               | 2 +-
 drivers/dma/dpaa2/meson.build              | 2 +-
 drivers/dma/odm/meson.build                | 2 +-
 drivers/dma/skeleton/meson.build           | 2 +-
 drivers/event/cnxk/meson.build             | 2 +-
 drivers/event/dlb2/meson.build             | 2 +-
 drivers/event/dpaa2/meson.build            | 2 +-
 drivers/event/octeontx/meson.build         | 3 +--
 drivers/event/sw/meson.build               | 2 +-
 drivers/mempool/cnxk/meson.build           | 2 +-
 drivers/mempool/dpaa/meson.build           | 2 +-
 drivers/mempool/dpaa2/meson.build          | 2 +-
 drivers/mempool/octeontx/meson.build       | 2 +-
 drivers/ml/cnxk/meson.build                | 2 +-
 drivers/net/cnxk/meson.build               | 4 +---
 drivers/net/iavf/meson.build               | 2 +-
 drivers/net/ice/meson.build                | 2 +-
 drivers/net/mana/meson.build               | 2 +-
 drivers/net/mlx5/meson.build               | 2 +-
 drivers/net/sfc/meson.build                | 2 +-
 drivers/net/softnic/meson.build            | 2 +-
 drivers/net/virtio/meson.build             | 2 +-
 drivers/raw/cnxk_bphy/meson.build          | 2 +-
 drivers/raw/cnxk_gpio/meson.build          | 2 +-
 drivers/raw/gdtc/meson.build               | 2 +-
 drivers/raw/ntb/meson.build                | 2 +-
 drivers/raw/skeleton/meson.build           | 2 +-
 drivers/regex/cn9k/meson.build             | 2 +-
 drivers/regex/mlx5/meson.build             | 2 +-
 drivers/vdpa/ifc/meson.build               | 2 +-
 drivers/vdpa/meson.build                   | 3 +--
 drivers/vdpa/mlx5/meson.build              | 2 +-
 drivers/vdpa/sfc/meson.build               | 2 +-
 61 files changed, 59 insertions(+), 71 deletions(-)
drivers/baseband/fpga_5gnr_fec/meson.build +1 -1
index c3678d23eb..31b9e92fbb 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2020 Intel Corporation
 
-deps += ['bus_vdev', 'ring', 'pci', 'bus_pci']
+deps += ['bus_vdev', 'bus_pci']
 
 sources = files('rte_fpga_5gnr_fec.c')
 
drivers/baseband/fpga_lte_fec/meson.build +1 -1
index 14e07826ef..fbf24755db 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Intel Corporation
 
-deps += ['bus_vdev', 'ring', 'pci', 'bus_pci']
+deps += ['bus_vdev', 'bus_pci']
 sources = files('fpga_lte_fec.c')
drivers/baseband/la12xx/meson.build +1 -1
index 7b7e41c961..e1dbdd0fa7 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2020-2021 NXP
 
-deps += ['bus_vdev', 'ring']
+deps += ['bus_vdev']
 
 sources = files('bbdev_la12xx.c')
drivers/baseband/null/meson.build +1 -1
index 22863f0bd8..716d6c6fdb 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <[email protected]>
 
-deps += ['bus_vdev', 'ring']
+deps += ['bus_vdev']
 sources = files('bbdev_null.c')
drivers/baseband/turbo_sw/meson.build +1 -1
index a9035a753e..ac18e8a9b6 100644
@@ -26,5 +26,5 @@ if dep_dec5g.found()
     cflags += ['-DRTE_BBDEV_SDK_AVX512']
 endif
 
-deps += ['bus_vdev', 'ring']
+deps += ['bus_vdev']
 sources = files('bbdev_turbo_software.c')
drivers/bus/auxiliary/meson.build +0 -2
index 10468fd130..a113f11743 100644
@@ -13,5 +13,3 @@ if is_linux
 endif
 
 require_iova_in_mbuf = false
-
-deps += ['kvargs']
drivers/bus/dpaa/meson.build +1 -1
index 5506f2bffc..a2314fdebe 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_dpaax', 'eventdev']
+deps = ['common_dpaax', 'eventdev']
 sources = files(
         'base/fman/fman.c',
         'base/fman/fman_hw.c',
drivers/bus/fslmc/meson.build +1 -1
index 70098ad778..a0e11f7081 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_dpaax', 'eventdev', 'kvargs']
+deps = ['common_dpaax', 'eventdev']
 sources = files(
         'fslmc_bus.c',
         'fslmc_vfio.c',
drivers/bus/ifpga/meson.build +1 -1
index dedc94db2d..e87b08eaf4 100644
@@ -7,6 +7,6 @@ if is_windows
     subdir_done()
 endif
 
-deps += ['pci', 'kvargs', 'rawdev']
+deps = ['pci', 'rawdev']
 driver_sdk_headers += files('bus_ifpga_driver.h')
 sources = files('ifpga_bus.c')
drivers/bus/pci/meson.build +1 -3
index fede114dc7..776c3d1550 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017 Intel Corporation
 
-deps += ['pci']
+deps = ['pci']
 headers = files('rte_bus_pci.h')
 driver_sdk_headers = files('bus_pci_driver.h')
 sources = files('pci_common.c',
@@ -31,5 +31,3 @@ if is_windows
 endif
 
 require_iova_in_mbuf = false
-
-deps += ['kvargs']
drivers/bus/platform/meson.build +0 -1
index 8633cc4e75..2039c23ac6 100644
@@ -10,7 +10,6 @@ endif
 
 require_iova_in_mbuf = false
 
-deps += ['kvargs']
 sources = files(
         'platform_params.c',
         'platform.c',
drivers/bus/uacce/meson.build +0 -2
index a659d65f23..130148a315 100644
@@ -8,5 +8,3 @@ endif
 
 sources = files('uacce.c')
 driver_sdk_headers += files('bus_uacce_driver.h')
-
-deps += ['kvargs']
drivers/bus/vdev/meson.build +0 -2
index 50f0c8918d..24993c88a3 100644
@@ -9,5 +9,3 @@ headers = files('rte_bus_vdev.h')
 driver_sdk_headers = files('bus_vdev_driver.h')
 
 require_iova_in_mbuf = false
-
-deps += ['kvargs']
drivers/common/cnxk/meson.build +2 -2
index 9e3fd44317..e4ee9474f6 100644
@@ -8,7 +8,7 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     subdir_done()
 endif
 
-deps = ['eal', 'pci', 'bus_pci', 'mbuf', 'security']
+deps = ['bus_pci', 'security']
 sources = files(
         'roc_ae.c',
         'roc_aes.c',
@@ -105,7 +105,7 @@ elif soc_type == 'cn20k'
     dpdk_conf.set('ROC_PLATFORM_CN20K', 1)
 endif
 
-deps += ['bus_pci', 'net', 'telemetry']
+deps += ['bus_pci']
 
 require_iova_in_mbuf = false
 
drivers/common/cpt/meson.build +1 -1
index c09824a651..a4b000dc37 100644
@@ -9,5 +9,5 @@ endif
 
 sources = files('cpt_fpm_tables.c', 'cpt_pmd_ops_helper.c')
 
-deps = ['kvargs', 'pci', 'cryptodev']
+deps = ['pci', 'cryptodev']
 includes += include_directories('../../crypto/octeontx')
drivers/common/idpf/meson.build +1 -1
index 46fd45c03b..e24daac761 100644
@@ -7,7 +7,7 @@ endif
 
 includes += include_directories('../iavf')
 
-deps += ['mbuf']
+deps = ['mbuf']
 
 sources = files(
         'idpf_common_device.c',
drivers/common/mlx5/meson.build +1 -1
index 1eefc02f06..b94c956495 100644
@@ -12,7 +12,7 @@ if is_windows and not is_ms_linker and not meson.is_cross_build()
     subdir_done()
 endif
 
-deps += ['hash', 'pci', 'bus_pci', 'bus_auxiliary', 'net', 'eal', 'kvargs']
+deps += ['hash', 'bus_pci', 'bus_auxiliary']
 sources += files(
         'mlx5_devx_cmds.c',
         'mlx5_common.c',
drivers/common/qat/meson.build +2 -1
index 5a8de16fe0..5ffb56fc93 100644
@@ -71,7 +71,7 @@ else
     endif
 endif
 
-deps += ['bus_pci', 'cryptodev', 'net', 'compressdev']
+deps += ['bus_pci']
 sources += files(
         'qat_common.c',
         'qat_qp.c',
@@ -101,6 +101,7 @@ if qat_compress
         ]
         sources += files(join_paths(qat_compress_relpath, f))
     endforeach
+    deps += ['compressdev']
 endif
 
 if qat_crypto
drivers/compress/mlx5/meson.build +1 -1
index 26a0e0cd09..ddb9e0f82c 100644
@@ -7,7 +7,7 @@ if not is_linux
     subdir_done()
 endif
 
-deps += ['common_mlx5', 'eal', 'compressdev']
+deps += ['common_mlx5', 'compressdev']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/compress/nitrox/meson.build +1 -1
index 1becc66912..c3db4ac2bb 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_nitrox', 'bus_pci', 'compressdev']
+deps += ['common_nitrox', 'compressdev']
 
 sources += files(
         'nitrox_comp.c',
drivers/compress/octeontx/meson.build +1 -1
index 16f973f4d7..0ccde449e8 100644
@@ -9,7 +9,7 @@ endif
 
 sources = files('otx_zip.c', 'otx_zip_pmd.c')
 includes += include_directories('include')
-deps += ['mempool_octeontx', 'bus_pci']
+deps += ['mempool_octeontx']
 ext_deps += dep
 
 require_iova_in_mbuf = false
drivers/crypto/bcmfs/meson.build +1 -1
index 5842f83a3b..678bab7398 100644
@@ -9,7 +9,7 @@ if is_windows
     subdir_done()
 endif
 
-deps += ['eal', 'bus_vdev']
+deps += ['bus_vdev']
 sources = files(
         'bcmfs_logs.c',
         'bcmfs_device.c',
drivers/crypto/cnxk/meson.build +1 -1
index aa840fb7bb..c5a5725e1a 100644
@@ -25,7 +25,7 @@ sources = files(
 )
 
 headers = files('rte_pmd_cnxk_crypto.h')
-deps += ['bus_pci', 'common_cnxk', 'security', 'eventdev']
+deps += ['common_cnxk', 'eventdev']
 includes += include_directories('../../../lib/net', '../../event/cnxk')
 
 if get_option('buildtype').contains('debug')
drivers/crypto/dpaa_sec/meson.build +1 -1
index f87ad6c7e7..9efac952c4 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['bus_dpaa', 'mempool_dpaa', 'security']
+deps += ['mempool_dpaa', 'security']
 sources = files('dpaa_sec.c', 'dpaa_sec_raw_dp.c')
 
 includes += include_directories('../../bus/dpaa/include')
drivers/crypto/ipsec_mb/meson.build +1 -1
index 89ee03454b..01198cca68 100644
@@ -45,5 +45,5 @@ sources = files(
         'pmd_snow3g.c',
         'pmd_zuc.c',
 )
-deps += ['bus_vdev', 'net', 'security']
+deps += ['bus_vdev', 'security']
 require_iova_in_mbuf = false
drivers/crypto/mlx5/meson.build +1 -1
index d7bc8ec967..595053d8cd 100644
@@ -7,7 +7,7 @@ if not (is_linux or is_windows)
     subdir_done()
 endif
 
-deps += ['common_mlx5', 'eal', 'cryptodev']
+deps += ['common_mlx5', 'cryptodev']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/crypto/nitrox/meson.build +1 -1
index f8887713d2..85e3ca2b28 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['common_nitrox', 'bus_pci', 'cryptodev']
+deps += ['common_nitrox', 'cryptodev']
 
 sources += files(
         'nitrox_sym.c',
drivers/dma/cnxk/meson.build +1 -1
index 8ccc1c2cb7..738774d542 100644
@@ -12,7 +12,7 @@ driver_sdk_headers = files(
         'cnxk_dma_event_dp.h',
 )
 
-deps += ['bus_pci', 'common_cnxk', 'dmadev', 'eventdev']
+deps += ['common_cnxk', 'eventdev']
 
 includes += include_directories('../../event/cnxk')
 
drivers/dma/dpaa/meson.build +1 -1
index c31a6d91fe..fec4a45767 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on linux'
 endif
 
-deps += ['dmadev', 'bus_dpaa']
+deps += ['bus_dpaa']
 sources = files('dpaa_qdma.c')
 
 if cc.has_argument('-Wno-pointer-arith')
drivers/dma/dpaa2/meson.build +1 -1
index a523f5edb4..cc4a02440e 100644
@@ -8,7 +8,7 @@ endif
 
 build = dpdk_conf.has('RTE_MEMPOOL_DPAA2')
 reason = 'missing dependency, DPDK DPAA2 mempool driver'
-deps += ['dmadev', 'bus_fslmc', 'mempool_dpaa2', 'ring', 'kvargs']
+deps += ['mempool_dpaa2']
 sources = files('dpaa2_qdma.c')
 
 if cc.has_argument('-Wno-pointer-arith')
drivers/dma/odm/meson.build +1 -1
index d597762d37..959e7e685d 100644
@@ -7,7 +7,7 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64')
     subdir_done()
 endif
 
-deps += ['bus_pci', 'dmadev', 'eal', 'mempool', 'pci']
+deps += ['bus_pci', 'dmadev', 'mempool']
 
 sources = files('odm_dmadev.c', 'odm.c')
 
drivers/dma/skeleton/meson.build +1 -1
index 77055683ad..0d703a36eb 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2021 HiSilicon Limited
 
-deps += ['dmadev', 'kvargs', 'ring', 'bus_vdev']
+deps += ['dmadev', 'ring', 'bus_vdev']
 sources = files(
         'skeleton_dmadev.c',
 )
drivers/event/cnxk/meson.build +1 -1
index 8aaf8116f7..e944f4277f 100644
@@ -311,7 +311,7 @@ foreach flag: extra_flags
 endforeach
 
 headers = files('rte_pmd_cnxk_eventdev.h')
-deps += ['bus_pci', 'common_cnxk', 'net_cnxk', 'crypto_cnxk', 'dma_cnxk']
+deps += ['net_cnxk', 'crypto_cnxk', 'dma_cnxk']
 
 require_iova_in_mbuf = false
 
drivers/event/dlb2/meson.build +1 -1
index c024edb311..2bb1b97686 100644
@@ -39,4 +39,4 @@ endif
 
 headers = files('rte_pmd_dlb2.h')
 
-deps += ['mbuf', 'mempool', 'ring', 'pci', 'bus_pci']
+deps += ['bus_pci']
drivers/event/dpaa2/meson.build +1 -1
index dd5063af43..7dae1da32b 100644
@@ -5,7 +5,7 @@ if not is_linux
     build = false
     reason = 'only supported on Linux'
 endif
-deps += ['bus_vdev', 'net_dpaa2', 'crypto_dpaa2_sec']
+deps += ['net_dpaa2', 'crypto_dpaa2_sec']
 sources = files(
         'dpaa2_hw_dpcon.c',
         'dpaa2_eventdev.c',
drivers/event/octeontx/meson.build +1 -2
index eb17e059d8..1227b2e18d 100644
@@ -17,5 +17,4 @@ sources = files(
         'timvf_probe.c',
 )
 
-deps += ['common_octeontx', 'mempool_octeontx', 'bus_vdev', 'net_octeontx']
-deps += ['crypto_octeontx']
+deps = ['net_octeontx', 'crypto_octeontx']
drivers/event/sw/meson.build +1 -1
index 3a3ebd72a3..450969aa7a 100644
@@ -8,5 +8,5 @@ sources = files(
         'sw_evdev_xstats.c',
         'sw_evdev.c',
 )
-deps += ['hash', 'bus_vdev']
+deps += ['bus_vdev']
 require_iova_in_mbuf = false
drivers/mempool/cnxk/meson.build +1 -1
index e388cce26a..7bbed325df 100644
@@ -18,5 +18,5 @@ sources = files(
 )
 
 headers = files('rte_pmd_cnxk_mempool.h')
-deps += ['eal', 'mbuf', 'kvargs', 'bus_pci', 'common_cnxk', 'mempool']
+deps = ['common_cnxk']
 require_iova_in_mbuf = false
drivers/mempool/dpaa/meson.build +1 -1
index c4e9994b83..39fc312344 100644
@@ -6,5 +6,5 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['bus_dpaa']
+deps = ['bus_dpaa']
 sources = files('dpaa_mempool.c')
drivers/mempool/dpaa2/meson.build +1 -1
index 3d16d44158..0099b20b97 100644
@@ -6,7 +6,7 @@ if not is_linux
     reason = 'only supported on Linux'
 endif
 
-deps += ['bus_fslmc']
+deps = ['bus_fslmc']
 sources = files('dpaa2_hw_mempool.c')
 
 headers = files('rte_dpaa2_mempool.h')
drivers/mempool/octeontx/meson.build +1 -1
index 3ccecac75d..f97bcf4a5a 100644
@@ -12,6 +12,6 @@ sources = files(
         'rte_mempool_octeontx.c',
 )
 
-deps += ['mbuf', 'bus_pci', 'common_octeontx']
+deps = ['mbuf', 'bus_pci', 'common_octeontx']
 
 require_iova_in_mbuf = false
drivers/ml/cnxk/meson.build +1 -1
index 0680a0faa5..6c99f5b57b 100644
@@ -55,7 +55,7 @@ sources = files(
         'cnxk_ml_utils.c',
 )
 
-deps += ['mldev', 'common_cnxk', 'kvargs', 'hash']
+deps += ['mldev', 'common_cnxk', 'hash']
 
 if enable_mvtvm
 
drivers/net/cnxk/meson.build +1 -3
index 32ff8aadc0..48a546adb8 100644
@@ -320,9 +320,7 @@ sources += files(
 endif
 endif
 
-
-deps += ['bus_pci', 'cryptodev', 'eventdev', 'security']
-deps += ['common_cnxk', 'mempool_cnxk']
+deps = ['eventdev', 'mempool_cnxk']
 
 # Allow implicit vector conversions and strict aliasing warning
 extra_flags = ['-flax-vector-conversions', '-Wno-strict-aliasing']
drivers/net/iavf/meson.build +1 -1
index b48bb83438..4849c2341a 100644
@@ -9,7 +9,7 @@ includes += include_directories('../../common/iavf')
 
 testpmd_sources = files('iavf_testpmd.c')
 
-deps += ['common_iavf', 'security', 'cryptodev']
+deps += ['common_iavf', 'security']
 
 sources = files(
         'iavf_ethdev.c',
drivers/net/ice/meson.build +1 -1
index 1c9dc0cc6d..f9e37f5386 100644
@@ -18,7 +18,7 @@ sources = files(
 
 testpmd_sources = files('ice_testpmd.c')
 
-deps += ['hash', 'net', 'common_iavf']
+deps += ['hash', 'common_iavf']
 includes += include_directories('base', '../../common/iavf')
 
 if arch_subdir == 'x86'
drivers/net/mana/meson.build +1 -1
index 4d163fc0f2..68f03fd60d 100644
@@ -7,7 +7,7 @@ if not is_linux or not (dpdk_conf.has('RTE_ARCH_X86') or dpdk_conf.has('RTE_ARCH
     subdir_done()
 endif
 
-deps += ['pci', 'bus_pci', 'net', 'eal', 'kvargs']
+deps += ['bus_pci']
 
 sources += files(
         'gdma.c',
drivers/net/mlx5/meson.build +1 -1
index 78a8648b43..7c4a63524f 100644
@@ -8,7 +8,7 @@ if not (is_linux or is_windows)
     subdir_done()
 endif
 
-deps += ['hash', 'common_mlx5']
+deps += ['common_mlx5']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/net/sfc/meson.build +1 -1
index 5adde68517..820ee6c91e 100644
@@ -71,7 +71,7 @@ if not cc.links(atomic_check_code)
     ext_deps += libatomic_dep
 endif
 
-deps += ['common_sfc_efx', 'bus_pci', 'hash']
+deps += ['common_sfc_efx', 'hash']
 sources = files(
         'sfc_ethdev.c',
         'sfc_kvargs.c',
drivers/net/softnic/meson.build +1 -1
index 5dfbd16c77..1529ef38f9 100644
@@ -15,4 +15,4 @@ sources = files(
         'rte_eth_softnic_swq.c',
         'rte_eth_softnic_thread.c',
 )
-deps += ['pipeline', 'port', 'table']
+deps += ['pipeline']
drivers/net/virtio/meson.build +1 -1
index 02742da5c2..ce23521ca2 100644
@@ -21,7 +21,7 @@ sources += files(
         'virtio_rxtx_simple.c',
         'virtqueue.c',
 )
-deps += ['kvargs', 'bus_pci']
+deps += ['bus_pci']
 
 if arch_subdir == 'x86'
     if cc_has_avx512
drivers/raw/cnxk_bphy/meson.build +1 -1
index bb5d2ffb80..b38b071697 100644
@@ -2,7 +2,7 @@
 # Copyright(C) 2021 Marvell.
 #
 
-deps += ['bus_pci', 'common_cnxk', 'rawdev']
+deps += ['common_cnxk', 'rawdev']
 sources = files(
         'cnxk_bphy.c',
         'cnxk_bphy_cgx.c',
drivers/raw/cnxk_gpio/meson.build +1 -1
index 9d9a527392..6d17fe573f 100644
@@ -2,7 +2,7 @@
 # Copyright(C) 2021 Marvell.
 #
 
-deps += ['bus_vdev', 'common_cnxk', 'rawdev', 'kvargs']
+deps += ['bus_vdev', 'common_cnxk', 'rawdev']
 sources = files(
         'cnxk_gpio.c',
         'cnxk_gpio_irq.c',
drivers/raw/gdtc/meson.build +1 -1
index 3e748ca58d..b86f9510ce 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2024 ZTE Corporation
 
-deps += ['rawdev', 'kvargs', 'mbuf', 'bus_pci']
+deps += ['rawdev', 'mbuf', 'bus_pci']
 sources = files('gdtc_rawdev.c')
drivers/raw/ntb/meson.build +1 -1
index 9096f2b25a..8f79d3b16a 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019 Intel Corporation.
 
-deps += ['rawdev', 'mbuf', 'mempool', 'pci', 'bus_pci']
+deps += ['rawdev', 'mbuf', 'bus_pci']
 sources = files('ntb.c',
                 'ntb_hw_intel.c')
 headers = files('rte_pmd_ntb.h')
drivers/raw/skeleton/meson.build +1 -1
index 9d5fcf6514..7d76fe71b3 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright 2018 NXP
 
-deps += ['rawdev', 'kvargs', 'mbuf', 'bus_vdev']
+deps += ['rawdev', 'mbuf', 'bus_vdev']
 sources = files(
         'skeleton_rawdev.c',
         'skeleton_rawdev_test.c',
drivers/regex/cn9k/meson.build +1 -1
index b22275928a..40aced4c62 100644
@@ -13,4 +13,4 @@ sources = files(
 )
 
 deps += ['bus_pci']
-deps += ['common_cnxk', 'mempool_cnxk']
+deps += ['mempool_cnxk']
drivers/regex/mlx5/meson.build +1 -1
index 6070b37501..f75bf2e084 100644
@@ -7,7 +7,7 @@ if not is_linux
     subdir_done()
 endif
 
-deps += ['common_mlx5', 'eal']
+deps += ['common_mlx5']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/vdpa/ifc/meson.build +1 -1
index f78d36a715..f4ed4f491f 100644
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-deps += 'vhost'
+deps += 'bus_pci'
 sources = files('ifcvf_vdpa.c', 'base/ifcvf.c')
 includes += include_directories('base')
drivers/vdpa/meson.build +1 -2
index e01c277b9e..747cdc7c55 100644
@@ -11,5 +11,4 @@ drivers = [
         'nfp',
         'sfc',
 ]
-std_deps = ['bus_pci']
-std_deps += ['vhost']
+std_deps = ['vhost']
drivers/vdpa/mlx5/meson.build +1 -1
index e224d1bcc9..1263ac43a4 100644
@@ -7,7 +7,7 @@ if not is_linux
     subdir_done()
 endif
 
-deps += ['hash', 'common_mlx5', 'vhost', 'pci', 'eal', 'sched']
+deps += ['common_mlx5', 'vhost', 'sched']
 if not dpdk_conf.has('RTE_COMMON_MLX5')
     # avoid referencing undefined variables from common/mlx5
     subdir_done()
drivers/vdpa/sfc/meson.build +1 -1
index 933f3f18f3..465ca9f220 100644
@@ -16,7 +16,7 @@ foreach flag: extra_flags
     endif
 endforeach
 
-deps += ['common_sfc_efx', 'bus_pci']
+deps += ['common_sfc_efx']
 sources = files(
         'sfc_vdpa.c',
         'sfc_vdpa_hw.c',
Signature · 1 line
2.43.5
#50 lore raw

Re: [PATCH v5 6/8] build: reduce driver dependencies

Quoted 24 lines · Anatoly Burakov

From: Bruce Richardson <[email protected]>

Remove any unnecessary dependencies from the driver dependency lists. This will give each driver a near-minimum set of required dependencies.

---

drivers/common/qat/meson.build +1 -1
index 5a8de16fe0..5ffb56fc93 100644
@@ -71,7 +71,7 @@ else
      endif
  endif
 
-deps += ['bus_pci', 'cryptodev', 'net', 'compressdev']
+deps += ['bus_pci']
  sources += files(
          'qat_common.c',
          'qat_qp.c',

drivers/common/qat/meson.build if qat_compress · line 107

Quoted 7 lines
drivers/common/qat/meson.build +1 -0
@@ -101,6 +101,7 @@ if qat_compress
          ]
          sources += files(join_paths(qat_compress_relpath, f))
      endforeach
+    deps += ['compressdev']
  endif
 
  if qat_crypto

Seems that these changes were overly aggressive and cause build failures. Will fix in v6.

Signature · 2 lines
Thanks,
Anatoly
#51 lore raw

Re: [PATCH v5 6/8] build: reduce driver dependencies

Quoted 32 lines · Anatoly
Quoted 30 lines · Anatoly Burakov

From: Bruce Richardson <[email protected]>

Remove any unnecessary dependencies from the driver dependency lists. This will give each driver a near-minimum set of required dependencies.

---

drivers/common/qat/meson.build +2 -1
index 5a8de16fe0..5ffb56fc93 100644
@@ -71,7 +71,7 @@ else
      endif
  endif
 
-deps += ['bus_pci', 'cryptodev', 'net', 'compressdev']
+deps += ['bus_pci']
  sources += files(
          'qat_common.c',
          'qat_qp.c',
@@ -101,6 +101,7 @@ if qat_compress
          ]
          sources += files(join_paths(qat_compress_relpath, f))
      endforeach
+    deps += ['compressdev']
  endif
 
Quoted 4 lines

drivers/common/qat/meson.build if qat_compress · line 107

Quoted 1 line
drivers/common/qat/meson.build +0 -0
  if qat_crypto

Seems that these changes were overly aggressive and cause build failures. Will fix in v6.

Indeed, some crypto-related headers still get included in "common" code.

Signature · 1 line
David Marchand
#52 lore raw

PATCH v5 7/8 build: reduce app dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Remove any unnecessary dependencies from the app dependency lists. This will give each app a near-minimum set of required dependencies.

---
 app/dumpcap/meson.build          | 2 +-
 app/graph/meson.build            | 2 +-
 app/pdump/meson.build            | 2 +-
 app/proc-info/meson.build        | 2 +-
 app/test-crypto-perf/meson.build | 2 +-
 app/test-fib/meson.build         | 2 +-
 app/test-sad/meson.build         | 2 +-
 app/test/meson.build             | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)
app/dumpcap/meson.build +1 -1
index 69c016c780..6204cf051a 100644
@@ -14,4 +14,4 @@ endif
 
 ext_deps += pcap_dep
 sources = files('main.c')
-deps += ['ethdev', 'pdump', 'pcapng', 'bpf']
+deps += ['pdump']
app/graph/meson.build +1 -1
index 344e4a418f..9c4cd080d9 100644
@@ -9,7 +9,7 @@ if not build
     subdir_done()
 endif
 
-deps += ['graph', 'eal', 'lpm', 'ethdev', 'node', 'cmdline', 'net']
+deps += ['node', 'cmdline']
 sources = files(
         'cli.c',
         'conn.c',
app/pdump/meson.build +1 -1
index fb282bba1f..a10f9d6124 100644
@@ -8,4 +8,4 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ethdev', 'kvargs', 'pdump']
+deps += ['pdump']
app/proc-info/meson.build +1 -1
index 5fefb0857e..3631d7a675 100644
@@ -8,5 +8,5 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ethdev', 'security', 'eventdev']
+deps += ['security', 'eventdev']
 optional_deps += 'metrics'
app/test-crypto-perf/meson.build +1 -1
index 1ac0ac1099..839d42e28d 100644
@@ -19,5 +19,5 @@ sources = files(
         'cperf_test_verify.c',
         'main.c',
 )
-deps += ['cryptodev', 'net', 'security']
+deps += ['cryptodev']
 optional_deps += 'crypto_scheduler'
app/test-fib/meson.build +1 -1
index eb36772cf3..25e2ea1a1d 100644
@@ -8,4 +8,4 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['fib', 'lpm', 'net']
+deps += ['fib', 'lpm']
app/test-sad/meson.build +1 -1
index a50616a9c7..414e2a05cb 100644
@@ -8,4 +8,4 @@ if is_windows
 endif
 
 sources = files('main.c')
-deps += ['ipsec', 'net']
+deps += ['ipsec']
app/test/meson.build +1 -1
index 36c2016a49..a77c152ef3 100644
@@ -2,7 +2,7 @@
 # Copyright(c) 2017-2023 Intel Corporation
 
 # the main test files [test.c and commands.c] relies on these libraries
-deps += ['cmdline', 'ring', 'mempool', 'mbuf']
+deps += ['cmdline']
 sources += files('commands.c', 'test.c')
 
 # optional dependencies: some files may use these - and so we should link them in -
Signature · 1 line
2.43.5
#53 lore raw

PATCH v5 8/8 devtools: add script to generate DPDK dependency graphs

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

Rather than the single monolithic graph that would be output from the deps.dot file in a build directory, we can post-process that to generate simpler graphs for different tasks. This new "draw_dependency_graphs" script takes the "deps.dot" as input and generates an output file that has the nodes categorized, filtering them based off the requested node or category. For example, use "--match net/ice" to show the dependency tree from that driver, or "--match lib" to show just the library dependency tree.

---
 devtools/draw-dependency-graphs.py | 223 +++++++++++++++++++++++++++++
 1 file changed, 223 insertions(+)
 create mode 100755 devtools/draw-dependency-graphs.py
devtools/draw-dependency-graphs.py new file +223 -0
new file mode 100755
index 0000000000..4fb765498d
@@ -0,0 +1,223 @@
+#! /usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 Intel Corporation
+
+import argparse
+import collections
+import sys
+import typing as T
+
+# typedef for dependency data types
+Deps = T.Set[str]
+DepData = T.Dict[str, T.Dict[str, T.Dict[bool, Deps]]]
+
+
+def parse_dep_line(line: str) -> T.Tuple[str, Deps, str, bool]:
+    """Parse digraph line into (component, {dependencies}, type, optional)."""
+    # extract attributes first
+    first, last = line.index("["), line.rindex("]")
+    edge_str, attr_str = line[:first], line[first + 1 : last]
+    # key=value, key=value, ...
+    attrs = {
+        key.strip('" '): value.strip('" ')
+        for attr_kv in attr_str.split(",")
+        for key, value in [attr_kv.strip().split("=", 1)]
+    }
+    # check if edge is defined as dotted line, meaning it's optional
+    optional = "dotted" in attrs.get("style", "")
+    try:
+        component_type = attrs["dpdk_componentType"]
+    except KeyError as _e:
+        raise ValueError(f"Error: missing component type: {line}") from _e
+
+    # now, extract component name and any of its dependencies
+    deps: T.Set[str] = set()
+    try:
+        component, deps_str = edge_str.strip('" ').split("->", 1)
+        component = component.strip().strip('" ')
+        deps_str = deps_str.strip().strip("{}")
+        deps = {d.strip('" ') for d in deps_str.split(",")}
+    except ValueError as _e:
+        component = edge_str.strip('" ')
+
+    return component, deps, component_type, optional
+
+
+def gen_dep_line(component: str, deps: T.Set[str], optional: bool) -> str:
+    """Generate a dependency line for a component."""
+    # we use dotted line to represent optional components
+    attr_str = ' [style="dotted"]' if optional else ""
+    dep_list_str = '", "'.join(deps)
+    deps_str = "" if not deps else f' -> {{ "{dep_list_str}" }}'
+    return f'    "{component}"{deps_str}{attr_str}\n'
+
+
+def read_deps_list(lines: T.List[str]) -> DepData:
+    """Read a list of dependency lines into a dictionary."""
+    deps_data: T.Dict[str, T.Any] = {}
+    for ln in lines:
+        if ln.startswith("digraph") or ln == "}":
+            continue
+
+        component, deps, component_type, optional = parse_dep_line(ln)
+
+        # each component will have two sets of dependencies - required and optional
+        c_dict = deps_data.setdefault(component_type, {}).setdefault(component, {})
+        c_dict[optional] = deps
+    return deps_data
+
+
+def create_classified_graph(deps_data: DepData) -> T.Iterator[str]:
+    """Create a graph of dependencies with components classified by type."""
+    yield "digraph dpdk_dependencies {\n  overlap=false\n  model=subset\n"
+    for n, deps_t in enumerate(deps_data.items()):
+        component_type, component_dict = deps_t
+        yield f'  subgraph cluster_{n} {{\n    label = "{component_type}"\n'
+        for component, optional_d in component_dict.items():
+            for optional, deps in optional_d.items():
+                yield gen_dep_line(component, deps, optional)
+        yield "  }\n"
+    yield "}\n"
+
+
+def parse_match(line: str, dep_data: DepData) -> T.List[str]:
+    """Extract list of components from a category string."""
+    # if this is not a compound string, we have very few valid choices
+    if "/" not in line:
+        # is this a category?
+        if line in dep_data:
+            return list(dep_data[line].keys())
+        # this isn't a category. maybe an app name?
+        maybe_app_name = f"dpdk-{line}"
+        if maybe_app_name in dep_data["app"]:
+            return [maybe_app_name]
+        if maybe_app_name in dep_data["examples"]:
+            return [maybe_app_name]
+        # this isn't an app name either, so just look for component with that name
+        for _, component_dict in dep_data.items():
+            if line in component_dict:
+                return [line]
+        # nothing found still. one last try: maybe it's a driver? we have to be careful though
+        # because a driver name may not be unique, e.g. common/iavf and net/iavf. so, only pick
+        # a driver if we can find exactly one driver that matches.
+        found_drivers: T.List[str] = []
+        for component in dep_data["drivers"].keys():
+            _, drv_name = component.split("_", 1)
+            if drv_name == line:
+                found_drivers.append(component)
+        if len(found_drivers) == 1:
+            return found_drivers
+        # we failed to find anything, report error
+        raise ValueError(f"Error: unknown component: {line}")
+
+    # this is a compound string, so we have to do some matching. we may have two or three levels
+    # of hierarchy, as driver/net/ice and net/ice should both be valid.
+
+    # if there are three levels of hierarchy, this must be a driver
+    try:
+        ctype, drv_class, drv_name = line.split("/", 2)
+        component_name = f"{drv_class}_{drv_name}"
+        # we want to directly access the dict to trigger KeyError, and not catch them here
+        if component_name in dep_data[ctype]:
+            return [component_name]
+        else:
+            raise KeyError(f"Unknown category: {line}")
+    except ValueError:
+        # not three levels of hierarchy, try two
+        pass
+
+    first, second = line.split("/", 1)
+
+    # this could still be a driver, just without the "drivers" prefix
+    for component in dep_data["drivers"].keys():
+        if component == f"{first}_{second}":
+            return [component]
+    # could be driver wildcard, e.g. drivers/net
+    if first == "drivers":
+        drv_match: T.List[str] = [
+            drv_name
+            for drv_name in dep_data["drivers"]
+            if drv_name.startswith(f"{second}_")
+        ]
+        if drv_match:
+            return drv_match
+    # may be category + component
+    if first in dep_data:
+        # go through all components in the category
+        if second in dep_data[first]:
+            return [second]
+        # if it's an app or an example, it may have "dpdk-" in front
+        if first in ["app", "examples"]:
+            maybe_app_name = f"dpdk-{second}"
+            if maybe_app_name in dep_data[first]:
+                return [maybe_app_name]
+    # and nothing of value was found
+    raise ValueError(f"Error: unknown component: {line}")
+
+
+def filter_deps(dep_data: DepData, criteria: T.List[str]) -> None:
+    """Filter dependency data to include only specified components."""
+    # this is a two step process: when we get a list of components, we need to
+    # go through all of them and note any dependencies they have, and expand the
+    # list of components with those dependencies. then we filter.
+
+    # walk the dependency list and include all possible dependencies
+    deps_seen: Deps = set()
+    deps_stack = collections.deque(criteria)
+    while deps_stack:
+        component = deps_stack.popleft()
+        if component in deps_seen:
+            continue
+        deps_seen.add(component)
+        for component_type, component_dict in dep_data.items():
+            try:
+                deps = component_dict[component]
+            except KeyError:
+                # wrong component type
+                continue
+            for _, dep_list in deps.items():
+                deps_stack.extend(dep_list)
+    criteria += list(deps_seen)
+
+    # now, "components" has all the dependencies we need to include, so we can filter
+    for component_type, component_dict in dep_data.items():
+        dep_data[component_type] = {
+            component: deps
+            for component, deps in component_dict.items()
+            if component in criteria
+        }
+
+
+def main():
+    parser = argparse.ArgumentParser(
+        description="Utility to generate dependency tree graphs for DPDK"
+    )
+    parser.add_argument(
+        "--match",
+        type=str,
+        help="Output hierarchy for component or category, e.g. net/ice, lib, app, drivers/net, etc.",
+    )
+    parser.add_argument(
+        "input_file",
+        type=argparse.FileType("r"),
+        help="Path to the deps.dot file from a DPDK build directory",
+    )
+    parser.add_argument(
+        "output_file",
+        type=argparse.FileType("w"),
+        help="Path to the desired output dot file",
+    )
+    args = parser.parse_args()
+
+    deps = read_deps_list([ln.strip() for ln in args.input_file.readlines()])
+    if args.match:
+        try:
+            filter_deps(deps, parse_match(args.match, deps))
+        except (KeyError, ValueError) as e:
+            print(e, file=sys.stderr)
+            return
+    args.output_file.writelines(create_classified_graph(deps))
+
+
+if __name__ == "__main__":
+    main()
Signature · 1 line
2.43.5
#54 lore raw

v6 cover Record and rework component dependencies

In reply to Anatoly Burakov

As part of the meson build, we can record the dependencies for each component as we process it, logging them to a file. This file can be used as input to a number of other scripts and tools, for example, to graph the dependencies, or to allow higher-level build-config tools to automatically enable component requirements, etc.

The first patch of this set separates dependencies inside meson into optional or mandatory. The second patch of this set generates the basic dependency tree. The third patch does some processing of that dependency tree to identify cases where dependencies are being unnecessarily specified. Reducing these makes it easier to have readable dependency graphs in future, without affecting the build.

The following 4 patches are based on the output of the second patch, and greatly cut down the number of direct dependency links between components. Even with the cut-down dependencies, the full dependency graph is nigh-unreadable, so the final patch adds a new script to generate dependency tree subgraphs, creating dot files for e.g. the dependencies of a particular component, or a component class such as mempool drivers.

v6:
- Fix build for common/qat
- Rebase
- Rename some patch headings to avoid check git log warnings

v4 -> v5:
- Improve optional dependency handling by making it (mostly) automatic
- Fix CI issue from accidentally changing testpmd binary filename
- Explicitly encode display name vs binary name information in the graph
- Reduce some more dependencies
- Update all scripts to handle new graph output format

v3 -> v4:
- Update to latest main

v2 -> v3:
- Split dependencies into optional and mandatory
- Fixup graph scripts to read and generate graphs that encode optional dependencies into the graph
- Python version fixes to avoid using features not available in minimum supported Python version
- Formatting with Ruff, and PEP-484 compliance

Anatoly Burakov (1):
build: introduce optional internal dependencies

Bruce Richardson (7):
build: output a dependency log in build directory
devtools: add script to flag unneeded dependencies
drivers: remove kvargs from class dependencies
lib: reduce library dependencies
drivers: reduce driver dependencies
app: reduce app dependencies
devtools: add script to generate DPDK dependency graphs

 app/dumpcap/meson.build                    |   2 +-
 app/graph/meson.build                      |   2 +-
 app/meson.build                            |  31 ++-
 app/pdump/meson.build                      |   2 +-
 app/proc-info/meson.build                  |   6 +-
 app/test-bbdev/meson.build                 |  18 +-
 app/test-crypto-perf/meson.build           |   6 +-
 app/test-fib/meson.build                   |   2 +-
 app/test-pmd/meson.build                   |  56 ++----
 app/test-sad/meson.build                   |   2 +-
 app/test/meson.build                       |  14 +-
 buildtools/log-deps.py                     |  94 +++++++++
 buildtools/meson.build                     |   2 +
 devtools/draw-dependency-graphs.py         | 223 +++++++++++++++++++++
 devtools/find-duplicate-deps.py            |  62 ++++++
 drivers/baseband/fpga_5gnr_fec/meson.build |   2 +-
 drivers/baseband/fpga_lte_fec/meson.build  |   2 +-
 drivers/baseband/la12xx/meson.build        |   2 +-
 drivers/baseband/null/meson.build          |   2 +-
 drivers/baseband/turbo_sw/meson.build      |   2 +-
 drivers/bus/auxiliary/meson.build          |   2 -
 drivers/bus/dpaa/meson.build               |   2 +-
 drivers/bus/fslmc/meson.build              |   2 +-
 drivers/bus/ifpga/meson.build              |   2 +-
 drivers/bus/pci/meson.build                |   4 +-
 drivers/bus/platform/meson.build           |   1 -
 drivers/bus/uacce/meson.build              |   2 -
 drivers/bus/vdev/meson.build               |   2 -
 drivers/common/cnxk/meson.build            |   4 +-
 drivers/common/cpt/meson.build             |   2 +-
 drivers/common/mlx5/meson.build            |   2 +-
 drivers/common/zsda/meson.build            |   2 +-
 drivers/compress/mlx5/meson.build          |   2 +-
 drivers/compress/nitrox/meson.build        |   2 +-
 drivers/compress/octeontx/meson.build      |   2 +-
 drivers/crypto/bcmfs/meson.build           |   2 +-
 drivers/crypto/cnxk/meson.build            |   2 +-
 drivers/crypto/dpaa_sec/meson.build        |   2 +-
 drivers/crypto/ipsec_mb/meson.build        |   2 +-
 drivers/crypto/mlx5/meson.build            |   2 +-
 drivers/crypto/nitrox/meson.build          |   2 +-
 drivers/dma/cnxk/meson.build               |   2 +-
 drivers/dma/dpaa/meson.build               |   2 +-
 drivers/dma/dpaa2/meson.build              |   2 +-
 drivers/dma/odm/meson.build                |   2 +-
 drivers/dma/skeleton/meson.build           |   2 +-
 drivers/event/cnxk/meson.build             |   2 +-
 drivers/event/dlb2/meson.build             |   2 +-
 drivers/event/dpaa2/meson.build            |   2 +-
 drivers/event/meson.build                  |   2 +-
 drivers/event/octeontx/meson.build         |   3 +-
 drivers/event/sw/meson.build               |   2 +-
 drivers/mempool/cnxk/meson.build           |   2 +-
 drivers/mempool/dpaa/meson.build           |   2 +-
 drivers/mempool/dpaa2/meson.build          |   2 +-
 drivers/mempool/octeontx/meson.build       |   2 +-
 drivers/meson.build                        |  27 ++-
 drivers/ml/cnxk/meson.build                |   2 +-
 drivers/net/cnxk/meson.build               |   4 +-
 drivers/net/intel/iavf/meson.build         |   2 +-
 drivers/net/intel/ice/meson.build          |   2 +-
 drivers/net/mana/meson.build               |   2 +-
 drivers/net/meson.build                    |   2 +-
 drivers/net/mlx5/meson.build               |   2 +-
 drivers/net/sfc/meson.build                |   2 +-
 drivers/net/softnic/meson.build            |   2 +-
 drivers/net/virtio/meson.build             |   2 +-
 drivers/raw/cnxk_bphy/meson.build          |   2 +-
 drivers/raw/cnxk_gpio/meson.build          |   2 +-
 drivers/raw/gdtc/meson.build               |   2 +-
 drivers/raw/ntb/meson.build                |   2 +-
 drivers/raw/skeleton/meson.build           |   2 +-
 drivers/regex/cn9k/meson.build             |   2 +-
 drivers/regex/meson.build                  |   2 +-
 drivers/regex/mlx5/meson.build             |   2 +-
 drivers/vdpa/ifc/meson.build               |   2 +-
 drivers/vdpa/meson.build                   |   3 +-
 drivers/vdpa/mlx5/meson.build              |   2 +-
 drivers/vdpa/sfc/meson.build               |   2 +-
 examples/ethtool/meson.build               |   4 +-
 examples/l2fwd-crypto/meson.build          |   4 +-
 examples/l3fwd/meson.build                 |   4 +-
 examples/meson.build                       |  31 ++-
 examples/vm_power_manager/meson.build      |  16 +-
 lib/argparse/meson.build                   |   2 +-
 lib/bbdev/meson.build                      |   2 +-
 lib/bitratestats/meson.build               |   2 +-
 lib/bpf/meson.build                        |   2 +-
 lib/cmdline/meson.build                    |   2 +-
 lib/compressdev/meson.build                |   2 +-
 lib/cryptodev/meson.build                  |   2 +-
 lib/dispatcher/meson.build                 |   2 +-
 lib/distributor/meson.build                |   2 +-
 lib/dmadev/meson.build                     |   2 -
 lib/eal/meson.build                        |   5 +-
 lib/efd/meson.build                        |   2 +-
 lib/ethdev/meson.build                     |   2 +-
 lib/eventdev/meson.build                   |   3 +-
 lib/fib/meson.build                        |   4 +-
 lib/gpudev/meson.build                     |   2 +-
 lib/graph/meson.build                      |   2 +-
 lib/gro/meson.build                        |   2 +-
 lib/gso/meson.build                        |   2 +-
 lib/hash/meson.build                       |   4 +-
 lib/ip_frag/meson.build                    |   2 +-
 lib/ipsec/meson.build                      |   2 +-
 lib/kvargs/meson.build                     |   2 +-
 lib/latencystats/meson.build               |   2 +-
 lib/lpm/meson.build                        |   4 +-
 lib/mbuf/meson.build                       |   2 +-
 lib/member/meson.build                     |   2 +-
 lib/mempool/meson.build                    |   2 +-
 lib/meson.build                            |  27 ++-
 lib/metrics/meson.build                    |   2 +-
 lib/mldev/meson.build                      |   2 +-
 lib/net/meson.build                        |   2 +-
 lib/node/meson.build                       |   2 +-
 lib/pcapng/meson.build                     |   2 +-
 lib/pdcp/meson.build                       |   2 +-
 lib/pdump/meson.build                      |   2 +-
 lib/pipeline/meson.build                   |   2 +-
 lib/port/meson.build                       |   2 +-
 lib/power/meson.build                      |   3 +-
 lib/rawdev/meson.build                     |   2 -
 lib/rcu/meson.build                        |   2 +-
 lib/regexdev/meson.build                   |   2 +-
 lib/reorder/meson.build                    |   2 +-
 lib/rib/meson.build                        |   2 +-
 lib/ring/meson.build                       |   1 -
 lib/sched/meson.build                      |   2 +-
 lib/security/meson.build                   |   2 +-
 lib/table/meson.build                      |   2 +-
 lib/telemetry/meson.build                  |   2 +-
 lib/vhost/meson.build                      |   2 +-
 134 files changed, 645 insertions(+), 231 deletions(-)
 create mode 100644 buildtools/log-deps.py
 create mode 100755 devtools/draw-dependency-graphs.py
 create mode 100755 devtools/find-duplicate-deps.py
Signature · 1 line
2.43.5
#55 lore raw

PATCH v6 1/8 build: introduce optional internal dependencies

Allow specifying internal dependencies as either mandatory or optional. Specifying a dependency as optional will mean that the component being built will be skipped if said dependency is not being built. At build time, the build system will resolve any optional dependencies and add them to the list of dependencies to be built. Any source files requiring said optional depepdencies will still have to be added explicitly to the build by the respective component (e.g. adding BPF-related files when BPF support is being built).

---

Notes:
v4 -> v5:
- Automatically handle optional dependencies based on Bruce's earlier patch [1]

[1] https://patches.dpdk.org/project/dpdk/patch/[email protected]/

 app/meson.build                       | 14 ++++++-
 app/proc-info/meson.build             |  4 +-
 app/test-bbdev/meson.build            | 18 +++------
 app/test-crypto-perf/meson.build      |  4 +-
 app/test-pmd/meson.build              | 56 +++++++++------------------
 app/test/meson.build                  | 12 +++---
 drivers/meson.build                   | 13 ++++++-
 examples/ethtool/meson.build          |  4 +-
 examples/l2fwd-crypto/meson.build     |  4 +-
 examples/l3fwd/meson.build            |  4 +-
 examples/meson.build                  | 13 ++++++-
 examples/vm_power_manager/meson.build | 16 +++-----
 lib/meson.build                       | 13 ++++++-
 13 files changed, 89 insertions(+), 86 deletions(-)
app/meson.build +12 -2
index e2db888ae1..61202495bd 100644
@@ -66,6 +66,7 @@ foreach app:apps
     # external package/library requirements
     ext_deps = []
     deps = []
+    optional_deps = []
 
     if not enable_apps.contains(app)
         build = false
@@ -83,10 +84,19 @@ foreach app:apps
         endif
     endif
 
+    # resolve any optional internal dependencies
+    def_lib = get_option('default_library')
+    foreach d: optional_deps
+        # if optional dependency is defined, add it to the deps list
+        if is_variable(def_lib + '_rte_' + d)
+            deps += [d]
+        endif
+    endforeach
+
     if build
         dep_objs = []
         foreach d:deps
-            var_name = get_option('default_library') + '_rte_' + d
+            var_name = def_lib + '_rte_' + d
             if not is_variable(var_name)
                 build = false
                 reason = 'missing internal dependency, "@0@"'.format(d)
@@ -111,7 +121,7 @@ foreach app:apps
 
     dpdk_apps_enabled += app
     link_libs = []
-    if get_option('default_library') == 'static'
+    if def_lib == 'static'
         link_libs = dpdk_static_libraries + dpdk_drivers
     endif
 
app/proc-info/meson.build +1 -3
index 316253cd5d..51315f72a1 100644
@@ -9,8 +9,6 @@ endif
 
 sources = files('main.c')
 deps += ['ethdev', 'security', 'eventdev']
-if dpdk_conf.has('RTE_LIB_METRICS')
-    deps += 'metrics'
-endif
+optional_deps += 'metrics'
 
 cflags += no_wvla_cflag
app/test-bbdev/meson.build +6 -12
index 85b060edec..d41bd60396 100644
@@ -14,17 +14,11 @@ sources = files(
         'test_bbdev_vector.c',
 )
 deps += ['bbdev', 'bus_vdev']
-if dpdk_conf.has('RTE_BASEBAND_FPGA_LTE_FEC')
-    deps += ['baseband_fpga_lte_fec']
-endif
-if dpdk_conf.has('RTE_BASEBAND_FPGA_5GNR_FEC')
-    deps += ['baseband_fpga_5gnr_fec']
-endif
-if dpdk_conf.has('RTE_BASEBAND_ACC')
-    deps += ['baseband_acc']
-endif
-if dpdk_conf.has('RTE_BASEBAND_LA12XX')
-    deps += ['baseband_la12xx']
-endif
+optional_deps += [
+        'baseband_fpga_lte_fec',
+        'baseband_fpga_5gnr_fec',
+        'baseband_acc',
+        'baseband_la12xx',
+]
 
 cflags += no_wvla_cflag
app/test-crypto-perf/meson.build +1 -3
index 87dd3bc5f1..fb48d9ec29 100644
@@ -20,8 +20,6 @@ sources = files(
         'main.c',
 )
 deps += ['cryptodev', 'net', 'security']
-if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
-endif
+optional_deps += 'crypto_scheduler'
 
 cflags += no_wvla_cflag
app/test-pmd/meson.build +19 -37

66 lines not on this page · raw message

app/test/meson.build +6 -6
index b6285a6b45..eb0447e8c6 100644
@@ -7,7 +7,7 @@ sources += files('commands.c', 'test.c')
 
 # optional dependencies: some files may use these - and so we should link them in -
 # but do not explicitly require them so they are not listed in the per-file lists below
-optional_deps = ['crypto_scheduler', 'lpm']
+opt_deps = ['crypto_scheduler', 'lpm']
 
 # some other utility C files, providing functions used by various tests
 # so we need to include these deps in the dependency list for the files using those fns.
@@ -222,8 +222,8 @@ foreach f, f_deps : source_file_deps
             break
         else
             # technically we might not need this dep, but adding it is harmless
-            if d not in deps
-                deps += d
+            if d not in optional_deps and d not in deps
+                optional_deps += d
             endif
         endif
     endforeach
@@ -244,9 +244,9 @@ foreach f, f_deps : source_file_deps
     endif
 endforeach
 # add the optional dependencies
-foreach d:optional_deps
-    if is_variable(def_lib + '_rte_' + d) and d not in deps
-        deps += d
+foreach d:opt_deps
+    if d not in optional_deps and d not in deps
+        optional_deps += d
     endif
 endforeach
 
drivers/meson.build +12 -1
index 05391a575d..fb48e11eaf 100644
@@ -133,6 +133,7 @@ foreach subpath:subdirs
         includes = [include_directories(drv_path)]
         # set up internal deps. Drivers can append/override as necessary
         deps = std_deps
+        optional_deps = []
         # ext_deps: Stores external library dependency got
         # using dependency() (preferred) or find_library().
         # For the find_library() case (but not with dependency()) we also
@@ -178,11 +179,21 @@ foreach subpath:subdirs
             # get dependency objs from strings
             shared_deps = ext_deps
             static_deps = ext_deps
+
+            # resolve any optional internal dependencies
+            def_lib = get_option('default_library')
+            foreach d: optional_deps
+                # if optional dependency is defined, add it to the deps list
+                if is_variable(def_lib + '_rte_' + d)
+                    deps += [d]
+                endif
+            endforeach
+
             foreach d:deps
                 if not build
                     break
                 endif
-                if not is_variable('shared_rte_' + d)
+                if not is_variable(def_lib + '_rte_' + d)
                     build = false
                     reason = 'missing internal dependency, "@0@"'.format(d)
                     if dpdk_libs_deprecated.contains(d)
examples/ethtool/meson.build +1 -3
index d7f63d48af..bb2a7fbb89 100644
@@ -19,8 +19,6 @@ sources = files(
 includes = include_directories('lib', 'ethtool-app')
 
 deps += 'bus_pci'
-if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += 'net_ixgbe'
-endif
+optional_deps += 'net_ixgbe'
 
 allow_experimental_apis = true
examples/l2fwd-crypto/meson.build +1 -3
index c21722b85c..2a1070707e 100644
@@ -7,9 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'cryptodev'
-if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
-endif
+optional_deps += 'crypto_scheduler'
 allow_experimental_apis = true
 sources = files(
         'main.c',
examples/l3fwd/meson.build +1 -3
index 74144c7979..9a9f2c6d40 100644
@@ -18,7 +18,5 @@ sources = files(
         'l3fwd_lpm.c',
         'main.c',
 )
-if dpdk_conf.has('RTE_LIB_EVENTDEV')
-    deps += 'eventdev'
-endif
+optional_deps += 'eventdev'
 cflags += no_wvla_cflag
examples/meson.build +12 -1
index 8e8968a1fa..14b8aadf68 100644
@@ -98,12 +98,23 @@ foreach example: examples
     ext_deps = []
     includes = [include_directories(example, 'common')]
     deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
+    optional_deps = []
     subdir(example)
 
     if build
         dep_objs = ext_deps
+
+        # resolve any optional internal dependencies
+        def_lib = get_option('default_library')
+        foreach d: optional_deps
+            # if optional dependency is defined, add it to the deps list
+            if is_variable(def_lib + '_rte_' + d)
+                deps += [d]
+            endif
+        endforeach
+
         foreach d:deps
-            var_name = get_option('default_library') + '_rte_' + d
+            var_name = def_lib + '_rte_' + d
             if not is_variable(var_name)
                 build = false
                 message('Missing dependency "@0@" for example "@1@"'.format(d, name))
examples/vm_power_manager/meson.build +5 -11
index dcf23198eb..6fc081b06b 100644
@@ -8,17 +8,11 @@
 
 deps += ['power', 'power_kvm_vm']
 
-if dpdk_conf.has('RTE_NET_BNXT')
-    deps += ['net_bnxt']
-endif
-
-if dpdk_conf.has('RTE_NET_I40E')
-    deps += ['net_i40e']
-endif
-
-if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += ['net_ixgbe']
-endif
+optional_deps += [
+        'net_bnxt',
+        'net_i40e',
+        'net_ixgbe',
+]
 
 allow_experimental_apis = true
 sources = files(
lib/meson.build +12 -1
index ce92cb5537..76bf849852 100644
@@ -134,6 +134,7 @@ foreach l:libraries
     # external package/library requirements
     ext_deps = []
     deps = []
+    optional_deps = []
     # eal is standard dependency once built
     if dpdk_conf.has('RTE_LIB_EAL')
         deps += ['eal']
@@ -171,11 +172,21 @@ foreach l:libraries
 
     shared_deps = ext_deps
     static_deps = ext_deps
+
+    # resolve any optional internal dependencies
+    def_lib = get_option('default_library')
+    foreach d: optional_deps
+        # if optional dependency is defined, add it to the deps list
+        if is_variable(def_lib + '_rte_' + d)
+            deps += [d]
+        endif
+    endforeach
+
     foreach d:deps
         if not build
             break
         endif
-        if not is_variable('shared_rte_' + d)
+        if not is_variable(def_lib + '_rte_' + d)
             build = false
             reason = 'missing internal dependency, "@0@"'.format(d)
             if dpdk_libs_deprecated.contains(d)
Signature · 1 line
2.43.5
#56 lore raw

Re: [PATCH v6 1/8] build: introduce optional internal dependencies

Quoted 2 lines · Anatoly Burakov

Allow specifying internal dependencies as either mandatory or optional. Specifying a dependency as optional will mean that the component being

s/optional/mandatory/

Quoted 410 lines

built will be skipped if said dependency is not being built. At build time, the build system will resolve any optional dependencies and add them to the list of dependencies to be built. Any source files requiring said optional depepdencies will still have to be added explicitly to the build by the respective component (e.g. adding BPF-related files when BPF support is being built).

---

Notes:
v4 -> v5:
- Automatically handle optional dependencies based on Bruce's earlier patch [1]

[1] https://patches.dpdk.org/project/dpdk/patch/[email protected]/

 app/meson.build                       | 14 ++++++-
 app/proc-info/meson.build             |  4 +-
 app/test-bbdev/meson.build            | 18 +++------
 app/test-crypto-perf/meson.build      |  4 +-
 app/test-pmd/meson.build              | 56 +++++++++------------------
 app/test/meson.build                  | 12 +++---
 drivers/meson.build                   | 13 ++++++-
 examples/ethtool/meson.build          |  4 +-
 examples/l2fwd-crypto/meson.build     |  4 +-
 examples/l3fwd/meson.build            |  4 +-
 examples/meson.build                  | 13 ++++++-
 examples/vm_power_manager/meson.build | 16 +++-----
 lib/meson.build                       | 13 ++++++-
 13 files changed, 89 insertions(+), 86 deletions(-)
app/meson.build +12 -2
index e2db888ae1..61202495bd 100644
@@ -66,6 +66,7 @@ foreach app:apps
     # external package/library requirements
     ext_deps = []
     deps = []
+    optional_deps = []
 
     if not enable_apps.contains(app)
         build = false
@@ -83,10 +84,19 @@ foreach app:apps
         endif
     endif
 
+    # resolve any optional internal dependencies
+    def_lib = get_option('default_library')
+    foreach d: optional_deps
+        # if optional dependency is defined, add it to the deps list
+        if is_variable(def_lib + '_rte_' + d)
+            deps += [d]
+        endif
+    endforeach
+
     if build
         dep_objs = []
         foreach d:deps
-            var_name = get_option('default_library') + '_rte_' + d
+            var_name = def_lib + '_rte_' + d
             if not is_variable(var_name)
                 build = false
                 reason = 'missing internal dependency, "@0@"'.format(d)
@@ -111,7 +121,7 @@ foreach app:apps
 
     dpdk_apps_enabled += app
     link_libs = []
-    if get_option('default_library') == 'static'
+    if def_lib == 'static'
         link_libs = dpdk_static_libraries + dpdk_drivers
     endif
 
app/proc-info/meson.build +1 -3
index 316253cd5d..51315f72a1 100644
@@ -9,8 +9,6 @@ endif
 
 sources = files('main.c')
 deps += ['ethdev', 'security', 'eventdev']
-if dpdk_conf.has('RTE_LIB_METRICS')
-    deps += 'metrics'
-endif
+optional_deps += 'metrics'
 
 cflags += no_wvla_cflag
app/test-bbdev/meson.build +6 -12
index 85b060edec..d41bd60396 100644
@@ -14,17 +14,11 @@ sources = files(
         'test_bbdev_vector.c',
 )
 deps += ['bbdev', 'bus_vdev']
-if dpdk_conf.has('RTE_BASEBAND_FPGA_LTE_FEC')
-    deps += ['baseband_fpga_lte_fec']
-endif
-if dpdk_conf.has('RTE_BASEBAND_FPGA_5GNR_FEC')
-    deps += ['baseband_fpga_5gnr_fec']
-endif
-if dpdk_conf.has('RTE_BASEBAND_ACC')
-    deps += ['baseband_acc']
-endif
-if dpdk_conf.has('RTE_BASEBAND_LA12XX')
-    deps += ['baseband_la12xx']
-endif
+optional_deps += [
+        'baseband_fpga_lte_fec',
+        'baseband_fpga_5gnr_fec',
+        'baseband_acc',
+        'baseband_la12xx',
+]
 
 cflags += no_wvla_cflag
app/test-crypto-perf/meson.build +1 -3
index 87dd3bc5f1..fb48d9ec29 100644
@@ -20,8 +20,6 @@ sources = files(
         'main.c',
 )
 deps += ['cryptodev', 'net', 'security']
-if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
-endif
+optional_deps += 'crypto_scheduler'
 
 cflags += no_wvla_cflag
app/test-pmd/meson.build +19 -37
index f1c36529b4..bbc8d429f8 100644
@@ -34,47 +34,29 @@ sources = files(
 if dpdk_conf.has('RTE_HAS_JANSSON')
     ext_deps += jansson_dep
 endif
-
-deps += ['ethdev', 'cmdline']
-if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
-endif
-if dpdk_conf.has('RTE_LIB_BITRATESTATS')
-    deps += 'bitratestats'
-endif
 if dpdk_conf.has('RTE_LIB_BPF')
     sources += files('bpf_cmd.c')
-    deps += 'bpf'
-endif
-if dpdk_conf.has('RTE_LIB_GRO')
-    deps += 'gro'
-endif
-if dpdk_conf.has('RTE_LIB_GSO')
-    deps += 'gso'
-endif
-if dpdk_conf.has('RTE_LIB_LATENCYSTATS')
-    deps += 'latencystats'
-endif
-if dpdk_conf.has('RTE_LIB_METRICS')
-    deps += 'metrics'
-endif
-if dpdk_conf.has('RTE_LIB_PDUMP')
-    deps += 'pdump'
-endif
-if dpdk_conf.has('RTE_NET_BNXT')
-    deps += 'net_bnxt'
-endif
-if dpdk_conf.has('RTE_NET_I40E')
-    deps += 'net_i40e'
-endif
-if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += 'net_ixgbe'
-endif
-if dpdk_conf.has('RTE_NET_DPAA')
-    deps += ['bus_dpaa', 'mempool_dpaa', 'net_dpaa']
 endif
 
+deps += ['ethdev', 'cmdline']
+optional_deps += [
+        'crypto_scheduler',
+        'bitratestats',
+        'bpf',
+        'gro',
+        'gso',
+        'latencystats',
+        'metrics',
+        'pdump',
+        'net_bnxt',
+        'net_i40e',
+        'net_ixgbe',
+        'bus_dpaa',
+        'mempool_dpaa',
+        'net_dpaa',
+]
+
 # Driver-specific commands are located in driver directories.
 includes = include_directories('.')
 sources += testpmd_drivers_sources
-deps += testpmd_drivers_deps
+optional_deps += testpmd_drivers_deps
app/test/meson.build +6 -6
index b6285a6b45..eb0447e8c6 100644
@@ -7,7 +7,7 @@ sources += files('commands.c', 'test.c')
 
 # optional dependencies: some files may use these - and so we should link them in -
 # but do not explicitly require them so they are not listed in the per-file lists below
-optional_deps = ['crypto_scheduler', 'lpm']
+opt_deps = ['crypto_scheduler', 'lpm']
 
 # some other utility C files, providing functions used by various tests
 # so we need to include these deps in the dependency list for the files using those fns.
@@ -222,8 +222,8 @@ foreach f, f_deps : source_file_deps
             break
         else
             # technically we might not need this dep, but adding it is harmless
-            if d not in deps
-                deps += d
+            if d not in optional_deps and d not in deps
+                optional_deps += d
             endif
         endif
     endforeach
@@ -244,9 +244,9 @@ foreach f, f_deps : source_file_deps
     endif
 endforeach
 # add the optional dependencies
-foreach d:optional_deps
-    if is_variable(def_lib + '_rte_' + d) and d not in deps
-        deps += d
+foreach d:opt_deps
+    if d not in optional_deps and d not in deps
+        optional_deps += d
     endif
 endforeach
 
drivers/meson.build +12 -1
index 05391a575d..fb48e11eaf 100644
@@ -133,6 +133,7 @@ foreach subpath:subdirs
         includes = [include_directories(drv_path)]
         # set up internal deps. Drivers can append/override as necessary
         deps = std_deps
+        optional_deps = []
         # ext_deps: Stores external library dependency got
         # using dependency() (preferred) or find_library().
         # For the find_library() case (but not with dependency()) we also
@@ -178,11 +179,21 @@ foreach subpath:subdirs
             # get dependency objs from strings
             shared_deps = ext_deps
             static_deps = ext_deps
+
+            # resolve any optional internal dependencies
+            def_lib = get_option('default_library')
+            foreach d: optional_deps
+                # if optional dependency is defined, add it to the deps list
+                if is_variable(def_lib + '_rte_' + d)
+                    deps += [d]
+                endif
+            endforeach
+
             foreach d:deps
                 if not build
                     break
                 endif
-                if not is_variable('shared_rte_' + d)
+                if not is_variable(def_lib + '_rte_' + d)
                     build = false
                     reason = 'missing internal dependency, "@0@"'.format(d)
                     if dpdk_libs_deprecated.contains(d)
examples/ethtool/meson.build +1 -3
index d7f63d48af..bb2a7fbb89 100644
@@ -19,8 +19,6 @@ sources = files(
 includes = include_directories('lib', 'ethtool-app')
 
 deps += 'bus_pci'
-if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += 'net_ixgbe'
-endif
+optional_deps += 'net_ixgbe'
 
 allow_experimental_apis = true
examples/l2fwd-crypto/meson.build +1 -3
index c21722b85c..2a1070707e 100644
@@ -7,9 +7,7 @@
 # DPDK instance, use 'make'
 
 deps += 'cryptodev'
-if dpdk_conf.has('RTE_CRYPTO_SCHEDULER')
-    deps += 'crypto_scheduler'
-endif
+optional_deps += 'crypto_scheduler'
 allow_experimental_apis = true
 sources = files(
         'main.c',
examples/l3fwd/meson.build +1 -3
index 74144c7979..9a9f2c6d40 100644
@@ -18,7 +18,5 @@ sources = files(
         'l3fwd_lpm.c',
         'main.c',
 )
-if dpdk_conf.has('RTE_LIB_EVENTDEV')
-    deps += 'eventdev'
-endif
+optional_deps += 'eventdev'
 cflags += no_wvla_cflag
examples/meson.build +12 -1
index 8e8968a1fa..14b8aadf68 100644
@@ -98,12 +98,23 @@ foreach example: examples
     ext_deps = []
     includes = [include_directories(example, 'common')]
     deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
+    optional_deps = []
     subdir(example)
 
     if build
         dep_objs = ext_deps
+
+        # resolve any optional internal dependencies
+        def_lib = get_option('default_library')
+        foreach d: optional_deps
+            # if optional dependency is defined, add it to the deps list
+            if is_variable(def_lib + '_rte_' + d)
+                deps += [d]
+            endif
+        endforeach
+
         foreach d:deps
-            var_name = get_option('default_library') + '_rte_' + d
+            var_name = def_lib + '_rte_' + d
             if not is_variable(var_name)
                 build = false
                 message('Missing dependency "@0@" for example "@1@"'.format(d, name))
examples/vm_power_manager/meson.build +5 -11
index dcf23198eb..6fc081b06b 100644
@@ -8,17 +8,11 @@
 
 deps += ['power', 'power_kvm_vm']
 
-if dpdk_conf.has('RTE_NET_BNXT')
-    deps += ['net_bnxt']
-endif
-
-if dpdk_conf.has('RTE_NET_I40E')
-    deps += ['net_i40e']
-endif
-
-if dpdk_conf.has('RTE_NET_IXGBE')
-    deps += ['net_ixgbe']
-endif
+optional_deps += [
+        'net_bnxt',
+        'net_i40e',
+        'net_ixgbe',
+]
 
 allow_experimental_apis = true
 sources = files(
lib/meson.build +12 -1
index ce92cb5537..76bf849852 100644
@@ -134,6 +134,7 @@ foreach l:libraries
     # external package/library requirements
     ext_deps = []
     deps = []
+    optional_deps = []
     # eal is standard dependency once built
     if dpdk_conf.has('RTE_LIB_EAL')
         deps += ['eal']
@@ -171,11 +172,21 @@ foreach l:libraries
 
     shared_deps = ext_deps
     static_deps = ext_deps
+
+    # resolve any optional internal dependencies
+    def_lib = get_option('default_library')
+    foreach d: optional_deps
+        # if optional dependency is defined, add it to the deps list
+        if is_variable(def_lib + '_rte_' + d)
+            deps += [d]
+        endif
+    endforeach
+
     foreach d:deps
         if not build
             break
         endif
-        if not is_variable('shared_rte_' + d)
+        if not is_variable(def_lib + '_rte_' + d)
             build = false
             reason = 'missing internal dependency, "@0@"'.format(d)
             if dpdk_libs_deprecated.contains(d)
Signature · 1 line
2.43.5
#57 lore raw

PATCH v6 2/8 build: output a dependency log in build directory

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

As meson processes our DPDK source tree it manages dependencies specified by each individual driver. To enable future analysis of the dependency links between components, log the dependencies of each DPDK component as it gets processed. This could potentially allow other tools to automatically enable or disable components based on the desired end components to be built, e.g. if the user requests net/ice, ensure that common/iavf is also enabled in the drivers.

The output file produced is in "dot" or "graphviz" format, which allows producing a graphical representation of the DPDK dependency tree if so desired. For example: "dot -Tpng -O build/deps.dot" to produce the image file "build/deps.dot.png".

---

Notes:
v4 -> v5:
- Change output format to include display name

 app/meson.build        | 17 +++++++-
 buildtools/log-deps.py | 94 ++++++++++++++++++++++++++++++++++++++++++
 buildtools/meson.build |  2 +
 drivers/meson.build    | 14 +++++++
 examples/meson.build   | 18 +++++++-
 lib/meson.build        | 14 +++++++
 6 files changed, 157 insertions(+), 2 deletions(-)
 create mode 100644 buildtools/log-deps.py
app/meson.build +16 -1
index 61202495bd..a971738d40 100644
@@ -77,7 +77,22 @@ foreach app:apps
     endif
 
     if build
+        # call into subdir may update name so record it here
+        display_name = name
+
         subdir(name)
+        app_name = 'dpdk-' + name
+
+        # log mandatory dependencies
+        cmds = ['--type', 'app']
+        cmds += ['--display-name', display_name]
+        run_command([log_deps_cmd, cmds, app_name, deps], check: false)
+
+        # log optional dependencies, if any
+        if optional_deps.length() > 0
+            cmds += ['--optional']
+            run_command([log_deps_cmd, cmds, app_name, optional_deps], check: false)
+        endif
         if not build and require_apps
             error('Cannot build explicitly requested app "@0@".\n'.format(name)
                   + '\tReason: ' + reason)
@@ -125,7 +140,7 @@ foreach app:apps
         link_libs = dpdk_static_libraries + dpdk_drivers
     endif
 
-    exec = executable('dpdk-' + name,
+    exec = executable(app_name,
             [ sources, resources ],
             c_args: cflags,
             link_args: ldflags,
buildtools/log-deps.py new file +94 -0

94 lines not on this page · raw message

buildtools/meson.build +2 -0
index 4e2c1217a2..13a0477245 100644
@@ -26,6 +26,8 @@ header_gen_cmd = py3 + files('gen-header.py')
 has_hugepages_cmd = py3 + files('has-hugepages.py')
 cmdline_gen_cmd = py3 + files('dpdk-cmdline-gen.py')
 check_dts_requirements = py3 + files('check-dts-requirements.py')
+log_deps_cmd = py3 + files('log-deps.py')
+run_command(log_deps_cmd, check: false)  # call with no parameters to reset the file
 
 # install any build tools that end-users might want also
 install_data([
drivers/meson.build +14 -0
index fb48e11eaf..e9698373e2 100644
@@ -162,6 +162,8 @@ foreach subpath:subdirs
         endif
 
         if build
+            # call into subdir may update name so record it here
+            display_name = '@0@/@1@'.format(class, name)
             # pull in driver directory which should update all the local variables
             subdir(drv_path)
 
@@ -176,6 +178,18 @@ foreach subpath:subdirs
                         +'\tReason: ' + reason)
             endif
 
+            # log mandatory dependencies
+            cmds = ['--type', 'drivers']
+            cmds += ['--display-name', display_name]
+            drv_name = class + '_' + name
+            run_command([log_deps_cmd, cmds, drv_name, deps], check: false)
+
+            # log optional dependencies, if any
+            if optional_deps.length() > 0
+                cmds += ['--optional']
+                run_command([log_deps_cmd, cmds, drv_name, optional_deps], check: false)
+            endif
+
             # get dependency objs from strings
             shared_deps = ext_deps
             static_deps = ext_deps
examples/meson.build +17 -1
index 14b8aadf68..d1856dbafc 100644
@@ -99,11 +99,27 @@ foreach example: examples
     includes = [include_directories(example, 'common')]
     deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']
     optional_deps = []
+
+    # call into subdir may update name so record it here
+    display_name = example
+
     subdir(example)
+    example_name = 'dpdk-' + name
 
     if build
         dep_objs = ext_deps
 
+        # log mandatory dependencies
+        cmds = ['--type', 'examples']
+        cmds += ['--display-name', display_name]
+        run_command([log_deps_cmd, cmds, example_name, deps], check: false)
+
+        # log optional dependencies, if any
+        if optional_deps.length() > 0
+            cmds += ['--optional']
+            run_command([log_deps_cmd, cmds, example_name, optional_deps], check: false)
+        endif
+
         # resolve any optional internal dependencies
         def_lib = get_option('default_library')
         foreach d: optional_deps
@@ -135,7 +151,7 @@ foreach example: examples
     if allow_experimental_apis
         cflags += '-DALLOW_EXPERIMENTAL_API'
     endif
-    executable('dpdk-' + name, sources,
+    executable(example_name, sources,
             include_directories: includes,
             link_whole: link_whole_libs,
             link_args: ldflags,
lib/meson.build +14 -0
index 76bf849852..db0d121b3c 100644
@@ -160,7 +160,21 @@ foreach l:libraries
     endif
 
     if build
+        # as per warning below, directory name should match library name but it is not considered an error
+        display_name = name
+
         subdir(l)
+
+        # log mandatory dependencies
+        cmds = ['--type', 'lib']
+        cmds += ['--display-name', display_name]
+        run_command([log_deps_cmd, cmds, name, deps], check: false)
+
+        # log optional dependencies, if any
+        if optional_deps.length() > 0
+            cmds += ['--optional']
+            run_command([log_deps_cmd, cmds, name, optional_deps], check: false)
+        endif
         if not build and require_libs
             error('Cannot build explicitly requested lib "@0@".\n'.format(name)
                     +'\tReason: ' + reason)
Signature · 1 line
2.43.5
#58 lore raw

PATCH v6 3/8 devtools: add script to flag unneeded dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

While not a serious problem, DPDK components often list more dependencies than are actually necessary to build, due to the use of recursive dependencies. In extreme cases, such as with core libraries, this can lead to longer configuration times due to meson having to deduplicate long lists of dependencies. Therefore we can add a script to identify when a component has got unnecessary dependencies listed.

---
 devtools/find-duplicate-deps.py | 62 +++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100755 devtools/find-duplicate-deps.py
devtools/find-duplicate-deps.py new file +62 -0
new file mode 100755
index 0000000000..cbd0ca7196
@@ -0,0 +1,62 @@
+#! /usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2024 Intel Corporation
+
+"""Identify any superfluous dependencies listed in DPDK deps graph."""
+
+import sys
+
+all_deps = {}
+
+
+class dep:
+    """Holds a component and its dependencies."""
+
+    def __init__(self, name, dep_names):
+        """Create and process a component and its deps."""
+        self.name = name.strip('" ')
+        self.base_deps = [all_deps[dn.strip('" ')] for dn in dep_names]
+        self.recursive_deps = []
+        for d in self.base_deps:
+            self.recursive_deps.extend(d.base_deps)
+            self.recursive_deps.extend(d.recursive_deps)
+        self.extra_deps = []
+        for d in self.base_deps:
+            if d in self.recursive_deps:
+                self.extra_deps.append(d.name)
+        if self.extra_deps:
+            print(f'{self.name}: extra deps {self.extra_deps}')
+
+    def dict_add(self, d):
+        """Add this object to a dictionary by name."""
+        d[self.name] = self
+
+
+def remove_attrs(ln):
+    """Remove attributes from a line."""
+    while ln.find("[") != -1:
+        start = ln.find("[")
+        end = ln.find("]")
+        ln = ln[:start] + ln[end + 1 :]
+    return ln.strip()
+
+
+def main(argv):
+    """Read the dependency tree from a dot file and process it."""
+    if len(argv) != 2:
+        print(f'Usage: {argv[0]} <build-directory>/deps.dot', file=sys.stderr)
+        sys.exit(1)
+
+    with open(argv[1]) as f:
+        for ln in f.readlines():
+            ln = remove_attrs(ln.strip())
+            if '->' in ln:
+                name, deps = ln.split('->')
+                deps = deps.strip(' {}')
+                dep(name, deps.split(',')).dict_add(all_deps)
+            elif ln.startswith('"') and ln.endswith('"'):
+                dep(ln.strip('"'), []).dict_add(all_deps)
+
+
+if __name__ == '__main__':
+    main(sys.argv)
Signature · 1 line
2.43.5
#59 lore raw

PATCH v6 4/8 drivers: remove kvargs from class dependencies

In reply to Anatoly Burakov

From: Bruce Richardson <[email protected]>

The kvargs library is used by EAL, and therefore is implicitly a dependency of every DPDK driver. Remove it from the minimum set of dependencies for each driver class as it's unnecessary to call it out there.

---
 drivers/event/meson.build | 2 +-
 drivers/net/meson.build   | 2 +-
 drivers/regex/meson.build | 2 +-
 drivers/vdpa/meson.build  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/event/meson.build +1 -1
index d6706b57f7..2708833adf 100644
@@ -19,4 +19,4 @@ if not (toolchain == 'gcc' and cc.version().version_compare('<4.8.6') and
         dpdk_conf.has('RTE_ARCH_ARM64'))
     drivers += 'octeontx'
 endif
-std_deps = ['eventdev', 'kvargs']
+std_deps = ['eventdev']
drivers/net/meson.build +1 -1
index 460eb69e5b..246f99ec17 100644
@@ -65,6 +65,6 @@ drivers = [
         'xsc',
         'zxdh',
 ]
-std_deps = ['ethdev', 'kvargs'] # 'ethdev' also pulls in mbuf, net, eal etc
+std_deps = ['ethdev']           # 'ethdev' also pulls in mbuf, net, eal etc
 std_deps += ['bus_pci']         # very many PMDs depend on PCI, so make std
 std_deps += ['bus_vdev']        # same with vdev bus
drivers/regex/meson.build +1 -1
index ff2a8fea89..10192e7c77 100644
@@ -5,4 +5,4 @@ drivers = [
         'mlx5',
         'cn9k',
 ]
-std_deps = ['ethdev', 'kvargs', 'regexdev'] # 'ethdev' also pulls in mbuf, net, eal etc
+std_deps = ['ethdev', 'regexdev'] # 'ethdev' also pulls in mbuf, net, eal etc
drivers/vdpa/meson.build +1 -1
index 896e8e0304..e01c277b9e 100644
@@ -11,5 +11,5 @@ drivers = [
         'nfp',
         'sfc',
 ]
-std_deps = ['bus_pci', 'kvargs']
+std_deps = ['bus_pci']
 std_deps += ['vhost']
Signature · 1 line
2.43.5