Skip to contentSkip to conversation

lib: remove niche libraries from always enabled list

PATCH In review Robin Jarry 3 participants 7 messages Oct 14 – Oct 15

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

cover lib: remove niche libraries from always enabled list

Some libraries are only used either for internal apps/examples (cmdline) or by a specific mempool driver (stack).

Everywhere they are used, an explicit dependency is already recorded in meson. There is no reason to always enable them.

Robin Jarry (2):
lib: remove cmdline from always enabled libraries
lib: remove stack from always enabled libraries

 lib/meson.build | 2 --
 1 file changed, 2 deletions(-)
Signature · 1 line
2.56.0
#1 lore raw

PATCH 1/2 lib: remove cmdline from always enabled libraries

This library is not used by any driver nor other library:

	$ git grep -l '#include <cmdline.*\.h>' -- \
		':!:app/' ':!:examples/' ':!:*testpmd*'
	buildtools/dpdk-cmdline-gen.py
	lib/cmdline/cmdline.h
	lib/cmdline/cmdline_parse_bool.h
	lib/cmdline/cmdline_parse_etheraddr.h
	lib/cmdline/cmdline_parse_ipaddr.h
	lib/cmdline/cmdline_parse_num.h
	lib/cmdline/cmdline_parse_portlist.h
	lib/cmdline/cmdline_parse_string.h
	lib/cmdline/cmdline_rdline.h
	lib/cmdline/cmdline_socket.h

The only apps and examples where it is actually used already have an explicit dependency. There is no point in always enabling it.

---
 lib/meson.build | 1 -
 1 file changed, 1 deletion(-)
lib/meson.build +0 -1
index af5c160cb800..72ac21b5fa86 100644
@@ -72,7 +72,6 @@ libraries = [
 
 always_enable = [
         'argparse',
-        'cmdline',
         'eal',
         'ethdev',
         'hash',
Signature · 1 line
2.56.0
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH dpdk 1/2] lib: remove cmdline from always enabled libraries

Quoted 15 lines · Robin Jarry

This library is not used by any driver nor other library:

	$ git grep -l '#include <cmdline.*\.h>' -- \
		':!:app/' ':!:examples/' ':!:*testpmd*'
	buildtools/dpdk-cmdline-gen.py
	lib/cmdline/cmdline.h
	lib/cmdline/cmdline_parse_bool.h
	lib/cmdline/cmdline_parse_etheraddr.h
	lib/cmdline/cmdline_parse_ipaddr.h
	lib/cmdline/cmdline_parse_num.h
	lib/cmdline/cmdline_parse_portlist.h
	lib/cmdline/cmdline_parse_string.h
	lib/cmdline/cmdline_rdline.h
	lib/cmdline/cmdline_socket.h
Quoted 3 lines

The only apps and examples where it is actually used already have an explicit dependency. There is no point in always enabling it.

The original idea was to ensure that testpmd was always buildable even if all libs were disabled, but there's no reason why we need that requirement, so dropping this is ok.

Quoted 5 lines
---
 lib/meson.build | 1 -
 1 file changed, 1 deletion(-)
#3 lore raw

PATCH 2/2 lib: remove stack from always enabled libraries

In reply to Robin Jarry

rte_stack is only used by the associated mempool driver and the stack tests which explicitly declare it as a dependency:

	$ git grep -l '#include <rte_stack.*\.h>'
	app/test/test_stack.c
	app/test/test_stack_perf.c
	drivers/mempool/stack/rte_mempool_stack.c

There is no reason to always build it.

---
 lib/meson.build | 1 -
 1 file changed, 1 deletion(-)
lib/meson.build +0 -1
index 72ac21b5fa86..458951054c55 100644
@@ -84,7 +84,6 @@ always_enable = [
         'pci',
         'rcu',
         'ring',
-        'stack',
         'telemetry',
 ]
 
Signature · 1 line
2.56.0
Acked-by on v1 2/2
#4 lore raw

Re: [PATCH dpdk 2/2] lib: remove stack from always enabled libraries

Quoted 8 lines · Robin Jarry

rte_stack is only used by the associated mempool driver and the stack tests which explicitly declare it as a dependency:

	$ git grep -l '#include <rte_stack.*\.h>'
	app/test/test_stack.c
	app/test/test_stack_perf.c
	drivers/mempool/stack/rte_mempool_stack.c
Quoted 7 lines

There is no reason to always build it.

---
 lib/meson.build | 1 -
 1 file changed, 1 deletion(-)
#5 lore raw
In reply to Robin Jarry
Quoted 6 lines · Robin Jarry

Some libraries are only used either for internal apps/examples (cmdline) or by a specific mempool driver (stack).

Everywhere they are used, an explicit dependency is already recorded in meson. There is no reason to always enable them.

No objection to this, however, I actually have a more complete RFC almost ready to send for the next release, which goes even further than this by doing initial dependency analysis on all components and using that to compute the minimum set to enable. Specifically, if we assume the minimal set is EAL + whatever is needed to build the always needed basic infrastructure drivers, the RFC finishes by computing the lib "always_enable" set as being the dependencies of "bus/pci,bus/vdev,mempool/ring". [As for why that set of minimal drivers - if we omit them, lots of things in DPDK won't function, and we cannot guarantee that any other components selected will depend on them. For example, nothing else depends on mempool/ring so if we want working mempools we have to have it in the enable list]

I'll try and get the RFC out this week to at least get the conversation started in advance of 27.03 opening up.

/Bruce

#6 lore raw
Quoted 21 lines · Bruce Richardson
Quoted 6 lines · Robin Jarry

Some libraries are only used either for internal apps/examples (cmdline) or by a specific mempool driver (stack).

Everywhere they are used, an explicit dependency is already recorded in meson. There is no reason to always enable them.

No objection to this, however, I actually have a more complete RFC almost ready to send for the next release, which goes even further than this by doing initial dependency analysis on all components and using that to compute the minimum set to enable. Specifically, if we assume the minimal set is EAL + whatever is needed to build the always needed basic infrastructure drivers, the RFC finishes by computing the lib "always_enable" set as being the dependencies of "bus/pci,bus/vdev,mempool/ring". [As for why that set of minimal drivers - if we omit them, lots of things in DPDK won't function, and we cannot guarantee that any other components selected will depend on them. For example, nothing else depends on mempool/ring so if we want working mempools we have to have it in the enable list]

Quoted 2 lines

I'll try and get the RFC out this week to at least get the conversation started in advance of 27.03 opening up.

Looking fwd to this RFC.
In the mean time, this series is simple enough, applied.

Signature · 1 line
David Marchand