DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/7] expand list of optional libraries
@ 2023-06-22 13:48 Bruce Richardson
  2023-06-22 13:48 ` [PATCH 1/7] build: make most device classes optional Bruce Richardson
                   ` (10 more replies)
  0 siblings, 11 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 13:48 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

DPDK still has many libraries which cannot be disabled as part of a
build. With the ongoing work to make it easier to only build a subset
of the libraries in DPDK, we can also work to expand the list of
libraries which can be enabled/disabled as desired.

This patch addresses a number of the "low-hanging fruit" libraries,
where only the unit test builds need minor changes to support
making the library optional. The rest of the build system is already
well set up for selective disabling of libraries.

For better support of enabling components, especially those more
integrated into DPDK unit tests, rework of the test meson.build file
is likely needed. For example, it could probably be better rewritten
to use a dictionary of files and the dependencies of each file, and
the unit test commands each provides. However, such rework is a
significant effort, and outside the scope of this patchset.

Bruce Richardson (7):
  build: make most device classes optional
  build: make membership library optional
  build: make bpf library optional
  build: make efd library optional
  build: make distributor library optional
  build: make fragmentation libary optional
  build: make reorder library optional

 app/test/meson.build | 81 +++++++++++++++++++++++++++-----------------
 lib/meson.build      | 13 +++++++
 2 files changed, 63 insertions(+), 31 deletions(-)

--
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH 1/7] build: make most device classes optional
  2023-06-22 13:48 [PATCH 0/7] expand list of optional libraries Bruce Richardson
@ 2023-06-22 13:48 ` Bruce Richardson
  2023-06-22 13:48 ` [PATCH 2/7] build: make membership library optional Bruce Richardson
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 13:48 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Apart from ethdev and cryptodev, which have lots of components and tests
which depend on them, we can make the device class libraries optional
without too much work.

This patch marks:
* bbdev,
* compressdev,
* dmadev,
* eventdev,
* mldev,
* rawdev,
* regexdev
optional, and ensures that DPDK - including tests - can be built with
these components disabled.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/meson.build | 33 +++++++++++++++++++++------------
 lib/meson.build      |  7 +++++++
 2 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index d0fabcbb8b..780005f320 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -41,19 +41,12 @@ test_sources = files(
         'test_devargs.c',
         'test_distributor.c',
         'test_distributor_perf.c',
-        'test_dmadev.c',
-        'test_dmadev_api.c',
         'test_eal_flags.c',
         'test_eal_fs.c',
         'test_efd.c',
         'test_efd_perf.c',
         'test_errno.c',
         'test_ethdev_link.c',
-        'test_event_crypto_adapter.c',
-        'test_event_eth_rx_adapter.c',
-        'test_event_ring.c',
-        'test_event_timer_adapter.c',
-        'test_eventdev.c',
         'test_external_mem.c',
         'test_fbarray.c',
         'test_fib.c',
@@ -105,7 +98,6 @@ test_sources = files(
         'test_power_intel_uncore.c',
         'test_prefetch.c',
         'test_rand_perf.c',
-        'test_rawdev.c',
         'test_rcu_qsbr.c',
         'test_rcu_qsbr_perf.c',
         'test_reciprocal_division.c',
@@ -129,7 +121,6 @@ test_sources = files(
         'test_sched.c',
         'test_security.c',
         'test_security_inline_macsec.c',
-        'test_security_inline_proto.c',
         'test_seqlock.c',
         'test_service_cores.c',
         'test_spinlock.c',
@@ -188,7 +179,6 @@ fast_tests = [
         ['eal_fs_autotest', true, true],
         ['errno_autotest', true, true],
         ['ethdev_link_status', true, true],
-        ['event_ring_autotest', true, true],
         ['fib_autotest', true, true],
         ['fib6_autotest', true, true],
         ['func_reentrancy_autotest', false, true],
@@ -234,7 +224,6 @@ fast_tests = [
         ['version_autotest', true, true],
         ['crc_autotest', true, true],
         ['distributor_autotest', false, true],
-        ['eventdev_common_autotest', true, true],
         ['fbarray_autotest', true, true],
         ['hash_readwrite_func_autotest', false, true],
         ['ipsec_autotest', true, true],
@@ -321,7 +310,6 @@ driver_test_names = [
         'cryptodev_sw_snow3g_autotest',
         'cryptodev_sw_zuc_autotest',
         'cryptodev_uadk_autotest',
-        'dmadev_autotest',
 ]
 
 dump_test_names = []
@@ -359,6 +347,25 @@ if dpdk_conf.has('RTE_EVENT_SKELETON')
     test_deps += 'event_skeleton'
 endif
 
+if dpdk_conf.has('RTE_LIB_DMADEV')
+    test_sources += ['test_dmadev.c', 'test_dmadev_api.c']
+    driver_test_names += 'dmadev_autotest'
+endif
+if dpdk_conf.has('RTE_LIB_EVENTDEV')
+    test_sources += [
+        'test_event_eth_rx_adapter.c',
+        'test_event_ring.c',
+        'test_event_timer_adapter.c',
+        'test_eventdev.c',
+    ]
+    fast_tests += [
+        ['event_ring_autotest', true, true],
+        ['eventdev_common_autotest', true, true],
+    ]
+    if dpdk_conf.has('RTE_LIB_CRYPTODEV')
+        test_sources += 'test_event_crypto_adapter.c'
+    endif
+endif
 if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
@@ -403,6 +410,7 @@ if dpdk_conf.has('RTE_LIB_EVENTDEV') and dpdk_conf.has('RTE_NET_RING')
     test_sources += 'test_pmd_ring.c'
     test_sources += 'test_event_eth_tx_adapter.c'
     test_sources += 'sample_packet_forward.c'
+    test_sources += 'test_security_inline_proto.c'
     fast_tests += [['ring_pmd_autotest', true, true]]
     perf_test_names += 'ring_pmd_perf_autotest'
     fast_tests += [['event_eth_tx_adapter_autotest', false, true]]
@@ -425,6 +433,7 @@ if dpdk_conf.has('RTE_NET_NULL')
     fast_tests += [['vdev_autotest', true, true]]
 endif
 if dpdk_conf.has('RTE_RAW_SKELETON')
+    test_sources += 'test_rawdev.c'
     test_deps += 'raw_skeleton'
     fast_tests += [['rawdev_autotest', true, true]]
 endif
diff --git a/lib/meson.build b/lib/meson.build
index 9677239236..679a81f62f 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -68,8 +68,12 @@ libraries = [
 ]
 
 optional_libs = [
+        'bbdev',
         'bitratestats',
         'cfgfile',
+        'compressdev',
+        'dmadev',
+        'eventdev',
         'flow_classify',
         'gpudev',
         'gro',
@@ -78,11 +82,14 @@ optional_libs = [
         'jobstats',
         'latencystats',
         'metrics',
+        'mldev',
         'node',
         'pdump',
         'pipeline',
         'port',
         'power',
+        'rawdev',
+        'regexdev',
         'table',
         'vhost',
 ]
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH 2/7] build: make membership library optional
  2023-06-22 13:48 [PATCH 0/7] expand list of optional libraries Bruce Richardson
  2023-06-22 13:48 ` [PATCH 1/7] build: make most device classes optional Bruce Richardson
@ 2023-06-22 13:48 ` Bruce Richardson
  2023-06-22 13:48 ` [PATCH 3/7] build: make bpf " Bruce Richardson
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 13:48 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/meson.build | 9 +++++----
 lib/meson.build      | 1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 780005f320..bed6acfdaf 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -78,8 +78,6 @@ test_sources = files(
         'test_malloc.c',
         'test_malloc_perf.c',
         'test_mbuf.c',
-        'test_member.c',
-        'test_member_perf.c',
         'test_memcpy.c',
         'test_memcpy_perf.c',
         'test_memory.c',
@@ -229,7 +227,6 @@ fast_tests = [
         ['ipsec_autotest', true, true],
         ['kni_autotest', false, true],
         ['kvargs_autotest', true, true],
-        ['member_autotest', true, true],
         ['power_cpufreq_autotest', false, true],
         ['power_autotest', true, true],
         ['power_kvm_vm_autotest', false, true],
@@ -267,7 +264,6 @@ perf_test_names = [
         'timer_racecond_autotest',
         'efd_autotest',
         'hash_functions_autotest',
-        'member_perf_autotest',
         'efd_perf_autotest',
         'lpm6_perf_autotest',
         'rib6_slow_autotest',
@@ -374,6 +370,11 @@ if dpdk_conf.has('RTE_LIB_METRICS')
     test_sources += ['test_metrics.c']
     fast_tests += [['metrics_autotest', true, true]]
 endif
+if dpdk_conf.has('RTE_LIB_MEMBER')
+    test_sources += ['test_member.c', 'test_member_perf.c']
+    fast_tests += [['member_autotest', true, true]]
+    perf_test_names += 'member_perf_autotest'
+endif
 if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY')
     test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c']
     fast_tests += [['telemetry_json_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 679a81f62f..e46b141657 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -81,6 +81,7 @@ optional_libs = [
         'kni',
         'jobstats',
         'latencystats',
+        'member',
         'metrics',
         'mldev',
         'node',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH 3/7] build: make bpf library optional
  2023-06-22 13:48 [PATCH 0/7] expand list of optional libraries Bruce Richardson
  2023-06-22 13:48 ` [PATCH 1/7] build: make most device classes optional Bruce Richardson
  2023-06-22 13:48 ` [PATCH 2/7] build: make membership library optional Bruce Richardson
@ 2023-06-22 13:48 ` Bruce Richardson
  2023-06-22 13:48 ` [PATCH 4/7] build: make efd " Bruce Richardson
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 13:48 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/meson.build | 10 +++++++---
 lib/meson.build      |  1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index bed6acfdaf..d8ad8b1d97 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -15,7 +15,6 @@ test_sources = files(
         'test_barrier.c',
         'test_bitops.c',
         'test_bitmap.c',
-        'test_bpf.c',
         'test_byteorder.c',
         'test_cksum.c',
         'test_cksum_perf.c',
@@ -152,8 +151,6 @@ fast_tests = [
         ['acl_autotest', true, true],
         ['atomic_autotest', false, true],
         ['bitmap_autotest', true, true],
-        ['bpf_autotest', true, true],
-        ['bpf_convert_autotest', true, true],
         ['bitops_autotest', true, true],
         ['byteorder_autotest', true, true],
         ['cksum_autotest', true, true],
@@ -343,6 +340,13 @@ if dpdk_conf.has('RTE_EVENT_SKELETON')
     test_deps += 'event_skeleton'
 endif
 
+if dpdk_conf.has('RTE_LIB_BPF')
+    test_sources += 'test_bpf.c'
+    fast_tests += [
+        ['bpf_autotest', true, true],
+        ['bpf_convert_autotest', true, true],
+    ]
+endif
 if dpdk_conf.has('RTE_LIB_DMADEV')
     test_sources += ['test_dmadev.c', 'test_dmadev_api.c']
     driver_test_names += 'dmadev_autotest'
diff --git a/lib/meson.build b/lib/meson.build
index e46b141657..105f167d45 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -70,6 +70,7 @@ libraries = [
 optional_libs = [
         'bbdev',
         'bitratestats',
+        'bpf',
         'cfgfile',
         'compressdev',
         'dmadev',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH 4/7] build: make efd library optional
  2023-06-22 13:48 [PATCH 0/7] expand list of optional libraries Bruce Richardson
                   ` (2 preceding siblings ...)
  2023-06-22 13:48 ` [PATCH 3/7] build: make bpf " Bruce Richardson
@ 2023-06-22 13:48 ` Bruce Richardson
  2023-06-22 13:48 ` [PATCH 5/7] build: make distributor " Bruce Richardson
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 13:48 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/meson.build | 8 ++++----
 lib/meson.build      | 1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index d8ad8b1d97..ab5bd370bf 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -42,8 +42,6 @@ test_sources = files(
         'test_distributor_perf.c',
         'test_eal_flags.c',
         'test_eal_fs.c',
-        'test_efd.c',
-        'test_efd_perf.c',
         'test_errno.c',
         'test_ethdev_link.c',
         'test_external_mem.c',
@@ -259,9 +257,7 @@ perf_test_names = [
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
-        'efd_autotest',
         'hash_functions_autotest',
-        'efd_perf_autotest',
         'lpm6_perf_autotest',
         'rib6_slow_autotest',
         'fib6_slow_autotest',
@@ -370,6 +366,10 @@ if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
 endif
+if dpdk_conf.has('RTE_LIB_EFD')
+    test_sources += ['test_efd.c', 'test_efd_perf.c']
+    perf_test_names += ['efd_autotest', 'efd_perf_autotest']
+endif
 if dpdk_conf.has('RTE_LIB_METRICS')
     test_sources += ['test_metrics.c']
     fast_tests += [['metrics_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 105f167d45..7de3b0d32c 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -74,6 +74,7 @@ optional_libs = [
         'cfgfile',
         'compressdev',
         'dmadev',
+        'efd',
         'eventdev',
         'flow_classify',
         'gpudev',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH 5/7] build: make distributor library optional
  2023-06-22 13:48 [PATCH 0/7] expand list of optional libraries Bruce Richardson
                   ` (3 preceding siblings ...)
  2023-06-22 13:48 ` [PATCH 4/7] build: make efd " Bruce Richardson
@ 2023-06-22 13:48 ` Bruce Richardson
  2023-06-22 13:48 ` [PATCH 6/7] build: make fragmentation libary optional Bruce Richardson
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 13:48 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/meson.build | 9 +++++----
 lib/meson.build      | 1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index ab5bd370bf..749e929945 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -38,8 +38,6 @@ test_sources = files(
         'test_cycles.c',
         'test_debug.c',
         'test_devargs.c',
-        'test_distributor.c',
-        'test_distributor_perf.c',
         'test_eal_flags.c',
         'test_eal_fs.c',
         'test_errno.c',
@@ -216,7 +214,6 @@ fast_tests = [
         ['user_delay_us', true, true],
         ['version_autotest', true, true],
         ['crc_autotest', true, true],
-        ['distributor_autotest', false, true],
         ['fbarray_autotest', true, true],
         ['hash_readwrite_func_autotest', false, true],
         ['ipsec_autotest', true, true],
@@ -265,7 +262,6 @@ perf_test_names = [
         'rcu_qsbr_perf_autotest',
         'red_perf',
         'pie_perf',
-        'distributor_perf_autotest',
         'pmd_perf_autotest',
         'service_perf_autotest',
         'stack_perf_autotest',
@@ -366,6 +362,11 @@ if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
 endif
+if dpdk_conf.has('RTE_LIB_DISTRIBUTOR')
+    test_sources += ['test_distributor.c', 'test_distributor_perf.c']
+    fast_tests += [['distributor_autotest', false, true]]
+    perf_test_names += 'distributor_perf_autotest'
+endif
 if dpdk_conf.has('RTE_LIB_EFD')
     test_sources += ['test_efd.c', 'test_efd_perf.c']
     perf_test_names += ['efd_autotest', 'efd_perf_autotest']
diff --git a/lib/meson.build b/lib/meson.build
index 7de3b0d32c..ce147a0766 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -73,6 +73,7 @@ optional_libs = [
         'bpf',
         'cfgfile',
         'compressdev',
+        'distributor',
         'dmadev',
         'efd',
         'eventdev',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH 6/7] build: make fragmentation libary optional
  2023-06-22 13:48 [PATCH 0/7] expand list of optional libraries Bruce Richardson
                   ` (4 preceding siblings ...)
  2023-06-22 13:48 ` [PATCH 5/7] build: make distributor " Bruce Richardson
@ 2023-06-22 13:48 ` Bruce Richardson
  2023-06-22 13:48 ` [PATCH 7/7] build: make reorder library optional Bruce Richardson
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 13:48 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/meson.build | 6 ++++--
 lib/meson.build      | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 749e929945..e8dbbadd5e 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -58,7 +58,6 @@ test_sources = files(
         'test_hash_perf.c',
         'test_hash_readwrite_lf_perf.c',
         'test_interrupts.c',
-        'test_ipfrag.c',
         'test_ipsec.c',
         'test_ipsec_sad.c',
         'test_ipsec_perf.c',
@@ -175,7 +174,6 @@ fast_tests = [
         ['func_reentrancy_autotest', false, true],
         ['hash_autotest', true, true],
         ['interrupt_autotest', true, true],
-        ['ipfrag_autotest', false, true],
         ['lcores_autotest', true, true],
         ['logs_autotest', true, true],
         ['lpm_autotest', true, true],
@@ -371,6 +369,10 @@ if dpdk_conf.has('RTE_LIB_EFD')
     test_sources += ['test_efd.c', 'test_efd_perf.c']
     perf_test_names += ['efd_autotest', 'efd_perf_autotest']
 endif
+if dpdk_conf.has('RTE_IP_FRAG')
+    test_sources += 'test_ipfrag.c'
+    fast_tests += [['ipfrag_autotest', false, true]]
+endif
 if dpdk_conf.has('RTE_LIB_METRICS')
     test_sources += ['test_metrics.c']
     fast_tests += [['metrics_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index ce147a0766..7fb0cf4c4e 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -82,6 +82,7 @@ optional_libs = [
         'gro',
         'gso',
         'kni',
+        'ip_frag',
         'jobstats',
         'latencystats',
         'member',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH 7/7] build: make reorder library optional
  2023-06-22 13:48 [PATCH 0/7] expand list of optional libraries Bruce Richardson
                   ` (5 preceding siblings ...)
  2023-06-22 13:48 ` [PATCH 6/7] build: make fragmentation libary optional Bruce Richardson
@ 2023-06-22 13:48 ` Bruce Richardson
  2023-06-22 14:30 ` [PATCH 0/7] expand list of optional libraries Morten Brørup
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 13:48 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/meson.build | 6 ++++--
 lib/meson.build      | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index e8dbbadd5e..13bd752002 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -96,7 +96,6 @@ test_sources = files(
         'test_reciprocal_division_perf.c',
         'test_red.c',
         'test_pie.c',
-        'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
         'test_ring.c',
@@ -221,7 +220,6 @@ fast_tests = [
         ['power_autotest', true, true],
         ['power_kvm_vm_autotest', false, true],
         ['power_intel_uncore_autotest', true, true],
-        ['reorder_autotest', true, true],
         ['service_autotest', true, true],
         ['thash_autotest', true, true],
         ['threads_autotest', true, true],
@@ -382,6 +380,10 @@ if dpdk_conf.has('RTE_LIB_MEMBER')
     fast_tests += [['member_autotest', true, true]]
     perf_test_names += 'member_perf_autotest'
 endif
+if dpdk_conf.has('RTE_LIB_REORDER')
+    test_sources += 'test_reorder.c'
+    fast_tests += [['reorder_autotest', true, true]]
+endif
 if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY')
     test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c']
     fast_tests += [['telemetry_json_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 7fb0cf4c4e..be4c6113fe 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -95,6 +95,7 @@ optional_libs = [
         'power',
         'rawdev',
         'regexdev',
+        'reorder',
         'table',
         'vhost',
 ]
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* RE: [PATCH 0/7] expand list of optional libraries
  2023-06-22 13:48 [PATCH 0/7] expand list of optional libraries Bruce Richardson
                   ` (6 preceding siblings ...)
  2023-06-22 13:48 ` [PATCH 7/7] build: make reorder library optional Bruce Richardson
@ 2023-06-22 14:30 ` Morten Brørup
  2023-06-22 15:05 ` [PATCH v2 " Bruce Richardson
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Morten Brørup @ 2023-06-22 14:30 UTC (permalink / raw)
  To: Bruce Richardson, dev

> From: Bruce Richardson [mailto:bruce.richardson@intel.com]
> Sent: Thursday, 22 June 2023 15.49
> 
> DPDK still has many libraries which cannot be disabled as part of a
> build. With the ongoing work to make it easier to only build a subset
> of the libraries in DPDK, we can also work to expand the list of
> libraries which can be enabled/disabled as desired.
> 
> This patch addresses a number of the "low-hanging fruit" libraries,
> where only the unit test builds need minor changes to support
> making the library optional. The rest of the build system is already
> well set up for selective disabling of libraries.
> 
> For better support of enabling components, especially those more
> integrated into DPDK unit tests, rework of the test meson.build file
> is likely needed. For example, it could probably be better rewritten
> to use a dictionary of files and the dependencies of each file, and
> the unit test commands each provides. However, such rework is a
> significant effort, and outside the scope of this patchset.

Thank you, Bruce.

Series-acked-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 0/7] expand list of optional libraries
  2023-06-22 13:48 [PATCH 0/7] expand list of optional libraries Bruce Richardson
                   ` (7 preceding siblings ...)
  2023-06-22 14:30 ` [PATCH 0/7] expand list of optional libraries Morten Brørup
@ 2023-06-22 15:05 ` Bruce Richardson
  2023-06-22 15:05   ` [PATCH v2 1/7] build: make most device classes optional Bruce Richardson
                     ` (7 more replies)
  2023-06-23 11:15 ` [PATCH v3 0/8] " Bruce Richardson
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
  10 siblings, 8 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 15:05 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

DPDK still has many libraries which cannot be disabled as part of a
build. With the ongoing work to make it easier to only build a subset
of the libraries in DPDK, we can also work to expand the list of
libraries which can be enabled/disabled as desired.

This patch addresses a number of the "low-hanging fruit" libraries,
where only the unit test builds need minor changes to support
making the library optional. The rest of the build system is already
well set up for selective disabling of libraries.

For better support of enabling components, especially those more
integrated into DPDK unit tests, rework of the test meson.build file
is likely needed. For example, it could probably be better rewritten
to use a dictionary of files and the dependencies of each file, and
the unit test commands each provides. However, such rework is a
significant effort, and outside the scope of this patchset.

V2: fix checkpatch issues, since checkpatch doesn't like empty commit
    messages (even if the title is pretty self-explanatory!)

Bruce Richardson (7):
  build: make most device classes optional
  build: make membership library optional
  build: make bpf library optional
  build: make efd library optional
  build: make distributor library optional
  build: make fragmentation library optional
  build: make reorder library optional

 app/test/meson.build | 81 +++++++++++++++++++++++++++-----------------
 lib/meson.build      | 13 +++++++
 2 files changed, 63 insertions(+), 31 deletions(-)

--
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 1/7] build: make most device classes optional
  2023-06-22 15:05 ` [PATCH v2 " Bruce Richardson
@ 2023-06-22 15:05   ` Bruce Richardson
  2023-06-22 15:05   ` [PATCH v2 2/7] build: make membership library optional Bruce Richardson
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 15:05 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

Apart from ethdev and cryptodev, which have lots of components and tests
which depend on them, we can make the device class libraries optional
without too much work.

This patch marks:
* bbdev,
* compressdev,
* dmadev,
* eventdev,
* mldev,
* rawdev,
* regexdev
optional, and ensures that DPDK - including tests - can be built with
these components disabled.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 33 +++++++++++++++++++++------------
 lib/meson.build      |  7 +++++++
 2 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index d0fabcbb8b..780005f320 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -41,19 +41,12 @@ test_sources = files(
         'test_devargs.c',
         'test_distributor.c',
         'test_distributor_perf.c',
-        'test_dmadev.c',
-        'test_dmadev_api.c',
         'test_eal_flags.c',
         'test_eal_fs.c',
         'test_efd.c',
         'test_efd_perf.c',
         'test_errno.c',
         'test_ethdev_link.c',
-        'test_event_crypto_adapter.c',
-        'test_event_eth_rx_adapter.c',
-        'test_event_ring.c',
-        'test_event_timer_adapter.c',
-        'test_eventdev.c',
         'test_external_mem.c',
         'test_fbarray.c',
         'test_fib.c',
@@ -105,7 +98,6 @@ test_sources = files(
         'test_power_intel_uncore.c',
         'test_prefetch.c',
         'test_rand_perf.c',
-        'test_rawdev.c',
         'test_rcu_qsbr.c',
         'test_rcu_qsbr_perf.c',
         'test_reciprocal_division.c',
@@ -129,7 +121,6 @@ test_sources = files(
         'test_sched.c',
         'test_security.c',
         'test_security_inline_macsec.c',
-        'test_security_inline_proto.c',
         'test_seqlock.c',
         'test_service_cores.c',
         'test_spinlock.c',
@@ -188,7 +179,6 @@ fast_tests = [
         ['eal_fs_autotest', true, true],
         ['errno_autotest', true, true],
         ['ethdev_link_status', true, true],
-        ['event_ring_autotest', true, true],
         ['fib_autotest', true, true],
         ['fib6_autotest', true, true],
         ['func_reentrancy_autotest', false, true],
@@ -234,7 +224,6 @@ fast_tests = [
         ['version_autotest', true, true],
         ['crc_autotest', true, true],
         ['distributor_autotest', false, true],
-        ['eventdev_common_autotest', true, true],
         ['fbarray_autotest', true, true],
         ['hash_readwrite_func_autotest', false, true],
         ['ipsec_autotest', true, true],
@@ -321,7 +310,6 @@ driver_test_names = [
         'cryptodev_sw_snow3g_autotest',
         'cryptodev_sw_zuc_autotest',
         'cryptodev_uadk_autotest',
-        'dmadev_autotest',
 ]
 
 dump_test_names = []
@@ -359,6 +347,25 @@ if dpdk_conf.has('RTE_EVENT_SKELETON')
     test_deps += 'event_skeleton'
 endif
 
+if dpdk_conf.has('RTE_LIB_DMADEV')
+    test_sources += ['test_dmadev.c', 'test_dmadev_api.c']
+    driver_test_names += 'dmadev_autotest'
+endif
+if dpdk_conf.has('RTE_LIB_EVENTDEV')
+    test_sources += [
+        'test_event_eth_rx_adapter.c',
+        'test_event_ring.c',
+        'test_event_timer_adapter.c',
+        'test_eventdev.c',
+    ]
+    fast_tests += [
+        ['event_ring_autotest', true, true],
+        ['eventdev_common_autotest', true, true],
+    ]
+    if dpdk_conf.has('RTE_LIB_CRYPTODEV')
+        test_sources += 'test_event_crypto_adapter.c'
+    endif
+endif
 if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
@@ -403,6 +410,7 @@ if dpdk_conf.has('RTE_LIB_EVENTDEV') and dpdk_conf.has('RTE_NET_RING')
     test_sources += 'test_pmd_ring.c'
     test_sources += 'test_event_eth_tx_adapter.c'
     test_sources += 'sample_packet_forward.c'
+    test_sources += 'test_security_inline_proto.c'
     fast_tests += [['ring_pmd_autotest', true, true]]
     perf_test_names += 'ring_pmd_perf_autotest'
     fast_tests += [['event_eth_tx_adapter_autotest', false, true]]
@@ -425,6 +433,7 @@ if dpdk_conf.has('RTE_NET_NULL')
     fast_tests += [['vdev_autotest', true, true]]
 endif
 if dpdk_conf.has('RTE_RAW_SKELETON')
+    test_sources += 'test_rawdev.c'
     test_deps += 'raw_skeleton'
     fast_tests += [['rawdev_autotest', true, true]]
 endif
diff --git a/lib/meson.build b/lib/meson.build
index 9677239236..679a81f62f 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -68,8 +68,12 @@ libraries = [
 ]
 
 optional_libs = [
+        'bbdev',
         'bitratestats',
         'cfgfile',
+        'compressdev',
+        'dmadev',
+        'eventdev',
         'flow_classify',
         'gpudev',
         'gro',
@@ -78,11 +82,14 @@ optional_libs = [
         'jobstats',
         'latencystats',
         'metrics',
+        'mldev',
         'node',
         'pdump',
         'pipeline',
         'port',
         'power',
+        'rawdev',
+        'regexdev',
         'table',
         'vhost',
 ]
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 2/7] build: make membership library optional
  2023-06-22 15:05 ` [PATCH v2 " Bruce Richardson
  2023-06-22 15:05   ` [PATCH v2 1/7] build: make most device classes optional Bruce Richardson
@ 2023-06-22 15:05   ` Bruce Richardson
  2023-06-22 15:05   ` [PATCH v2 3/7] build: make bpf " Bruce Richardson
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 15:05 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 9 +++++----
 lib/meson.build      | 1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 780005f320..bed6acfdaf 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -78,8 +78,6 @@ test_sources = files(
         'test_malloc.c',
         'test_malloc_perf.c',
         'test_mbuf.c',
-        'test_member.c',
-        'test_member_perf.c',
         'test_memcpy.c',
         'test_memcpy_perf.c',
         'test_memory.c',
@@ -229,7 +227,6 @@ fast_tests = [
         ['ipsec_autotest', true, true],
         ['kni_autotest', false, true],
         ['kvargs_autotest', true, true],
-        ['member_autotest', true, true],
         ['power_cpufreq_autotest', false, true],
         ['power_autotest', true, true],
         ['power_kvm_vm_autotest', false, true],
@@ -267,7 +264,6 @@ perf_test_names = [
         'timer_racecond_autotest',
         'efd_autotest',
         'hash_functions_autotest',
-        'member_perf_autotest',
         'efd_perf_autotest',
         'lpm6_perf_autotest',
         'rib6_slow_autotest',
@@ -374,6 +370,11 @@ if dpdk_conf.has('RTE_LIB_METRICS')
     test_sources += ['test_metrics.c']
     fast_tests += [['metrics_autotest', true, true]]
 endif
+if dpdk_conf.has('RTE_LIB_MEMBER')
+    test_sources += ['test_member.c', 'test_member_perf.c']
+    fast_tests += [['member_autotest', true, true]]
+    perf_test_names += 'member_perf_autotest'
+endif
 if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY')
     test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c']
     fast_tests += [['telemetry_json_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 679a81f62f..e46b141657 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -81,6 +81,7 @@ optional_libs = [
         'kni',
         'jobstats',
         'latencystats',
+        'member',
         'metrics',
         'mldev',
         'node',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 3/7] build: make bpf library optional
  2023-06-22 15:05 ` [PATCH v2 " Bruce Richardson
  2023-06-22 15:05   ` [PATCH v2 1/7] build: make most device classes optional Bruce Richardson
  2023-06-22 15:05   ` [PATCH v2 2/7] build: make membership library optional Bruce Richardson
@ 2023-06-22 15:05   ` Bruce Richardson
  2023-06-22 15:05   ` [PATCH v2 4/7] build: make efd " Bruce Richardson
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 15:05 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 10 +++++++---
 lib/meson.build      |  1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index bed6acfdaf..d8ad8b1d97 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -15,7 +15,6 @@ test_sources = files(
         'test_barrier.c',
         'test_bitops.c',
         'test_bitmap.c',
-        'test_bpf.c',
         'test_byteorder.c',
         'test_cksum.c',
         'test_cksum_perf.c',
@@ -152,8 +151,6 @@ fast_tests = [
         ['acl_autotest', true, true],
         ['atomic_autotest', false, true],
         ['bitmap_autotest', true, true],
-        ['bpf_autotest', true, true],
-        ['bpf_convert_autotest', true, true],
         ['bitops_autotest', true, true],
         ['byteorder_autotest', true, true],
         ['cksum_autotest', true, true],
@@ -343,6 +340,13 @@ if dpdk_conf.has('RTE_EVENT_SKELETON')
     test_deps += 'event_skeleton'
 endif
 
+if dpdk_conf.has('RTE_LIB_BPF')
+    test_sources += 'test_bpf.c'
+    fast_tests += [
+        ['bpf_autotest', true, true],
+        ['bpf_convert_autotest', true, true],
+    ]
+endif
 if dpdk_conf.has('RTE_LIB_DMADEV')
     test_sources += ['test_dmadev.c', 'test_dmadev_api.c']
     driver_test_names += 'dmadev_autotest'
diff --git a/lib/meson.build b/lib/meson.build
index e46b141657..105f167d45 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -70,6 +70,7 @@ libraries = [
 optional_libs = [
         'bbdev',
         'bitratestats',
+        'bpf',
         'cfgfile',
         'compressdev',
         'dmadev',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 4/7] build: make efd library optional
  2023-06-22 15:05 ` [PATCH v2 " Bruce Richardson
                     ` (2 preceding siblings ...)
  2023-06-22 15:05   ` [PATCH v2 3/7] build: make bpf " Bruce Richardson
@ 2023-06-22 15:05   ` Bruce Richardson
  2023-06-22 15:05   ` [PATCH v2 5/7] build: make distributor " Bruce Richardson
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 15:05 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 8 ++++----
 lib/meson.build      | 1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index d8ad8b1d97..ab5bd370bf 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -42,8 +42,6 @@ test_sources = files(
         'test_distributor_perf.c',
         'test_eal_flags.c',
         'test_eal_fs.c',
-        'test_efd.c',
-        'test_efd_perf.c',
         'test_errno.c',
         'test_ethdev_link.c',
         'test_external_mem.c',
@@ -259,9 +257,7 @@ perf_test_names = [
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
-        'efd_autotest',
         'hash_functions_autotest',
-        'efd_perf_autotest',
         'lpm6_perf_autotest',
         'rib6_slow_autotest',
         'fib6_slow_autotest',
@@ -370,6 +366,10 @@ if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
 endif
+if dpdk_conf.has('RTE_LIB_EFD')
+    test_sources += ['test_efd.c', 'test_efd_perf.c']
+    perf_test_names += ['efd_autotest', 'efd_perf_autotest']
+endif
 if dpdk_conf.has('RTE_LIB_METRICS')
     test_sources += ['test_metrics.c']
     fast_tests += [['metrics_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 105f167d45..7de3b0d32c 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -74,6 +74,7 @@ optional_libs = [
         'cfgfile',
         'compressdev',
         'dmadev',
+        'efd',
         'eventdev',
         'flow_classify',
         'gpudev',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 5/7] build: make distributor library optional
  2023-06-22 15:05 ` [PATCH v2 " Bruce Richardson
                     ` (3 preceding siblings ...)
  2023-06-22 15:05   ` [PATCH v2 4/7] build: make efd " Bruce Richardson
@ 2023-06-22 15:05   ` Bruce Richardson
  2023-06-22 15:05   ` [PATCH v2 6/7] build: make fragmentation " Bruce Richardson
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 15:05 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 9 +++++----
 lib/meson.build      | 1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index ab5bd370bf..749e929945 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -38,8 +38,6 @@ test_sources = files(
         'test_cycles.c',
         'test_debug.c',
         'test_devargs.c',
-        'test_distributor.c',
-        'test_distributor_perf.c',
         'test_eal_flags.c',
         'test_eal_fs.c',
         'test_errno.c',
@@ -216,7 +214,6 @@ fast_tests = [
         ['user_delay_us', true, true],
         ['version_autotest', true, true],
         ['crc_autotest', true, true],
-        ['distributor_autotest', false, true],
         ['fbarray_autotest', true, true],
         ['hash_readwrite_func_autotest', false, true],
         ['ipsec_autotest', true, true],
@@ -265,7 +262,6 @@ perf_test_names = [
         'rcu_qsbr_perf_autotest',
         'red_perf',
         'pie_perf',
-        'distributor_perf_autotest',
         'pmd_perf_autotest',
         'service_perf_autotest',
         'stack_perf_autotest',
@@ -366,6 +362,11 @@ if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
 endif
+if dpdk_conf.has('RTE_LIB_DISTRIBUTOR')
+    test_sources += ['test_distributor.c', 'test_distributor_perf.c']
+    fast_tests += [['distributor_autotest', false, true]]
+    perf_test_names += 'distributor_perf_autotest'
+endif
 if dpdk_conf.has('RTE_LIB_EFD')
     test_sources += ['test_efd.c', 'test_efd_perf.c']
     perf_test_names += ['efd_autotest', 'efd_perf_autotest']
diff --git a/lib/meson.build b/lib/meson.build
index 7de3b0d32c..ce147a0766 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -73,6 +73,7 @@ optional_libs = [
         'bpf',
         'cfgfile',
         'compressdev',
+        'distributor',
         'dmadev',
         'efd',
         'eventdev',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 6/7] build: make fragmentation library optional
  2023-06-22 15:05 ` [PATCH v2 " Bruce Richardson
                     ` (4 preceding siblings ...)
  2023-06-22 15:05   ` [PATCH v2 5/7] build: make distributor " Bruce Richardson
@ 2023-06-22 15:05   ` Bruce Richardson
  2023-06-22 15:05   ` [PATCH v2 7/7] build: make reorder " Bruce Richardson
  2023-06-23 10:25   ` [PATCH v2 0/7] expand list of optional libraries David Marchand
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 15:05 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 6 ++++--
 lib/meson.build      | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 749e929945..e8dbbadd5e 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -58,7 +58,6 @@ test_sources = files(
         'test_hash_perf.c',
         'test_hash_readwrite_lf_perf.c',
         'test_interrupts.c',
-        'test_ipfrag.c',
         'test_ipsec.c',
         'test_ipsec_sad.c',
         'test_ipsec_perf.c',
@@ -175,7 +174,6 @@ fast_tests = [
         ['func_reentrancy_autotest', false, true],
         ['hash_autotest', true, true],
         ['interrupt_autotest', true, true],
-        ['ipfrag_autotest', false, true],
         ['lcores_autotest', true, true],
         ['logs_autotest', true, true],
         ['lpm_autotest', true, true],
@@ -371,6 +369,10 @@ if dpdk_conf.has('RTE_LIB_EFD')
     test_sources += ['test_efd.c', 'test_efd_perf.c']
     perf_test_names += ['efd_autotest', 'efd_perf_autotest']
 endif
+if dpdk_conf.has('RTE_IP_FRAG')
+    test_sources += 'test_ipfrag.c'
+    fast_tests += [['ipfrag_autotest', false, true]]
+endif
 if dpdk_conf.has('RTE_LIB_METRICS')
     test_sources += ['test_metrics.c']
     fast_tests += [['metrics_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index ce147a0766..7fb0cf4c4e 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -82,6 +82,7 @@ optional_libs = [
         'gro',
         'gso',
         'kni',
+        'ip_frag',
         'jobstats',
         'latencystats',
         'member',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 7/7] build: make reorder library optional
  2023-06-22 15:05 ` [PATCH v2 " Bruce Richardson
                     ` (5 preceding siblings ...)
  2023-06-22 15:05   ` [PATCH v2 6/7] build: make fragmentation " Bruce Richardson
@ 2023-06-22 15:05   ` Bruce Richardson
  2023-06-23 10:25   ` [PATCH v2 0/7] expand list of optional libraries David Marchand
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-22 15:05 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 6 ++++--
 lib/meson.build      | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index e8dbbadd5e..13bd752002 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -96,7 +96,6 @@ test_sources = files(
         'test_reciprocal_division_perf.c',
         'test_red.c',
         'test_pie.c',
-        'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
         'test_ring.c',
@@ -221,7 +220,6 @@ fast_tests = [
         ['power_autotest', true, true],
         ['power_kvm_vm_autotest', false, true],
         ['power_intel_uncore_autotest', true, true],
-        ['reorder_autotest', true, true],
         ['service_autotest', true, true],
         ['thash_autotest', true, true],
         ['threads_autotest', true, true],
@@ -382,6 +380,10 @@ if dpdk_conf.has('RTE_LIB_MEMBER')
     fast_tests += [['member_autotest', true, true]]
     perf_test_names += 'member_perf_autotest'
 endif
+if dpdk_conf.has('RTE_LIB_REORDER')
+    test_sources += 'test_reorder.c'
+    fast_tests += [['reorder_autotest', true, true]]
+endif
 if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY')
     test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c']
     fast_tests += [['telemetry_json_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 7fb0cf4c4e..be4c6113fe 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -95,6 +95,7 @@ optional_libs = [
         'power',
         'rawdev',
         'regexdev',
+        'reorder',
         'table',
         'vhost',
 ]
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 0/7] expand list of optional libraries
  2023-06-22 15:05 ` [PATCH v2 " Bruce Richardson
                     ` (6 preceding siblings ...)
  2023-06-22 15:05   ` [PATCH v2 7/7] build: make reorder " Bruce Richardson
@ 2023-06-23 10:25   ` David Marchand
  2023-06-23 10:31     ` David Marchand
  7 siblings, 1 reply; 50+ messages in thread
From: David Marchand @ 2023-06-23 10:25 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Thu, Jun 22, 2023 at 5:13 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> DPDK still has many libraries which cannot be disabled as part of a
> build. With the ongoing work to make it easier to only build a subset
> of the libraries in DPDK, we can also work to expand the list of
> libraries which can be enabled/disabled as desired.
>
> This patch addresses a number of the "low-hanging fruit" libraries,
> where only the unit test builds need minor changes to support
> making the library optional. The rest of the build system is already
> well set up for selective disabling of libraries.
>
> For better support of enabling components, especially those more
> integrated into DPDK unit tests, rework of the test meson.build file
> is likely needed. For example, it could probably be better rewritten
> to use a dictionary of files and the dependencies of each file, and
> the unit test commands each provides. However, such rework is a
> significant effort, and outside the scope of this patchset.
>
> V2: fix checkpatch issues, since checkpatch doesn't like empty commit
>     messages (even if the title is pretty self-explanatory!)
>
> Bruce Richardson (7):
>   build: make most device classes optional
>   build: make membership library optional
>   build: make bpf library optional
>   build: make efd library optional
>   build: make distributor library optional
>   build: make fragmentation library optional
>   build: make reorder library optional
>
>  app/test/meson.build | 81 +++++++++++++++++++++++++++-----------------
>  lib/meson.build      | 13 +++++++
>  2 files changed, 63 insertions(+), 31 deletions(-)

There is a trivial conflict on the main repo (after lib/graph change),
so the CI did not run this v2 revision.

The v1 looked fine but there was a strange error in Intel report:
http://mails.dpdk.org/archives/test-report/2023-June/415672.html

Could you rebase please?


-- 
David Marchand


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 0/7] expand list of optional libraries
  2023-06-23 10:25   ` [PATCH v2 0/7] expand list of optional libraries David Marchand
@ 2023-06-23 10:31     ` David Marchand
  2023-06-23 11:08       ` Bruce Richardson
  0 siblings, 1 reply; 50+ messages in thread
From: David Marchand @ 2023-06-23 10:31 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Aaron Conole, Michael Santana, Thomas Monjalon

On Fri, Jun 23, 2023 at 12:25 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Thu, Jun 22, 2023 at 5:13 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > DPDK still has many libraries which cannot be disabled as part of a
> > build. With the ongoing work to make it easier to only build a subset
> > of the libraries in DPDK, we can also work to expand the list of
> > libraries which can be enabled/disabled as desired.
> >
> > This patch addresses a number of the "low-hanging fruit" libraries,
> > where only the unit test builds need minor changes to support
> > making the library optional. The rest of the build system is already
> > well set up for selective disabling of libraries.
> >
> > For better support of enabling components, especially those more
> > integrated into DPDK unit tests, rework of the test meson.build file
> > is likely needed. For example, it could probably be better rewritten
> > to use a dictionary of files and the dependencies of each file, and
> > the unit test commands each provides. However, such rework is a
> > significant effort, and outside the scope of this patchset.
> >
> > V2: fix checkpatch issues, since checkpatch doesn't like empty commit
> >     messages (even if the title is pretty self-explanatory!)
> >
> > Bruce Richardson (7):
> >   build: make most device classes optional
> >   build: make membership library optional
> >   build: make bpf library optional
> >   build: make efd library optional
> >   build: make distributor library optional
> >   build: make fragmentation library optional
> >   build: make reorder library optional
> >
> >  app/test/meson.build | 81 +++++++++++++++++++++++++++-----------------
> >  lib/meson.build      | 13 +++++++
> >  2 files changed, 63 insertions(+), 31 deletions(-)
>
> There is a trivial conflict on the main repo (after lib/graph change),
> so the CI did not run this v2 revision.
>
> The v1 looked fine but there was a strange error in Intel report:
> http://mails.dpdk.org/archives/test-report/2023-June/415672.html

Hum, we did not receive the ovsrobot report on v1 (not sure why), but
looking at it manually, we have one failure too:
https://github.com/ovsrobot/dpdk/actions/runs/5346924872/jobs/9694636520#step:18:219

This is because we ask for the l3fwd example but its dependencies are disabled.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 0/7] expand list of optional libraries
  2023-06-23 10:31     ` David Marchand
@ 2023-06-23 11:08       ` Bruce Richardson
  0 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 11:08 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Aaron Conole, Michael Santana, Thomas Monjalon

On Fri, Jun 23, 2023 at 12:31:10PM +0200, David Marchand wrote:
> On Fri, Jun 23, 2023 at 12:25 PM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > On Thu, Jun 22, 2023 at 5:13 PM Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > >
> > > DPDK still has many libraries which cannot be disabled as part of a
> > > build. With the ongoing work to make it easier to only build a subset
> > > of the libraries in DPDK, we can also work to expand the list of
> > > libraries which can be enabled/disabled as desired.
> > >
> > > This patch addresses a number of the "low-hanging fruit" libraries,
> > > where only the unit test builds need minor changes to support
> > > making the library optional. The rest of the build system is already
> > > well set up for selective disabling of libraries.
> > >
> > > For better support of enabling components, especially those more
> > > integrated into DPDK unit tests, rework of the test meson.build file
> > > is likely needed. For example, it could probably be better rewritten
> > > to use a dictionary of files and the dependencies of each file, and
> > > the unit test commands each provides. However, such rework is a
> > > significant effort, and outside the scope of this patchset.
> > >
> > > V2: fix checkpatch issues, since checkpatch doesn't like empty commit
> > >     messages (even if the title is pretty self-explanatory!)
> > >
> > > Bruce Richardson (7):
> > >   build: make most device classes optional
> > >   build: make membership library optional
> > >   build: make bpf library optional
> > >   build: make efd library optional
> > >   build: make distributor library optional
> > >   build: make fragmentation library optional
> > >   build: make reorder library optional
> > >
> > >  app/test/meson.build | 81 +++++++++++++++++++++++++++-----------------
> > >  lib/meson.build      | 13 +++++++
> > >  2 files changed, 63 insertions(+), 31 deletions(-)
> >
> > There is a trivial conflict on the main repo (after lib/graph change),
> > so the CI did not run this v2 revision.
> >

I've already rebased and preparing a v3

> > The v1 looked fine but there was a strange error in Intel report:
> > http://mails.dpdk.org/archives/test-report/2023-June/415672.html
> 
> Hum, we did not receive the ovsrobot report on v1 (not sure why), but
> looking at it manually, we have one failure too:
> https://github.com/ovsrobot/dpdk/actions/runs/5346924872/jobs/9694636520#step:18:219
> 
> This is because we ask for the l3fwd example but its dependencies are disabled.
> 

Spotted this too, and working on a solution. Three options I considered:
1. keep eventdev as mandatory
2. don't build l3fwd as part of examples list (or build only with eventdev)
3. make eventdev an optional dependency of l3fwd.

I've gone for the latter (#3), which, though likely the more complicated
change is probably the best one. L3fwd is such a commonly referenced app, I
think it should be buildable in all configs, and I also think requiring
eventdev in all cases seems wrong. 

V3 coming soon....

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 0/8] expand list of optional libraries
  2023-06-22 13:48 [PATCH 0/7] expand list of optional libraries Bruce Richardson
                   ` (8 preceding siblings ...)
  2023-06-22 15:05 ` [PATCH v2 " Bruce Richardson
@ 2023-06-23 11:15 ` Bruce Richardson
  2023-06-23 11:15   ` [PATCH v3 1/8] examples/l3fwd: make eventdev an optional dependency Bruce Richardson
                     ` (7 more replies)
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
  10 siblings, 8 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 11:15 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

DPDK still has many libraries which cannot be disabled as part of a
build. With the ongoing work to make it easier to only build a subset
of the libraries in DPDK, we can also work to expand the list of
libraries which can be enabled/disabled as desired.

This patch addresses a number of the "low-hanging fruit" libraries,
where only the unit test builds need minor changes to support
making the library optional. The rest of the build system is already
well set up for selective disabling of libraries.

For better support of enabling components, especially those more
integrated into DPDK unit tests, rework of the test meson.build file
is likely needed. For example, it could probably be better rewritten
to use a dictionary of files and the dependencies of each file, and
the unit test commands each provides. However, such rework is a
significant effort, and outside the scope of this patchset.

V3:
- rebase on top of main.
- make eventdev an optional dependency of l3fwd
- Fix incorrect define reference - RTE_LIB_IP_FRAG vs RTE_IP_FRAG

V2: fix checkpatch issues, since checkpatch doesn't like empty commit
    messages (even if the title is pretty self-explanatory!)

Bruce Richardson (8):
  examples/l3fwd: make eventdev an optional dependency
  build: make most device classes optional
  build: make membership library optional
  build: make bpf library optional
  build: make efd library optional
  build: make distributor library optional
  build: make fragmentation library optional
  build: make reorder library optional

 app/test/meson.build       | 81 +++++++++++++++++++++++---------------
 examples/l3fwd/l3fwd_em.c  |  2 +
 examples/l3fwd/l3fwd_fib.c |  2 +
 examples/l3fwd/l3fwd_lpm.c |  2 +
 examples/l3fwd/main.c      | 65 +++++++++++++++++++++++-------
 examples/l3fwd/meson.build | 13 ++++--
 lib/meson.build            | 13 ++++++
 7 files changed, 129 insertions(+), 49 deletions(-)

--
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 1/8] examples/l3fwd: make eventdev an optional dependency
  2023-06-23 11:15 ` [PATCH v3 0/8] " Bruce Richardson
@ 2023-06-23 11:15   ` Bruce Richardson
  2023-06-23 13:25     ` Bruce Richardson
  2023-06-23 11:15   ` [PATCH v3 2/8] build: make most device classes optional Bruce Richardson
                     ` (6 subsequent siblings)
  7 siblings, 1 reply; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 11:15 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

With l3fwd being a very commonly used example app, and built as part of
our CI tests, we need to ensure it's buildable with just about all
supported DPDK configurations.  To enable l3fwd application to be built
when the eventdev library is disabled, we need to compile in the
eventdev support conditionally.  Thankfully, the eventdev support is
pretty self-contained, with only the main.c file having more than a
couple of ifdefs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/l3fwd/l3fwd_em.c  |  2 ++
 examples/l3fwd/l3fwd_fib.c |  2 ++
 examples/l3fwd/l3fwd_lpm.c |  2 ++
 examples/l3fwd/main.c      | 65 ++++++++++++++++++++++++++++++--------
 examples/l3fwd/meson.build | 13 +++++---
 5 files changed, 66 insertions(+), 18 deletions(-)

diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
index 476ac0c54f..40e102b38a 100644
--- a/examples/l3fwd/l3fwd_em.c
+++ b/examples/l3fwd/l3fwd_em.c
@@ -663,6 +663,7 @@ em_main_loop(__rte_unused void *dummy)
 	return 0;
 }
 
+#ifdef RTE_LIB_EVENTDEV
 static __rte_always_inline void
 em_event_loop_single(struct l3fwd_event_resources *evt_rsrc,
 		const uint8_t flags)
@@ -959,6 +960,7 @@ em_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy)
 	em_event_loop_vector(evt_rsrc, L3FWD_EVENT_TX_ENQ);
 	return 0;
 }
+#endif
 
 /* Initialize exact match (hash) parameters. 8< */
 void
diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c
index edc0dd69b9..8760016545 100644
--- a/examples/l3fwd/l3fwd_fib.c
+++ b/examples/l3fwd/l3fwd_fib.c
@@ -253,6 +253,7 @@ fib_main_loop(__rte_unused void *dummy)
 	return 0;
 }
 
+#ifdef RTE_LIB_EVENTDEV
 /* One eventdev loop for single and burst using fib. */
 static __rte_always_inline void
 fib_event_loop(struct l3fwd_event_resources *evt_rsrc,
@@ -635,6 +636,7 @@ fib_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy)
 	fib_event_loop_vector(evt_rsrc, L3FWD_EVENT_TX_ENQ);
 	return 0;
 }
+#endif
 
 /* Function to setup fib. 8< */
 void
diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
index 4ac1925c84..a484a33089 100644
--- a/examples/l3fwd/l3fwd_lpm.c
+++ b/examples/l3fwd/l3fwd_lpm.c
@@ -226,6 +226,7 @@ lpm_main_loop(__rte_unused void *dummy)
 	return 0;
 }
 
+#ifdef RTE_LIB_EVENTDEV
 static __rte_always_inline uint16_t
 lpm_process_event_pkt(const struct lcore_conf *lconf, struct rte_mbuf *mbuf)
 {
@@ -554,6 +555,7 @@ lpm_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy)
 	lpm_event_loop_vector(evt_rsrc, L3FWD_EVENT_TX_ENQ);
 	return 0;
 }
+#endif
 
 void
 setup_lpm(const int socketid)
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index a4f061537e..6063eb1399 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -135,8 +135,10 @@ static struct rte_eth_conf port_conf = {
 
 uint32_t max_pkt_len;
 
-static struct rte_mempool *pktmbuf_pool[RTE_MAX_ETHPORTS][NB_SOCKETS];
+#ifdef RTE_LIB_EVENTDEV
 static struct rte_mempool *vector_pool[RTE_MAX_ETHPORTS];
+#endif
+static struct rte_mempool *pktmbuf_pool[RTE_MAX_ETHPORTS][NB_SOCKETS];
 static uint8_t lkp_per_socket[NB_SOCKETS];
 
 struct l3fwd_lkp_mode {
@@ -398,8 +400,10 @@ print_usage(const char *prgname)
 		" [--parse-ptype]"
 		" [--per-port-pool]"
 		" [--mode]"
+#ifdef RTE_LIB_EVENTDEV
 		" [--eventq-sched]"
 		" [--event-vector [--event-vector-size SIZE] [--event-vector-tmo NS]]"
+#endif
 		" [-E]"
 		" [-L]\n\n"
 
@@ -422,6 +426,7 @@ print_usage(const char *prgname)
 		"  --per-port-pool: Use separate buffer pool per port\n"
 		"  --mode: Packet transfer mode for I/O, poll or eventdev\n"
 		"          Default mode = poll\n"
+#ifdef RTE_LIB_EVENTDEV
 		"  --eventq-sched: Event queue synchronization method\n"
 		"                  ordered, atomic or parallel.\n"
 		"                  Default: atomic\n"
@@ -432,6 +437,7 @@ print_usage(const char *prgname)
 		"  --event-vector:  Enable event vectorization.\n"
 		"  --event-vector-size: Max vector size if event vectorization is enabled.\n"
 		"  --event-vector-tmo: Max timeout to form vector in nanoseconds if event vectorization is enabled\n"
+#endif
 		"  -E : Enable exact match, legacy flag please use --lookup=em instead\n"
 		"  -L : Enable longest prefix match, legacy flag please use --lookup=lpm instead\n"
 		"  --rule_ipv4=FILE: Specify the ipv4 rules entries file.\n"
@@ -559,14 +565,16 @@ parse_eth_dest(const char *optarg)
 }
 
 static void
-parse_mode(const char *optarg)
+parse_mode(const char *optarg __rte_unused)
 {
+#ifdef RTE_LIB_EVENTDEV
 	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
 
 	if (!strcmp(optarg, "poll"))
 		evt_rsrc->enabled = false;
 	else if (!strcmp(optarg, "eventdev"))
 		evt_rsrc->enabled = true;
+#endif
 }
 
 static void
@@ -601,6 +609,7 @@ parse_queue_size(const char *queue_size_arg, uint16_t *queue_size, int rx)
 	*queue_size = value;
 }
 
+#ifdef RTE_LIB_EVENTDEV
 static void
 parse_eventq_sched(const char *optarg)
 {
@@ -631,6 +640,7 @@ parse_event_eth_rx_queues(const char *eth_rx_queues)
 
 	evt_rsrc->eth_rx_queues = num_eth_rx_queues;
 }
+#endif
 
 static int
 parse_lookup(const char *optarg)
@@ -756,9 +766,11 @@ parse_args(int argc, char **argv)
 	int option_index;
 	char *prgname = argv[0];
 	uint8_t lcore_params = 0;
+#ifdef RTE_LIB_EVENTDEV
 	uint8_t eventq_sched = 0;
 	uint8_t eth_rx_q = 0;
 	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
+#endif
 
 	argvopt = argv;
 
@@ -850,6 +862,7 @@ parse_args(int argc, char **argv)
 			parse_mode(optarg);
 			break;
 
+#ifdef RTE_LIB_EVENTDEV
 		case CMD_LINE_OPT_EVENTQ_SYNC_NUM:
 			parse_eventq_sched(optarg);
 			eventq_sched = 1;
@@ -860,6 +873,20 @@ parse_args(int argc, char **argv)
 			eth_rx_q = 1;
 			break;
 
+		case CMD_LINE_OPT_ENABLE_VECTOR_NUM:
+			printf("event vectorization is enabled\n");
+			evt_rsrc->vector_enabled = 1;
+			break;
+
+		case CMD_LINE_OPT_VECTOR_SIZE_NUM:
+			evt_rsrc->vector_size = strtol(optarg, NULL, 10);
+			break;
+
+		case CMD_LINE_OPT_VECTOR_TMO_NS_NUM:
+			evt_rsrc->vector_tmo_ns = strtoull(optarg, NULL, 10);
+			break;
+#endif
+
 		case CMD_LINE_OPT_LOOKUP_NUM:
 			if (lookup_mode != L3FWD_LOOKUP_DEFAULT) {
 				fprintf(stderr, "Only one lookup mode is allowed at a time!\n");
@@ -875,16 +902,6 @@ parse_args(int argc, char **argv)
 				return -1;
 			break;
 
-		case CMD_LINE_OPT_ENABLE_VECTOR_NUM:
-			printf("event vectorization is enabled\n");
-			evt_rsrc->vector_enabled = 1;
-			break;
-		case CMD_LINE_OPT_VECTOR_SIZE_NUM:
-			evt_rsrc->vector_size = strtol(optarg, NULL, 10);
-			break;
-		case CMD_LINE_OPT_VECTOR_TMO_NS_NUM:
-			evt_rsrc->vector_tmo_ns = strtoull(optarg, NULL, 10);
-			break;
 		case CMD_LINE_OPT_RULE_IPV4_NUM:
 			l3fwd_set_rule_ipv4_name(optarg);
 			break;
@@ -900,6 +917,8 @@ parse_args(int argc, char **argv)
 		}
 	}
 
+	RTE_SET_USED(lcore_params); /* needed if no eventdev block */
+#ifdef RTE_LIB_EVENTDEV
 	if (evt_rsrc->enabled && lcore_params) {
 		fprintf(stderr, "lcore config is not valid when event mode is selected\n");
 		return -1;
@@ -927,6 +946,7 @@ parse_args(int argc, char **argv)
 			"vector timeout set to default (%" PRIu64 " ns)\n",
 			evt_rsrc->vector_tmo_ns);
 	}
+#endif
 
 	/*
 	 * Nothing is selected, pick longest-prefix match
@@ -962,7 +982,9 @@ print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
 int
 init_mem(uint16_t portid, unsigned int nb_mbuf)
 {
+#ifdef RTE_LIB_EVENTDEV
 	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
+#endif
 	struct lcore_conf *qconf;
 	int socketid;
 	unsigned lcore_id;
@@ -1007,6 +1029,7 @@ init_mem(uint16_t portid, unsigned int nb_mbuf)
 			}
 		}
 
+#ifdef RTE_LIB_EVENTDEV
 		if (evt_rsrc->vector_enabled && vector_pool[portid] == NULL) {
 			unsigned int nb_vec;
 
@@ -1025,6 +1048,7 @@ init_mem(uint16_t portid, unsigned int nb_mbuf)
 				printf("Allocated vector pool for port %d\n",
 				       portid);
 		}
+#endif
 
 		qconf = &lcore_conf[lcore_id];
 		qconf->ipv4_lookup_struct =
@@ -1406,6 +1430,7 @@ l3fwd_service_enable(uint32_t service_id)
 	return 0;
 }
 
+#ifdef RTE_LIB_EVENTDEV
 static void
 l3fwd_event_service_setup(void)
 {
@@ -1458,16 +1483,20 @@ l3fwd_event_service_setup(void)
 		l3fwd_service_enable(service_id);
 	}
 }
+#endif
 
 int
 main(int argc, char **argv)
 {
+#ifdef RTE_LIB_EVENTDEV
 	struct l3fwd_event_resources *evt_rsrc;
+	int i;
+#endif
 	struct lcore_conf *qconf;
 	uint16_t queueid, portid;
 	unsigned int lcore_id;
 	uint8_t queue;
-	int i, ret;
+	int ret;
 
 	/* init EAL */
 	ret = rte_eal_init(argc, argv);
@@ -1487,7 +1516,9 @@ main(int argc, char **argv)
 		*(uint64_t *)(val_eth + portid) = dest_eth_addr[portid];
 	}
 
+#ifdef RTE_LIB_EVENTDEV
 	evt_rsrc = l3fwd_get_eventdev_rsrc();
+#endif
 	/* parse application arguments (after the EAL ones) */
 	ret = parse_args(argc, argv);
 	if (ret < 0)
@@ -1499,6 +1530,7 @@ main(int argc, char **argv)
 	/* Add the config file rules */
 	l3fwd_lkp.read_config_files();
 
+#ifdef RTE_LIB_EVENTDEV
 	evt_rsrc->per_port_pool = per_port_pool;
 	evt_rsrc->pkt_pool = pktmbuf_pool;
 	evt_rsrc->vec_pool = vector_pool;
@@ -1514,6 +1546,7 @@ main(int argc, char **argv)
 			l3fwd_lkp.main_loop = evt_rsrc->ops.lpm_event_loop;
 		l3fwd_event_service_setup();
 	} else
+#endif
 		l3fwd_poll_resource_setup();
 
 	/* start ports */
@@ -1562,6 +1595,8 @@ main(int argc, char **argv)
 	ret = 0;
 	/* launch per-lcore init on every lcore */
 	rte_eal_mp_remote_launch(l3fwd_lkp.main_loop, NULL, CALL_MAIN);
+
+#ifdef RTE_LIB_EVENTDEV
 	if (evt_rsrc->enabled) {
 		for (i = 0; i < evt_rsrc->rx_adptr.nb_rx_adptr; i++)
 			rte_event_eth_rx_adapter_stop(
@@ -1589,7 +1624,9 @@ main(int argc, char **argv)
 		rte_event_dev_stop(evt_rsrc->event_d_id);
 		rte_event_dev_close(evt_rsrc->event_d_id);
 
-	} else {
+	} else
+#endif
+	{
 		rte_eal_mp_wait_lcore();
 
 		RTE_ETH_FOREACH_DEV(portid) {
diff --git a/examples/l3fwd/meson.build b/examples/l3fwd/meson.build
index b40244a941..8375b87425 100644
--- a/examples/l3fwd/meson.build
+++ b/examples/l3fwd/meson.build
@@ -7,14 +7,19 @@
 # DPDK instance, use 'make'
 
 allow_experimental_apis = true
-deps += ['acl', 'hash', 'lpm', 'fib', 'eventdev']
+deps += ['acl', 'hash', 'lpm', 'fib']
 sources = files(
         'l3fwd_acl.c',
         'l3fwd_em.c',
-        'l3fwd_event.c',
-        'l3fwd_event_internal_port.c',
-        'l3fwd_event_generic.c',
         'l3fwd_fib.c',
         'l3fwd_lpm.c',
         'main.c',
 )
+if dpdk_conf.has('RTE_LIB_EVENTDEV')
+    sources += files(
+            'l3fwd_event.c',
+            'l3fwd_event_internal_port.c',
+            'l3fwd_event_generic.c',
+    )
+    deps += 'eventdev'
+endif
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 2/8] build: make most device classes optional
  2023-06-23 11:15 ` [PATCH v3 0/8] " Bruce Richardson
  2023-06-23 11:15   ` [PATCH v3 1/8] examples/l3fwd: make eventdev an optional dependency Bruce Richardson
@ 2023-06-23 11:15   ` Bruce Richardson
  2023-06-23 11:15   ` [PATCH v3 3/8] build: make membership library optional Bruce Richardson
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 11:15 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

Apart from ethdev and cryptodev, which have lots of components and tests
which depend on them, we can make the device class libraries optional
without too much work.

This patch marks:
* bbdev,
* compressdev,
* dmadev,
* eventdev,
* mldev,
* rawdev,
* regexdev
optional, and ensures that DPDK - including tests - can be built with
these components disabled.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 33 +++++++++++++++++++++------------
 lib/meson.build      |  7 +++++++
 2 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 3e0a2360a3..379effd10b 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -41,19 +41,12 @@ test_sources = files(
         'test_devargs.c',
         'test_distributor.c',
         'test_distributor_perf.c',
-        'test_dmadev.c',
-        'test_dmadev_api.c',
         'test_eal_flags.c',
         'test_eal_fs.c',
         'test_efd.c',
         'test_efd_perf.c',
         'test_errno.c',
         'test_ethdev_link.c',
-        'test_event_crypto_adapter.c',
-        'test_event_eth_rx_adapter.c',
-        'test_event_ring.c',
-        'test_event_timer_adapter.c',
-        'test_eventdev.c',
         'test_external_mem.c',
         'test_fbarray.c',
         'test_fib.c',
@@ -103,7 +96,6 @@ test_sources = files(
         'test_power_intel_uncore.c',
         'test_prefetch.c',
         'test_rand_perf.c',
-        'test_rawdev.c',
         'test_rcu_qsbr.c',
         'test_rcu_qsbr_perf.c',
         'test_reciprocal_division.c',
@@ -127,7 +119,6 @@ test_sources = files(
         'test_sched.c',
         'test_security.c',
         'test_security_inline_macsec.c',
-        'test_security_inline_proto.c',
         'test_seqlock.c',
         'test_service_cores.c',
         'test_spinlock.c',
@@ -186,7 +177,6 @@ fast_tests = [
         ['eal_fs_autotest', true, true],
         ['errno_autotest', true, true],
         ['ethdev_link_status', true, true],
-        ['event_ring_autotest', true, true],
         ['fib_autotest', true, true],
         ['fib6_autotest', true, true],
         ['func_reentrancy_autotest', false, true],
@@ -232,7 +222,6 @@ fast_tests = [
         ['version_autotest', true, true],
         ['crc_autotest', true, true],
         ['distributor_autotest', false, true],
-        ['eventdev_common_autotest', true, true],
         ['fbarray_autotest', true, true],
         ['hash_readwrite_func_autotest', false, true],
         ['ipsec_autotest', true, true],
@@ -319,7 +308,6 @@ driver_test_names = [
         'cryptodev_sw_snow3g_autotest',
         'cryptodev_sw_zuc_autotest',
         'cryptodev_uadk_autotest',
-        'dmadev_autotest',
 ]
 
 dump_test_names = []
@@ -357,6 +345,25 @@ if dpdk_conf.has('RTE_EVENT_SKELETON')
     test_deps += 'event_skeleton'
 endif
 
+if dpdk_conf.has('RTE_LIB_DMADEV')
+    test_sources += ['test_dmadev.c', 'test_dmadev_api.c']
+    driver_test_names += 'dmadev_autotest'
+endif
+if dpdk_conf.has('RTE_LIB_EVENTDEV')
+    test_sources += [
+        'test_event_eth_rx_adapter.c',
+        'test_event_ring.c',
+        'test_event_timer_adapter.c',
+        'test_eventdev.c',
+    ]
+    fast_tests += [
+        ['event_ring_autotest', true, true],
+        ['eventdev_common_autotest', true, true],
+    ]
+    if dpdk_conf.has('RTE_LIB_CRYPTODEV')
+        test_sources += 'test_event_crypto_adapter.c'
+    endif
+endif
 if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
@@ -408,6 +415,7 @@ if dpdk_conf.has('RTE_LIB_EVENTDEV') and dpdk_conf.has('RTE_NET_RING')
     test_sources += 'test_pmd_ring.c'
     test_sources += 'test_event_eth_tx_adapter.c'
     test_sources += 'sample_packet_forward.c'
+    test_sources += 'test_security_inline_proto.c'
     fast_tests += [['ring_pmd_autotest', true, true]]
     perf_test_names += 'ring_pmd_perf_autotest'
     fast_tests += [['event_eth_tx_adapter_autotest', false, true]]
@@ -430,6 +438,7 @@ if dpdk_conf.has('RTE_NET_NULL')
     fast_tests += [['vdev_autotest', true, true]]
 endif
 if dpdk_conf.has('RTE_RAW_SKELETON')
+    test_sources += 'test_rawdev.c'
     test_deps += 'raw_skeleton'
     fast_tests += [['rawdev_autotest', true, true]]
 endif
diff --git a/lib/meson.build b/lib/meson.build
index fac2f52cad..98a0672a04 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -68,8 +68,12 @@ libraries = [
 ]
 
 optional_libs = [
+        'bbdev',
         'bitratestats',
         'cfgfile',
+        'compressdev',
+        'dmadev',
+        'eventdev',
         'flow_classify',
         'gpudev',
         'graph',
@@ -79,11 +83,14 @@ optional_libs = [
         'jobstats',
         'latencystats',
         'metrics',
+        'mldev',
         'node',
         'pdump',
         'pipeline',
         'port',
         'power',
+        'rawdev',
+        'regexdev',
         'table',
         'vhost',
 ]
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 3/8] build: make membership library optional
  2023-06-23 11:15 ` [PATCH v3 0/8] " Bruce Richardson
  2023-06-23 11:15   ` [PATCH v3 1/8] examples/l3fwd: make eventdev an optional dependency Bruce Richardson
  2023-06-23 11:15   ` [PATCH v3 2/8] build: make most device classes optional Bruce Richardson
@ 2023-06-23 11:15   ` Bruce Richardson
  2023-06-23 11:15   ` [PATCH v3 4/8] build: make bpf " Bruce Richardson
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 11:15 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 9 +++++----
 lib/meson.build      | 1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 379effd10b..9166a1f3d6 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -76,8 +76,6 @@ test_sources = files(
         'test_malloc.c',
         'test_malloc_perf.c',
         'test_mbuf.c',
-        'test_member.c',
-        'test_member_perf.c',
         'test_memcpy.c',
         'test_memcpy_perf.c',
         'test_memory.c',
@@ -227,7 +225,6 @@ fast_tests = [
         ['ipsec_autotest', true, true],
         ['kni_autotest', false, true],
         ['kvargs_autotest', true, true],
-        ['member_autotest', true, true],
         ['power_cpufreq_autotest', false, true],
         ['power_autotest', true, true],
         ['power_kvm_vm_autotest', false, true],
@@ -265,7 +262,6 @@ perf_test_names = [
         'timer_racecond_autotest',
         'efd_autotest',
         'hash_functions_autotest',
-        'member_perf_autotest',
         'efd_perf_autotest',
         'lpm6_perf_autotest',
         'rib6_slow_autotest',
@@ -379,6 +375,11 @@ if dpdk_conf.has('RTE_LIB_METRICS')
     test_sources += ['test_metrics.c']
     fast_tests += [['metrics_autotest', true, true]]
 endif
+if dpdk_conf.has('RTE_LIB_MEMBER')
+    test_sources += ['test_member.c', 'test_member_perf.c']
+    fast_tests += [['member_autotest', true, true]]
+    perf_test_names += 'member_perf_autotest'
+endif
 if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY')
     test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c']
     fast_tests += [['telemetry_json_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 98a0672a04..de7069a078 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -82,6 +82,7 @@ optional_libs = [
         'kni',
         'jobstats',
         'latencystats',
+        'member',
         'metrics',
         'mldev',
         'node',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 4/8] build: make bpf library optional
  2023-06-23 11:15 ` [PATCH v3 0/8] " Bruce Richardson
                     ` (2 preceding siblings ...)
  2023-06-23 11:15   ` [PATCH v3 3/8] build: make membership library optional Bruce Richardson
@ 2023-06-23 11:15   ` Bruce Richardson
  2023-06-23 11:15   ` [PATCH v3 5/8] build: make efd " Bruce Richardson
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 11:15 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 10 +++++++---
 lib/meson.build      |  1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 9166a1f3d6..4e86e886a5 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -15,7 +15,6 @@ test_sources = files(
         'test_barrier.c',
         'test_bitops.c',
         'test_bitmap.c',
-        'test_bpf.c',
         'test_byteorder.c',
         'test_cksum.c',
         'test_cksum_perf.c',
@@ -150,8 +149,6 @@ fast_tests = [
         ['acl_autotest', true, true],
         ['atomic_autotest', false, true],
         ['bitmap_autotest', true, true],
-        ['bpf_autotest', true, true],
-        ['bpf_convert_autotest', true, true],
         ['bitops_autotest', true, true],
         ['byteorder_autotest', true, true],
         ['cksum_autotest', true, true],
@@ -341,6 +338,13 @@ if dpdk_conf.has('RTE_EVENT_SKELETON')
     test_deps += 'event_skeleton'
 endif
 
+if dpdk_conf.has('RTE_LIB_BPF')
+    test_sources += 'test_bpf.c'
+    fast_tests += [
+        ['bpf_autotest', true, true],
+        ['bpf_convert_autotest', true, true],
+    ]
+endif
 if dpdk_conf.has('RTE_LIB_DMADEV')
     test_sources += ['test_dmadev.c', 'test_dmadev_api.c']
     driver_test_names += 'dmadev_autotest'
diff --git a/lib/meson.build b/lib/meson.build
index de7069a078..47c18ca3b0 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -70,6 +70,7 @@ libraries = [
 optional_libs = [
         'bbdev',
         'bitratestats',
+        'bpf',
         'cfgfile',
         'compressdev',
         'dmadev',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 5/8] build: make efd library optional
  2023-06-23 11:15 ` [PATCH v3 0/8] " Bruce Richardson
                     ` (3 preceding siblings ...)
  2023-06-23 11:15   ` [PATCH v3 4/8] build: make bpf " Bruce Richardson
@ 2023-06-23 11:15   ` Bruce Richardson
  2023-06-23 11:15   ` [PATCH v3 6/8] build: make distributor " Bruce Richardson
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 11:15 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 8 ++++----
 lib/meson.build      | 1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 4e86e886a5..492dd719de 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -42,8 +42,6 @@ test_sources = files(
         'test_distributor_perf.c',
         'test_eal_flags.c',
         'test_eal_fs.c',
-        'test_efd.c',
-        'test_efd_perf.c',
         'test_errno.c',
         'test_ethdev_link.c',
         'test_external_mem.c',
@@ -257,9 +255,7 @@ perf_test_names = [
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
-        'efd_autotest',
         'hash_functions_autotest',
-        'efd_perf_autotest',
         'lpm6_perf_autotest',
         'rib6_slow_autotest',
         'fib6_slow_autotest',
@@ -368,6 +364,10 @@ if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
 endif
+if dpdk_conf.has('RTE_LIB_EFD')
+    test_sources += ['test_efd.c', 'test_efd_perf.c']
+    perf_test_names += ['efd_autotest', 'efd_perf_autotest']
+endif
 if dpdk_conf.has('RTE_LIB_GRAPH')
     test_sources += 'test_graph.c'
     fast_tests += [['graph_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 47c18ca3b0..07cfdef614 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -74,6 +74,7 @@ optional_libs = [
         'cfgfile',
         'compressdev',
         'dmadev',
+        'efd',
         'eventdev',
         'flow_classify',
         'gpudev',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 6/8] build: make distributor library optional
  2023-06-23 11:15 ` [PATCH v3 0/8] " Bruce Richardson
                     ` (4 preceding siblings ...)
  2023-06-23 11:15   ` [PATCH v3 5/8] build: make efd " Bruce Richardson
@ 2023-06-23 11:15   ` Bruce Richardson
  2023-06-23 11:15   ` [PATCH v3 7/8] build: make fragmentation " Bruce Richardson
  2023-06-23 11:15   ` [PATCH v3 8/8] build: make reorder " Bruce Richardson
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 11:15 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 9 +++++----
 lib/meson.build      | 1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 492dd719de..ff90b9897a 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -38,8 +38,6 @@ test_sources = files(
         'test_cycles.c',
         'test_debug.c',
         'test_devargs.c',
-        'test_distributor.c',
-        'test_distributor_perf.c',
         'test_eal_flags.c',
         'test_eal_fs.c',
         'test_errno.c',
@@ -214,7 +212,6 @@ fast_tests = [
         ['user_delay_us', true, true],
         ['version_autotest', true, true],
         ['crc_autotest', true, true],
-        ['distributor_autotest', false, true],
         ['fbarray_autotest', true, true],
         ['hash_readwrite_func_autotest', false, true],
         ['ipsec_autotest', true, true],
@@ -263,7 +260,6 @@ perf_test_names = [
         'rcu_qsbr_perf_autotest',
         'red_perf',
         'pie_perf',
-        'distributor_perf_autotest',
         'pmd_perf_autotest',
         'service_perf_autotest',
         'stack_perf_autotest',
@@ -364,6 +360,11 @@ if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
 endif
+if dpdk_conf.has('RTE_LIB_DISTRIBUTOR')
+    test_sources += ['test_distributor.c', 'test_distributor_perf.c']
+    fast_tests += [['distributor_autotest', false, true]]
+    perf_test_names += 'distributor_perf_autotest'
+endif
 if dpdk_conf.has('RTE_LIB_EFD')
     test_sources += ['test_efd.c', 'test_efd_perf.c']
     perf_test_names += ['efd_autotest', 'efd_perf_autotest']
diff --git a/lib/meson.build b/lib/meson.build
index 07cfdef614..757c1a63e9 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -73,6 +73,7 @@ optional_libs = [
         'bpf',
         'cfgfile',
         'compressdev',
+        'distributor',
         'dmadev',
         'efd',
         'eventdev',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 7/8] build: make fragmentation library optional
  2023-06-23 11:15 ` [PATCH v3 0/8] " Bruce Richardson
                     ` (5 preceding siblings ...)
  2023-06-23 11:15   ` [PATCH v3 6/8] build: make distributor " Bruce Richardson
@ 2023-06-23 11:15   ` Bruce Richardson
  2023-06-23 11:15   ` [PATCH v3 8/8] build: make reorder " Bruce Richardson
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 11:15 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 6 ++++--
 lib/meson.build      | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index ff90b9897a..51267d969b 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -56,7 +56,6 @@ test_sources = files(
         'test_hash_perf.c',
         'test_hash_readwrite_lf_perf.c',
         'test_interrupts.c',
-        'test_ipfrag.c',
         'test_ipsec.c',
         'test_ipsec_sad.c',
         'test_ipsec_perf.c',
@@ -173,7 +172,6 @@ fast_tests = [
         ['func_reentrancy_autotest', false, true],
         ['hash_autotest', true, true],
         ['interrupt_autotest', true, true],
-        ['ipfrag_autotest', false, true],
         ['lcores_autotest', true, true],
         ['logs_autotest', true, true],
         ['lpm_autotest', true, true],
@@ -376,6 +374,10 @@ if dpdk_conf.has('RTE_LIB_GRAPH')
     test_sources += 'test_graph_perf.c'
     perf_test_names += 'graph_perf_autotest'
 endif
+if dpdk_conf.has('RTE_LIB_IP_FRAG')
+    test_sources += 'test_ipfrag.c'
+    fast_tests += [['ipfrag_autotest', false, true]]
+endif
 if dpdk_conf.has('RTE_LIB_METRICS')
     test_sources += ['test_metrics.c']
     fast_tests += [['metrics_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 757c1a63e9..ea351b236a 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -83,6 +83,7 @@ optional_libs = [
         'gro',
         'gso',
         'kni',
+        'ip_frag',
         'jobstats',
         'latencystats',
         'member',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 8/8] build: make reorder library optional
  2023-06-23 11:15 ` [PATCH v3 0/8] " Bruce Richardson
                     ` (6 preceding siblings ...)
  2023-06-23 11:15   ` [PATCH v3 7/8] build: make fragmentation " Bruce Richardson
@ 2023-06-23 11:15   ` Bruce Richardson
  7 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 11:15 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 6 ++++--
 lib/meson.build      | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 51267d969b..cd8bcee4a4 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -94,7 +94,6 @@ test_sources = files(
         'test_reciprocal_division_perf.c',
         'test_red.c',
         'test_pie.c',
-        'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
         'test_ring.c',
@@ -219,7 +218,6 @@ fast_tests = [
         ['power_autotest', true, true],
         ['power_kvm_vm_autotest', false, true],
         ['power_intel_uncore_autotest', true, true],
-        ['reorder_autotest', true, true],
         ['service_autotest', true, true],
         ['thash_autotest', true, true],
         ['threads_autotest', true, true],
@@ -387,6 +385,10 @@ if dpdk_conf.has('RTE_LIB_MEMBER')
     fast_tests += [['member_autotest', true, true]]
     perf_test_names += 'member_perf_autotest'
 endif
+if dpdk_conf.has('RTE_LIB_REORDER')
+    test_sources += 'test_reorder.c'
+    fast_tests += [['reorder_autotest', true, true]]
+endif
 if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY')
     test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c']
     fast_tests += [['telemetry_json_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index ea351b236a..b46f4e51ff 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -96,6 +96,7 @@ optional_libs = [
         'power',
         'rawdev',
         'regexdev',
+        'reorder',
         'table',
         'vhost',
 ]
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 1/8] examples/l3fwd: make eventdev an optional dependency
  2023-06-23 11:15   ` [PATCH v3 1/8] examples/l3fwd: make eventdev an optional dependency Bruce Richardson
@ 2023-06-23 13:25     ` Bruce Richardson
  0 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 13:25 UTC (permalink / raw)
  To: dev

On Fri, Jun 23, 2023 at 12:15:01PM +0100, Bruce Richardson wrote:
> With l3fwd being a very commonly used example app, and built as part of
> our CI tests, we need to ensure it's buildable with just about all
> supported DPDK configurations.  To enable l3fwd application to be built
> when the eventdev library is disabled, we need to compile in the
> eventdev support conditionally.  Thankfully, the eventdev support is
> pretty self-contained, with only the main.c file having more than a
> couple of ifdefs.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  examples/l3fwd/l3fwd_em.c  |  2 ++
>  examples/l3fwd/l3fwd_fib.c |  2 ++
>  examples/l3fwd/l3fwd_lpm.c |  2 ++
>  examples/l3fwd/main.c      | 65 ++++++++++++++++++++++++++++++--------
>  examples/l3fwd/meson.build | 13 +++++---
>  5 files changed, 66 insertions(+), 18 deletions(-)
> 
Apologies, it appears I still have issues in the case where l3fwd is
compiled standalone after a DPDK install, rather than as part of the build.
New revision of the set will be forthcoming....

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v4 0/9] expand list of optional libraries
  2023-06-22 13:48 [PATCH 0/7] expand list of optional libraries Bruce Richardson
                   ` (9 preceding siblings ...)
  2023-06-23 11:15 ` [PATCH v3 0/8] " Bruce Richardson
@ 2023-06-23 15:06 ` Bruce Richardson
  2023-06-23 15:07   ` [PATCH v4 1/9] examples/l3fwd: make eventdev an optional dependency Bruce Richardson
                     ` (10 more replies)
  10 siblings, 11 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 15:06 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

DPDK still has many libraries which cannot be disabled as part of a
build. With the ongoing work to make it easier to only build a subset
of the libraries in DPDK, we can also work to expand the list of
libraries which can be enabled/disabled as desired.

This patch addresses a number of the "low-hanging fruit" libraries,
where only the unit test builds need minor changes to support
making the library optional. The rest of the build system is already
well set up for selective disabling of libraries.

For better support of enabling components, especially those more
integrated into DPDK unit tests, rework of the test meson.build file
is likely needed. For example, it could probably be better rewritten
to use a dictionary of files and the dependencies of each file, and
the unit test commands each provides. However, such rework is a
significant effort, and outside the scope of this patchset.

V4:
- fix more issues with disabling eventdev:
  * ensure dlb2 driver doesn't directly reference the static lib
  * ensure l3fwd can be built using makefiles without eventdev
  * remove dependency on eventdev for unit tests like pdump that
    don't actually need it.

V3:
- rebase on top of main.
- make eventdev an optional dependency of l3fwd
- Fix incorrect define reference - RTE_LIB_IP_FRAG vs RTE_IP_FRAG

V2: fix checkpatch issues, since checkpatch doesn't like empty commit
    messages (even if the title is pretty self-explanatory!)

Bruce Richardson (9):
  examples/l3fwd: make eventdev an optional dependency
  event/dlb2: skip configuration if no eventdev lib
  build: make most device classes optional
  build: make membership library optional
  build: make bpf library optional
  build: make efd library optional
  build: make distributor library optional
  build: make fragmentation library optional
  build: make reorder library optional

 app/test/meson.build                       | 89 +++++++++++++---------
 drivers/event/dlb2/meson.build             |  2 +-
 examples/l3fwd/l3fwd_em.c                  |  2 +
 examples/l3fwd/l3fwd_em_hlm.h              |  2 +
 examples/l3fwd/l3fwd_event.c               |  2 +
 examples/l3fwd/l3fwd_event.h               |  7 +-
 examples/l3fwd/l3fwd_event_generic.c       |  2 +
 examples/l3fwd/l3fwd_event_internal_port.c |  2 +
 examples/l3fwd/l3fwd_fib.c                 |  2 +
 examples/l3fwd/l3fwd_lpm.c                 |  2 +
 examples/l3fwd/main.c                      | 65 ++++++++++++----
 examples/l3fwd/meson.build                 |  5 +-
 lib/meson.build                            | 13 ++++
 13 files changed, 143 insertions(+), 52 deletions(-)

--
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v4 1/9] examples/l3fwd: make eventdev an optional dependency
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
@ 2023-06-23 15:07   ` Bruce Richardson
  2023-06-23 15:07   ` [PATCH v4 2/9] event/dlb2: skip configuration if no eventdev lib Bruce Richardson
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 15:07 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Jerin Jacob

With l3fwd being a very commonly used example app, and built as part of
our CI tests, we need to ensure it's buildable with just about all
supported DPDK configurations.  To enable l3fwd application to be built
when the eventdev library is disabled, we need to compile in the
eventdev support conditionally.  Thankfully, the eventdev support is
pretty self-contained, with only the main.c file having more than a
couple of ifdefs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/l3fwd/l3fwd_em.c                  |  2 +
 examples/l3fwd/l3fwd_em_hlm.h              |  2 +
 examples/l3fwd/l3fwd_event.c               |  2 +
 examples/l3fwd/l3fwd_event.h               |  7 ++-
 examples/l3fwd/l3fwd_event_generic.c       |  2 +
 examples/l3fwd/l3fwd_event_internal_port.c |  2 +
 examples/l3fwd/l3fwd_fib.c                 |  2 +
 examples/l3fwd/l3fwd_lpm.c                 |  2 +
 examples/l3fwd/main.c                      | 65 +++++++++++++++++-----
 examples/l3fwd/meson.build                 |  5 +-
 10 files changed, 74 insertions(+), 17 deletions(-)

diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
index 476ac0c54f..40e102b38a 100644
--- a/examples/l3fwd/l3fwd_em.c
+++ b/examples/l3fwd/l3fwd_em.c
@@ -663,6 +663,7 @@ em_main_loop(__rte_unused void *dummy)
 	return 0;
 }
 
+#ifdef RTE_LIB_EVENTDEV
 static __rte_always_inline void
 em_event_loop_single(struct l3fwd_event_resources *evt_rsrc,
 		const uint8_t flags)
@@ -959,6 +960,7 @@ em_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy)
 	em_event_loop_vector(evt_rsrc, L3FWD_EVENT_TX_ENQ);
 	return 0;
 }
+#endif
 
 /* Initialize exact match (hash) parameters. 8< */
 void
diff --git a/examples/l3fwd/l3fwd_em_hlm.h b/examples/l3fwd/l3fwd_em_hlm.h
index 2e11eefad7..31cda9ddc1 100644
--- a/examples/l3fwd/l3fwd_em_hlm.h
+++ b/examples/l3fwd/l3fwd_em_hlm.h
@@ -255,6 +255,7 @@ l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, uint16_t portid,
 	send_packets_multi(qconf, pkts_burst, dst_port, nb_rx);
 }
 
+#ifdef RTE_LIB_EVENTDEV
 /*
  * Buffer optimized handling of events, invoked
  * from main_loop.
@@ -347,5 +348,6 @@ l3fwd_em_process_event_vector(struct rte_event_vector *vec,
 
 	process_event_vector(vec, dst_port);
 }
+#endif /* RTE_LIB_EVENTDEV */
 
 #endif /* __L3FWD_EM_HLM_H__ */
diff --git a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c
index 32906ab08d..d72a4138cc 100644
--- a/examples/l3fwd/l3fwd_event.c
+++ b/examples/l3fwd/l3fwd_event.c
@@ -2,6 +2,7 @@
  * Copyright(C) 2019 Marvell International Ltd.
  */
 
+#ifdef RTE_LIB_EVENTDEV
 #include <stdbool.h>
 #include <getopt.h>
 
@@ -341,3 +342,4 @@ l3fwd_event_worker_cleanup(uint8_t event_d_id, uint8_t event_p_id,
 	rte_event_port_quiesce(event_d_id, event_p_id, l3fwd_event_port_flush,
 			       NULL);
 }
+#endif /* #ifdef RTE_LIB_EVENTDEV */
diff --git a/examples/l3fwd/l3fwd_event.h b/examples/l3fwd/l3fwd_event.h
index e21817c36b..1fd6fe4a78 100644
--- a/examples/l3fwd/l3fwd_event.h
+++ b/examples/l3fwd/l3fwd_event.h
@@ -6,11 +6,13 @@
 #define __L3FWD_EVENTDEV_H__
 
 #include <rte_common.h>
+#include <rte_service.h>
+#include <rte_spinlock.h>
+
+#ifdef RTE_LIB_EVENTDEV
 #include <rte_eventdev.h>
 #include <rte_event_eth_rx_adapter.h>
 #include <rte_event_eth_tx_adapter.h>
-#include <rte_service.h>
-#include <rte_spinlock.h>
 
 #include "l3fwd.h"
 
@@ -164,4 +166,5 @@ void l3fwd_event_worker_cleanup(uint8_t event_d_id, uint8_t event_p_id,
 				struct rte_event events[], uint16_t nb_enq,
 				uint16_t nb_deq, uint8_t is_vector);
 
+#endif /* ifdef RTE_LIB_EVENTDEV */
 #endif /* __L3FWD_EVENTDEV_H__ */
diff --git a/examples/l3fwd/l3fwd_event_generic.c b/examples/l3fwd/l3fwd_event_generic.c
index c80573fc58..ddb6e5c38d 100644
--- a/examples/l3fwd/l3fwd_event_generic.c
+++ b/examples/l3fwd/l3fwd_event_generic.c
@@ -2,6 +2,7 @@
  * Copyright(C) 2019 Marvell International Ltd.
  */
 
+#ifdef RTE_LIB_EVENTDEV
 #include <stdbool.h>
 
 #include "l3fwd.h"
@@ -309,3 +310,4 @@ l3fwd_event_set_generic_ops(struct l3fwd_event_setup_ops *ops)
 	ops->event_port_setup = l3fwd_event_port_setup_generic;
 	ops->adapter_setup = l3fwd_rx_tx_adapter_setup_generic;
 }
+#endif /* RTE_LIB_EVENTDEV */
diff --git a/examples/l3fwd/l3fwd_event_internal_port.c b/examples/l3fwd/l3fwd_event_internal_port.c
index 32cf657148..cb49a8b9fa 100644
--- a/examples/l3fwd/l3fwd_event_internal_port.c
+++ b/examples/l3fwd/l3fwd_event_internal_port.c
@@ -2,6 +2,7 @@
  * Copyright(C) 2019 Marvell International Ltd.
  */
 
+#ifdef RTE_LIB_EVENTDEV
 #include <stdbool.h>
 
 #include "l3fwd.h"
@@ -311,3 +312,4 @@ l3fwd_event_set_internal_port_ops(struct l3fwd_event_setup_ops *ops)
 	ops->event_port_setup = l3fwd_event_port_setup_internal_port;
 	ops->adapter_setup = l3fwd_rx_tx_adapter_setup_internal_port;
 }
+#endif /* RTE_LIB_EVENTDEV */
diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c
index edc0dd69b9..8760016545 100644
--- a/examples/l3fwd/l3fwd_fib.c
+++ b/examples/l3fwd/l3fwd_fib.c
@@ -253,6 +253,7 @@ fib_main_loop(__rte_unused void *dummy)
 	return 0;
 }
 
+#ifdef RTE_LIB_EVENTDEV
 /* One eventdev loop for single and burst using fib. */
 static __rte_always_inline void
 fib_event_loop(struct l3fwd_event_resources *evt_rsrc,
@@ -635,6 +636,7 @@ fib_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy)
 	fib_event_loop_vector(evt_rsrc, L3FWD_EVENT_TX_ENQ);
 	return 0;
 }
+#endif
 
 /* Function to setup fib. 8< */
 void
diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
index 4ac1925c84..a484a33089 100644
--- a/examples/l3fwd/l3fwd_lpm.c
+++ b/examples/l3fwd/l3fwd_lpm.c
@@ -226,6 +226,7 @@ lpm_main_loop(__rte_unused void *dummy)
 	return 0;
 }
 
+#ifdef RTE_LIB_EVENTDEV
 static __rte_always_inline uint16_t
 lpm_process_event_pkt(const struct lcore_conf *lconf, struct rte_mbuf *mbuf)
 {
@@ -554,6 +555,7 @@ lpm_event_main_loop_tx_q_burst_vector(__rte_unused void *dummy)
 	lpm_event_loop_vector(evt_rsrc, L3FWD_EVENT_TX_ENQ);
 	return 0;
 }
+#endif
 
 void
 setup_lpm(const int socketid)
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index a4f061537e..6063eb1399 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -135,8 +135,10 @@ static struct rte_eth_conf port_conf = {
 
 uint32_t max_pkt_len;
 
-static struct rte_mempool *pktmbuf_pool[RTE_MAX_ETHPORTS][NB_SOCKETS];
+#ifdef RTE_LIB_EVENTDEV
 static struct rte_mempool *vector_pool[RTE_MAX_ETHPORTS];
+#endif
+static struct rte_mempool *pktmbuf_pool[RTE_MAX_ETHPORTS][NB_SOCKETS];
 static uint8_t lkp_per_socket[NB_SOCKETS];
 
 struct l3fwd_lkp_mode {
@@ -398,8 +400,10 @@ print_usage(const char *prgname)
 		" [--parse-ptype]"
 		" [--per-port-pool]"
 		" [--mode]"
+#ifdef RTE_LIB_EVENTDEV
 		" [--eventq-sched]"
 		" [--event-vector [--event-vector-size SIZE] [--event-vector-tmo NS]]"
+#endif
 		" [-E]"
 		" [-L]\n\n"
 
@@ -422,6 +426,7 @@ print_usage(const char *prgname)
 		"  --per-port-pool: Use separate buffer pool per port\n"
 		"  --mode: Packet transfer mode for I/O, poll or eventdev\n"
 		"          Default mode = poll\n"
+#ifdef RTE_LIB_EVENTDEV
 		"  --eventq-sched: Event queue synchronization method\n"
 		"                  ordered, atomic or parallel.\n"
 		"                  Default: atomic\n"
@@ -432,6 +437,7 @@ print_usage(const char *prgname)
 		"  --event-vector:  Enable event vectorization.\n"
 		"  --event-vector-size: Max vector size if event vectorization is enabled.\n"
 		"  --event-vector-tmo: Max timeout to form vector in nanoseconds if event vectorization is enabled\n"
+#endif
 		"  -E : Enable exact match, legacy flag please use --lookup=em instead\n"
 		"  -L : Enable longest prefix match, legacy flag please use --lookup=lpm instead\n"
 		"  --rule_ipv4=FILE: Specify the ipv4 rules entries file.\n"
@@ -559,14 +565,16 @@ parse_eth_dest(const char *optarg)
 }
 
 static void
-parse_mode(const char *optarg)
+parse_mode(const char *optarg __rte_unused)
 {
+#ifdef RTE_LIB_EVENTDEV
 	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
 
 	if (!strcmp(optarg, "poll"))
 		evt_rsrc->enabled = false;
 	else if (!strcmp(optarg, "eventdev"))
 		evt_rsrc->enabled = true;
+#endif
 }
 
 static void
@@ -601,6 +609,7 @@ parse_queue_size(const char *queue_size_arg, uint16_t *queue_size, int rx)
 	*queue_size = value;
 }
 
+#ifdef RTE_LIB_EVENTDEV
 static void
 parse_eventq_sched(const char *optarg)
 {
@@ -631,6 +640,7 @@ parse_event_eth_rx_queues(const char *eth_rx_queues)
 
 	evt_rsrc->eth_rx_queues = num_eth_rx_queues;
 }
+#endif
 
 static int
 parse_lookup(const char *optarg)
@@ -756,9 +766,11 @@ parse_args(int argc, char **argv)
 	int option_index;
 	char *prgname = argv[0];
 	uint8_t lcore_params = 0;
+#ifdef RTE_LIB_EVENTDEV
 	uint8_t eventq_sched = 0;
 	uint8_t eth_rx_q = 0;
 	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
+#endif
 
 	argvopt = argv;
 
@@ -850,6 +862,7 @@ parse_args(int argc, char **argv)
 			parse_mode(optarg);
 			break;
 
+#ifdef RTE_LIB_EVENTDEV
 		case CMD_LINE_OPT_EVENTQ_SYNC_NUM:
 			parse_eventq_sched(optarg);
 			eventq_sched = 1;
@@ -860,6 +873,20 @@ parse_args(int argc, char **argv)
 			eth_rx_q = 1;
 			break;
 
+		case CMD_LINE_OPT_ENABLE_VECTOR_NUM:
+			printf("event vectorization is enabled\n");
+			evt_rsrc->vector_enabled = 1;
+			break;
+
+		case CMD_LINE_OPT_VECTOR_SIZE_NUM:
+			evt_rsrc->vector_size = strtol(optarg, NULL, 10);
+			break;
+
+		case CMD_LINE_OPT_VECTOR_TMO_NS_NUM:
+			evt_rsrc->vector_tmo_ns = strtoull(optarg, NULL, 10);
+			break;
+#endif
+
 		case CMD_LINE_OPT_LOOKUP_NUM:
 			if (lookup_mode != L3FWD_LOOKUP_DEFAULT) {
 				fprintf(stderr, "Only one lookup mode is allowed at a time!\n");
@@ -875,16 +902,6 @@ parse_args(int argc, char **argv)
 				return -1;
 			break;
 
-		case CMD_LINE_OPT_ENABLE_VECTOR_NUM:
-			printf("event vectorization is enabled\n");
-			evt_rsrc->vector_enabled = 1;
-			break;
-		case CMD_LINE_OPT_VECTOR_SIZE_NUM:
-			evt_rsrc->vector_size = strtol(optarg, NULL, 10);
-			break;
-		case CMD_LINE_OPT_VECTOR_TMO_NS_NUM:
-			evt_rsrc->vector_tmo_ns = strtoull(optarg, NULL, 10);
-			break;
 		case CMD_LINE_OPT_RULE_IPV4_NUM:
 			l3fwd_set_rule_ipv4_name(optarg);
 			break;
@@ -900,6 +917,8 @@ parse_args(int argc, char **argv)
 		}
 	}
 
+	RTE_SET_USED(lcore_params); /* needed if no eventdev block */
+#ifdef RTE_LIB_EVENTDEV
 	if (evt_rsrc->enabled && lcore_params) {
 		fprintf(stderr, "lcore config is not valid when event mode is selected\n");
 		return -1;
@@ -927,6 +946,7 @@ parse_args(int argc, char **argv)
 			"vector timeout set to default (%" PRIu64 " ns)\n",
 			evt_rsrc->vector_tmo_ns);
 	}
+#endif
 
 	/*
 	 * Nothing is selected, pick longest-prefix match
@@ -962,7 +982,9 @@ print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
 int
 init_mem(uint16_t portid, unsigned int nb_mbuf)
 {
+#ifdef RTE_LIB_EVENTDEV
 	struct l3fwd_event_resources *evt_rsrc = l3fwd_get_eventdev_rsrc();
+#endif
 	struct lcore_conf *qconf;
 	int socketid;
 	unsigned lcore_id;
@@ -1007,6 +1029,7 @@ init_mem(uint16_t portid, unsigned int nb_mbuf)
 			}
 		}
 
+#ifdef RTE_LIB_EVENTDEV
 		if (evt_rsrc->vector_enabled && vector_pool[portid] == NULL) {
 			unsigned int nb_vec;
 
@@ -1025,6 +1048,7 @@ init_mem(uint16_t portid, unsigned int nb_mbuf)
 				printf("Allocated vector pool for port %d\n",
 				       portid);
 		}
+#endif
 
 		qconf = &lcore_conf[lcore_id];
 		qconf->ipv4_lookup_struct =
@@ -1406,6 +1430,7 @@ l3fwd_service_enable(uint32_t service_id)
 	return 0;
 }
 
+#ifdef RTE_LIB_EVENTDEV
 static void
 l3fwd_event_service_setup(void)
 {
@@ -1458,16 +1483,20 @@ l3fwd_event_service_setup(void)
 		l3fwd_service_enable(service_id);
 	}
 }
+#endif
 
 int
 main(int argc, char **argv)
 {
+#ifdef RTE_LIB_EVENTDEV
 	struct l3fwd_event_resources *evt_rsrc;
+	int i;
+#endif
 	struct lcore_conf *qconf;
 	uint16_t queueid, portid;
 	unsigned int lcore_id;
 	uint8_t queue;
-	int i, ret;
+	int ret;
 
 	/* init EAL */
 	ret = rte_eal_init(argc, argv);
@@ -1487,7 +1516,9 @@ main(int argc, char **argv)
 		*(uint64_t *)(val_eth + portid) = dest_eth_addr[portid];
 	}
 
+#ifdef RTE_LIB_EVENTDEV
 	evt_rsrc = l3fwd_get_eventdev_rsrc();
+#endif
 	/* parse application arguments (after the EAL ones) */
 	ret = parse_args(argc, argv);
 	if (ret < 0)
@@ -1499,6 +1530,7 @@ main(int argc, char **argv)
 	/* Add the config file rules */
 	l3fwd_lkp.read_config_files();
 
+#ifdef RTE_LIB_EVENTDEV
 	evt_rsrc->per_port_pool = per_port_pool;
 	evt_rsrc->pkt_pool = pktmbuf_pool;
 	evt_rsrc->vec_pool = vector_pool;
@@ -1514,6 +1546,7 @@ main(int argc, char **argv)
 			l3fwd_lkp.main_loop = evt_rsrc->ops.lpm_event_loop;
 		l3fwd_event_service_setup();
 	} else
+#endif
 		l3fwd_poll_resource_setup();
 
 	/* start ports */
@@ -1562,6 +1595,8 @@ main(int argc, char **argv)
 	ret = 0;
 	/* launch per-lcore init on every lcore */
 	rte_eal_mp_remote_launch(l3fwd_lkp.main_loop, NULL, CALL_MAIN);
+
+#ifdef RTE_LIB_EVENTDEV
 	if (evt_rsrc->enabled) {
 		for (i = 0; i < evt_rsrc->rx_adptr.nb_rx_adptr; i++)
 			rte_event_eth_rx_adapter_stop(
@@ -1589,7 +1624,9 @@ main(int argc, char **argv)
 		rte_event_dev_stop(evt_rsrc->event_d_id);
 		rte_event_dev_close(evt_rsrc->event_d_id);
 
-	} else {
+	} else
+#endif
+	{
 		rte_eal_mp_wait_lcore();
 
 		RTE_ETH_FOREACH_DEV(portid) {
diff --git a/examples/l3fwd/meson.build b/examples/l3fwd/meson.build
index b40244a941..c25de77bba 100644
--- a/examples/l3fwd/meson.build
+++ b/examples/l3fwd/meson.build
@@ -7,7 +7,7 @@
 # DPDK instance, use 'make'
 
 allow_experimental_apis = true
-deps += ['acl', 'hash', 'lpm', 'fib', 'eventdev']
+deps += ['acl', 'hash', 'lpm', 'fib']
 sources = files(
         'l3fwd_acl.c',
         'l3fwd_em.c',
@@ -18,3 +18,6 @@ sources = files(
         'l3fwd_lpm.c',
         'main.c',
 )
+if dpdk_conf.has('RTE_LIB_EVENTDEV')
+    deps += 'eventdev'
+endif
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v4 2/9] event/dlb2: skip configuration if no eventdev lib
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
  2023-06-23 15:07   ` [PATCH v4 1/9] examples/l3fwd: make eventdev an optional dependency Bruce Richardson
@ 2023-06-23 15:07   ` Bruce Richardson
  2023-06-28 10:19     ` David Marchand
  2023-06-23 15:07   ` [PATCH v4 3/9] build: make most device classes optional Bruce Richardson
                     ` (8 subsequent siblings)
  10 siblings, 1 reply; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 15:07 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Timothy McDaniel

While the build system will skip building most libs and drivers when a
dependency is missing for a component, for DLB2 driver, the
"static_rte_eventdev" object is referenced inside the meson.build file
itself, which will cause crashes if it doesn't exist i.e. if eventdev is
disabled. Prevent this issue by skipping processing the file if no
eventdev. [The build system will still report missing dependency, as the
dependency is set by default for all eventdev drivers]

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/event/dlb2/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/event/dlb2/meson.build b/drivers/event/dlb2/meson.build
index 515d1795fe..8cede61593 100644
--- a/drivers/event/dlb2/meson.build
+++ b/drivers/event/dlb2/meson.build
@@ -7,7 +7,7 @@ if not is_linux or not dpdk_conf.has('RTE_ARCH_X86_64')
         subdir_done()
 endif
 
-if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
+if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0 or not dpdk_conf.has('RTE_LIB_EVENTDEV')
     subdir_done()
 endif
 
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v4 3/9] build: make most device classes optional
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
  2023-06-23 15:07   ` [PATCH v4 1/9] examples/l3fwd: make eventdev an optional dependency Bruce Richardson
  2023-06-23 15:07   ` [PATCH v4 2/9] event/dlb2: skip configuration if no eventdev lib Bruce Richardson
@ 2023-06-23 15:07   ` Bruce Richardson
  2023-06-23 15:07   ` [PATCH v4 4/9] build: make membership library optional Bruce Richardson
                     ` (7 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 15:07 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

Apart from ethdev and cryptodev, which have lots of components and tests
which depend on them, we can make the device class libraries optional
without too much work.

This patch marks:
* bbdev,
* compressdev,
* dmadev,
* eventdev,
* mldev,
* rawdev,
* regexdev
optional, and ensures that DPDK - including tests - can be built with
these components disabled.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 41 ++++++++++++++++++++++++++---------------
 lib/meson.build      |  7 +++++++
 2 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 3e0a2360a3..ad7be379b0 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -41,19 +41,12 @@ test_sources = files(
         'test_devargs.c',
         'test_distributor.c',
         'test_distributor_perf.c',
-        'test_dmadev.c',
-        'test_dmadev_api.c',
         'test_eal_flags.c',
         'test_eal_fs.c',
         'test_efd.c',
         'test_efd_perf.c',
         'test_errno.c',
         'test_ethdev_link.c',
-        'test_event_crypto_adapter.c',
-        'test_event_eth_rx_adapter.c',
-        'test_event_ring.c',
-        'test_event_timer_adapter.c',
-        'test_eventdev.c',
         'test_external_mem.c',
         'test_fbarray.c',
         'test_fib.c',
@@ -103,7 +96,6 @@ test_sources = files(
         'test_power_intel_uncore.c',
         'test_prefetch.c',
         'test_rand_perf.c',
-        'test_rawdev.c',
         'test_rcu_qsbr.c',
         'test_rcu_qsbr_perf.c',
         'test_reciprocal_division.c',
@@ -127,7 +119,6 @@ test_sources = files(
         'test_sched.c',
         'test_security.c',
         'test_security_inline_macsec.c',
-        'test_security_inline_proto.c',
         'test_seqlock.c',
         'test_service_cores.c',
         'test_spinlock.c',
@@ -186,7 +177,6 @@ fast_tests = [
         ['eal_fs_autotest', true, true],
         ['errno_autotest', true, true],
         ['ethdev_link_status', true, true],
-        ['event_ring_autotest', true, true],
         ['fib_autotest', true, true],
         ['fib6_autotest', true, true],
         ['func_reentrancy_autotest', false, true],
@@ -232,7 +222,6 @@ fast_tests = [
         ['version_autotest', true, true],
         ['crc_autotest', true, true],
         ['distributor_autotest', false, true],
-        ['eventdev_common_autotest', true, true],
         ['fbarray_autotest', true, true],
         ['hash_readwrite_func_autotest', false, true],
         ['ipsec_autotest', true, true],
@@ -319,7 +308,6 @@ driver_test_names = [
         'cryptodev_sw_snow3g_autotest',
         'cryptodev_sw_zuc_autotest',
         'cryptodev_uadk_autotest',
-        'dmadev_autotest',
 ]
 
 dump_test_names = []
@@ -357,6 +345,25 @@ if dpdk_conf.has('RTE_EVENT_SKELETON')
     test_deps += 'event_skeleton'
 endif
 
+if dpdk_conf.has('RTE_LIB_DMADEV')
+    test_sources += ['test_dmadev.c', 'test_dmadev_api.c']
+    driver_test_names += 'dmadev_autotest'
+endif
+if dpdk_conf.has('RTE_LIB_EVENTDEV')
+    test_sources += [
+        'test_event_eth_rx_adapter.c',
+        'test_event_ring.c',
+        'test_event_timer_adapter.c',
+        'test_eventdev.c',
+    ]
+    fast_tests += [
+        ['event_ring_autotest', true, true],
+        ['eventdev_common_autotest', true, true],
+    ]
+    if dpdk_conf.has('RTE_LIB_CRYPTODEV')
+        test_sources += 'test_event_crypto_adapter.c'
+    endif
+endif
 if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
@@ -402,15 +409,18 @@ if dpdk_conf.has('RTE_NET_BOND')
         driver_test_names += 'link_bonding_mode4_autotest'
     endif
 endif
-if dpdk_conf.has('RTE_LIB_EVENTDEV') and dpdk_conf.has('RTE_NET_RING')
+if dpdk_conf.has('RTE_NET_RING')
     test_deps += 'net_ring'
     test_sources += 'test_pmd_ring_perf.c'
     test_sources += 'test_pmd_ring.c'
-    test_sources += 'test_event_eth_tx_adapter.c'
     test_sources += 'sample_packet_forward.c'
     fast_tests += [['ring_pmd_autotest', true, true]]
     perf_test_names += 'ring_pmd_perf_autotest'
-    fast_tests += [['event_eth_tx_adapter_autotest', false, true]]
+    if dpdk_conf.has('RTE_LIB_EVENTDEV')
+        test_sources += 'test_event_eth_tx_adapter.c'
+        test_sources += 'test_security_inline_proto.c'
+        fast_tests += [['event_eth_tx_adapter_autotest', false, true]]
+    endif
     if dpdk_conf.has('RTE_LIB_BITRATESTATS')
         test_sources += 'test_bitratestats.c'
         fast_tests += [['bitratestats_autotest', true, true]]
@@ -430,6 +440,7 @@ if dpdk_conf.has('RTE_NET_NULL')
     fast_tests += [['vdev_autotest', true, true]]
 endif
 if dpdk_conf.has('RTE_RAW_SKELETON')
+    test_sources += 'test_rawdev.c'
     test_deps += 'raw_skeleton'
     fast_tests += [['rawdev_autotest', true, true]]
 endif
diff --git a/lib/meson.build b/lib/meson.build
index fac2f52cad..98a0672a04 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -68,8 +68,12 @@ libraries = [
 ]
 
 optional_libs = [
+        'bbdev',
         'bitratestats',
         'cfgfile',
+        'compressdev',
+        'dmadev',
+        'eventdev',
         'flow_classify',
         'gpudev',
         'graph',
@@ -79,11 +83,14 @@ optional_libs = [
         'jobstats',
         'latencystats',
         'metrics',
+        'mldev',
         'node',
         'pdump',
         'pipeline',
         'port',
         'power',
+        'rawdev',
+        'regexdev',
         'table',
         'vhost',
 ]
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v4 4/9] build: make membership library optional
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
                     ` (2 preceding siblings ...)
  2023-06-23 15:07   ` [PATCH v4 3/9] build: make most device classes optional Bruce Richardson
@ 2023-06-23 15:07   ` Bruce Richardson
  2023-06-23 15:07   ` [PATCH v4 5/9] build: make bpf " Bruce Richardson
                     ` (6 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 15:07 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 9 +++++----
 lib/meson.build      | 1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index ad7be379b0..0f9992c0b2 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -76,8 +76,6 @@ test_sources = files(
         'test_malloc.c',
         'test_malloc_perf.c',
         'test_mbuf.c',
-        'test_member.c',
-        'test_member_perf.c',
         'test_memcpy.c',
         'test_memcpy_perf.c',
         'test_memory.c',
@@ -227,7 +225,6 @@ fast_tests = [
         ['ipsec_autotest', true, true],
         ['kni_autotest', false, true],
         ['kvargs_autotest', true, true],
-        ['member_autotest', true, true],
         ['power_cpufreq_autotest', false, true],
         ['power_autotest', true, true],
         ['power_kvm_vm_autotest', false, true],
@@ -265,7 +262,6 @@ perf_test_names = [
         'timer_racecond_autotest',
         'efd_autotest',
         'hash_functions_autotest',
-        'member_perf_autotest',
         'efd_perf_autotest',
         'lpm6_perf_autotest',
         'rib6_slow_autotest',
@@ -379,6 +375,11 @@ if dpdk_conf.has('RTE_LIB_METRICS')
     test_sources += ['test_metrics.c']
     fast_tests += [['metrics_autotest', true, true]]
 endif
+if dpdk_conf.has('RTE_LIB_MEMBER')
+    test_sources += ['test_member.c', 'test_member_perf.c']
+    fast_tests += [['member_autotest', true, true]]
+    perf_test_names += 'member_perf_autotest'
+endif
 if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY')
     test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c']
     fast_tests += [['telemetry_json_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 98a0672a04..de7069a078 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -82,6 +82,7 @@ optional_libs = [
         'kni',
         'jobstats',
         'latencystats',
+        'member',
         'metrics',
         'mldev',
         'node',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v4 5/9] build: make bpf library optional
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
                     ` (3 preceding siblings ...)
  2023-06-23 15:07   ` [PATCH v4 4/9] build: make membership library optional Bruce Richardson
@ 2023-06-23 15:07   ` Bruce Richardson
  2023-06-27  9:26     ` Konstantin Ananyev
  2023-06-23 15:07   ` [PATCH v4 6/9] build: make efd " Bruce Richardson
                     ` (5 subsequent siblings)
  10 siblings, 1 reply; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 15:07 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 10 +++++++---
 lib/meson.build      |  1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 0f9992c0b2..0ef0bf690f 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -15,7 +15,6 @@ test_sources = files(
         'test_barrier.c',
         'test_bitops.c',
         'test_bitmap.c',
-        'test_bpf.c',
         'test_byteorder.c',
         'test_cksum.c',
         'test_cksum_perf.c',
@@ -150,8 +149,6 @@ fast_tests = [
         ['acl_autotest', true, true],
         ['atomic_autotest', false, true],
         ['bitmap_autotest', true, true],
-        ['bpf_autotest', true, true],
-        ['bpf_convert_autotest', true, true],
         ['bitops_autotest', true, true],
         ['byteorder_autotest', true, true],
         ['cksum_autotest', true, true],
@@ -341,6 +338,13 @@ if dpdk_conf.has('RTE_EVENT_SKELETON')
     test_deps += 'event_skeleton'
 endif
 
+if dpdk_conf.has('RTE_LIB_BPF')
+    test_sources += 'test_bpf.c'
+    fast_tests += [
+        ['bpf_autotest', true, true],
+        ['bpf_convert_autotest', true, true],
+    ]
+endif
 if dpdk_conf.has('RTE_LIB_DMADEV')
     test_sources += ['test_dmadev.c', 'test_dmadev_api.c']
     driver_test_names += 'dmadev_autotest'
diff --git a/lib/meson.build b/lib/meson.build
index de7069a078..47c18ca3b0 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -70,6 +70,7 @@ libraries = [
 optional_libs = [
         'bbdev',
         'bitratestats',
+        'bpf',
         'cfgfile',
         'compressdev',
         'dmadev',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v4 6/9] build: make efd library optional
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
                     ` (4 preceding siblings ...)
  2023-06-23 15:07   ` [PATCH v4 5/9] build: make bpf " Bruce Richardson
@ 2023-06-23 15:07   ` Bruce Richardson
  2023-06-23 15:07   ` [PATCH v4 7/9] build: make distributor " Bruce Richardson
                     ` (4 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 15:07 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 8 ++++----
 lib/meson.build      | 1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 0ef0bf690f..9331603331 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -42,8 +42,6 @@ test_sources = files(
         'test_distributor_perf.c',
         'test_eal_flags.c',
         'test_eal_fs.c',
-        'test_efd.c',
-        'test_efd_perf.c',
         'test_errno.c',
         'test_ethdev_link.c',
         'test_external_mem.c',
@@ -257,9 +255,7 @@ perf_test_names = [
         'barrier_autotest',
         'hash_multiwriter_autotest',
         'timer_racecond_autotest',
-        'efd_autotest',
         'hash_functions_autotest',
-        'efd_perf_autotest',
         'lpm6_perf_autotest',
         'rib6_slow_autotest',
         'fib6_slow_autotest',
@@ -368,6 +364,10 @@ if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
 endif
+if dpdk_conf.has('RTE_LIB_EFD')
+    test_sources += ['test_efd.c', 'test_efd_perf.c']
+    perf_test_names += ['efd_autotest', 'efd_perf_autotest']
+endif
 if dpdk_conf.has('RTE_LIB_GRAPH')
     test_sources += 'test_graph.c'
     fast_tests += [['graph_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 47c18ca3b0..07cfdef614 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -74,6 +74,7 @@ optional_libs = [
         'cfgfile',
         'compressdev',
         'dmadev',
+        'efd',
         'eventdev',
         'flow_classify',
         'gpudev',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v4 7/9] build: make distributor library optional
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
                     ` (5 preceding siblings ...)
  2023-06-23 15:07   ` [PATCH v4 6/9] build: make efd " Bruce Richardson
@ 2023-06-23 15:07   ` Bruce Richardson
  2023-06-23 15:07   ` [PATCH v4 8/9] build: make fragmentation " Bruce Richardson
                     ` (3 subsequent siblings)
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 15:07 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 9 +++++----
 lib/meson.build      | 1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 9331603331..0a971997a5 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -38,8 +38,6 @@ test_sources = files(
         'test_cycles.c',
         'test_debug.c',
         'test_devargs.c',
-        'test_distributor.c',
-        'test_distributor_perf.c',
         'test_eal_flags.c',
         'test_eal_fs.c',
         'test_errno.c',
@@ -214,7 +212,6 @@ fast_tests = [
         ['user_delay_us', true, true],
         ['version_autotest', true, true],
         ['crc_autotest', true, true],
-        ['distributor_autotest', false, true],
         ['fbarray_autotest', true, true],
         ['hash_readwrite_func_autotest', false, true],
         ['ipsec_autotest', true, true],
@@ -263,7 +260,6 @@ perf_test_names = [
         'rcu_qsbr_perf_autotest',
         'red_perf',
         'pie_perf',
-        'distributor_perf_autotest',
         'pmd_perf_autotest',
         'service_perf_autotest',
         'stack_perf_autotest',
@@ -364,6 +360,11 @@ if dpdk_conf.has('RTE_LIB_FLOW_CLASSIFY')
     test_sources += 'test_flow_classify.c'
     fast_tests += [['flow_classify_autotest', false, true]]
 endif
+if dpdk_conf.has('RTE_LIB_DISTRIBUTOR')
+    test_sources += ['test_distributor.c', 'test_distributor_perf.c']
+    fast_tests += [['distributor_autotest', false, true]]
+    perf_test_names += 'distributor_perf_autotest'
+endif
 if dpdk_conf.has('RTE_LIB_EFD')
     test_sources += ['test_efd.c', 'test_efd_perf.c']
     perf_test_names += ['efd_autotest', 'efd_perf_autotest']
diff --git a/lib/meson.build b/lib/meson.build
index 07cfdef614..757c1a63e9 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -73,6 +73,7 @@ optional_libs = [
         'bpf',
         'cfgfile',
         'compressdev',
+        'distributor',
         'dmadev',
         'efd',
         'eventdev',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v4 8/9] build: make fragmentation library optional
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
                     ` (6 preceding siblings ...)
  2023-06-23 15:07   ` [PATCH v4 7/9] build: make distributor " Bruce Richardson
@ 2023-06-23 15:07   ` Bruce Richardson
  2023-06-27  9:32     ` Konstantin Ananyev
  2023-06-23 15:07   ` [PATCH v4 9/9] build: make reorder " Bruce Richardson
                     ` (2 subsequent siblings)
  10 siblings, 1 reply; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 15:07 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 6 ++++--
 lib/meson.build      | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 0a971997a5..2e447e3402 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -56,7 +56,6 @@ test_sources = files(
         'test_hash_perf.c',
         'test_hash_readwrite_lf_perf.c',
         'test_interrupts.c',
-        'test_ipfrag.c',
         'test_ipsec.c',
         'test_ipsec_sad.c',
         'test_ipsec_perf.c',
@@ -173,7 +172,6 @@ fast_tests = [
         ['func_reentrancy_autotest', false, true],
         ['hash_autotest', true, true],
         ['interrupt_autotest', true, true],
-        ['ipfrag_autotest', false, true],
         ['lcores_autotest', true, true],
         ['logs_autotest', true, true],
         ['lpm_autotest', true, true],
@@ -376,6 +374,10 @@ if dpdk_conf.has('RTE_LIB_GRAPH')
     test_sources += 'test_graph_perf.c'
     perf_test_names += 'graph_perf_autotest'
 endif
+if dpdk_conf.has('RTE_LIB_IP_FRAG')
+    test_sources += 'test_ipfrag.c'
+    fast_tests += [['ipfrag_autotest', false, true]]
+endif
 if dpdk_conf.has('RTE_LIB_METRICS')
     test_sources += ['test_metrics.c']
     fast_tests += [['metrics_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index 757c1a63e9..ea351b236a 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -83,6 +83,7 @@ optional_libs = [
         'gro',
         'gso',
         'kni',
+        'ip_frag',
         'jobstats',
         'latencystats',
         'member',
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v4 9/9] build: make reorder library optional
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
                     ` (7 preceding siblings ...)
  2023-06-23 15:07   ` [PATCH v4 8/9] build: make fragmentation " Bruce Richardson
@ 2023-06-23 15:07   ` Bruce Richardson
  2023-07-04  1:40   ` [PATCH v4 0/9] expand list of optional libraries fengchengwen
  2023-08-14 15:10   ` Bruce Richardson
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-06-23 15:07 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup

This library is not essential for most DPDK uses, so mark it as optional
in the build config.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test/meson.build | 6 ++++--
 lib/meson.build      | 1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index 2e447e3402..d4b6280658 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -94,7 +94,6 @@ test_sources = files(
         'test_reciprocal_division_perf.c',
         'test_red.c',
         'test_pie.c',
-        'test_reorder.c',
         'test_rib.c',
         'test_rib6.c',
         'test_ring.c',
@@ -219,7 +218,6 @@ fast_tests = [
         ['power_autotest', true, true],
         ['power_kvm_vm_autotest', false, true],
         ['power_intel_uncore_autotest', true, true],
-        ['reorder_autotest', true, true],
         ['service_autotest', true, true],
         ['thash_autotest', true, true],
         ['threads_autotest', true, true],
@@ -387,6 +385,10 @@ if dpdk_conf.has('RTE_LIB_MEMBER')
     fast_tests += [['member_autotest', true, true]]
     perf_test_names += 'member_perf_autotest'
 endif
+if dpdk_conf.has('RTE_LIB_REORDER')
+    test_sources += 'test_reorder.c'
+    fast_tests += [['reorder_autotest', true, true]]
+endif
 if not is_windows and dpdk_conf.has('RTE_LIB_TELEMETRY')
     test_sources += ['test_telemetry_json.c', 'test_telemetry_data.c']
     fast_tests += [['telemetry_json_autotest', true, true]]
diff --git a/lib/meson.build b/lib/meson.build
index ea351b236a..b46f4e51ff 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -96,6 +96,7 @@ optional_libs = [
         'power',
         'rawdev',
         'regexdev',
+        'reorder',
         'table',
         'vhost',
 ]
-- 
2.39.2


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v4 5/9] build: make bpf library optional
  2023-06-23 15:07   ` [PATCH v4 5/9] build: make bpf " Bruce Richardson
@ 2023-06-27  9:26     ` Konstantin Ananyev
  0 siblings, 0 replies; 50+ messages in thread
From: Konstantin Ananyev @ 2023-06-27  9:26 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: Morten Brørup

23/06/2023 16:07, Bruce Richardson пишет:
> This library is not essential for most DPDK uses, so mark it as optional
> in the build config.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> ---
>   app/test/meson.build | 10 +++++++---
>   lib/meson.build      |  1 +
>   2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test/meson.build b/app/test/meson.build
> index 0f9992c0b2..0ef0bf690f 100644
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> @@ -15,7 +15,6 @@ test_sources = files(
>           'test_barrier.c',
>           'test_bitops.c',
>           'test_bitmap.c',
> -        'test_bpf.c',
>           'test_byteorder.c',
>           'test_cksum.c',
>           'test_cksum_perf.c',
> @@ -150,8 +149,6 @@ fast_tests = [
>           ['acl_autotest', true, true],
>           ['atomic_autotest', false, true],
>           ['bitmap_autotest', true, true],
> -        ['bpf_autotest', true, true],
> -        ['bpf_convert_autotest', true, true],
>           ['bitops_autotest', true, true],
>           ['byteorder_autotest', true, true],
>           ['cksum_autotest', true, true],
> @@ -341,6 +338,13 @@ if dpdk_conf.has('RTE_EVENT_SKELETON')
>       test_deps += 'event_skeleton'
>   endif
>   
> +if dpdk_conf.has('RTE_LIB_BPF')
> +    test_sources += 'test_bpf.c'
> +    fast_tests += [
> +        ['bpf_autotest', true, true],
> +        ['bpf_convert_autotest', true, true],
> +    ]
> +endif
>   if dpdk_conf.has('RTE_LIB_DMADEV')
>       test_sources += ['test_dmadev.c', 'test_dmadev_api.c']
>       driver_test_names += 'dmadev_autotest'
> diff --git a/lib/meson.build b/lib/meson.build
> index de7069a078..47c18ca3b0 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -70,6 +70,7 @@ libraries = [
>   optional_libs = [
>           'bbdev',
>           'bitratestats',
> +        'bpf',
>           'cfgfile',
>           'compressdev',
>           'dmadev',

Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v4 8/9] build: make fragmentation library optional
  2023-06-23 15:07   ` [PATCH v4 8/9] build: make fragmentation " Bruce Richardson
@ 2023-06-27  9:32     ` Konstantin Ananyev
  2023-07-17 13:19       ` Bruce Richardson
  0 siblings, 1 reply; 50+ messages in thread
From: Konstantin Ananyev @ 2023-06-27  9:32 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: Morten Brørup, pbhagavatula

23/06/2023 16:07, Bruce Richardson пишет:
> This library is not essential for most DPDK uses, so mark it as optional
> in the build config.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> ---
>   app/test/meson.build | 6 ++++--
>   lib/meson.build      | 1 +
>   2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test/meson.build b/app/test/meson.build
> index 0a971997a5..2e447e3402 100644
> --- a/app/test/meson.build
> +++ b/app/test/meson.build
> @@ -56,7 +56,6 @@ test_sources = files(
>           'test_hash_perf.c',
>           'test_hash_readwrite_lf_perf.c',
>           'test_interrupts.c',
> -        'test_ipfrag.c',
>           'test_ipsec.c',
>           'test_ipsec_sad.c',
>           'test_ipsec_perf.c',
> @@ -173,7 +172,6 @@ fast_tests = [
>           ['func_reentrancy_autotest', false, true],
>           ['hash_autotest', true, true],
>           ['interrupt_autotest', true, true],
> -        ['ipfrag_autotest', false, true],
>           ['lcores_autotest', true, true],
>           ['logs_autotest', true, true],
>           ['lpm_autotest', true, true],
> @@ -376,6 +374,10 @@ if dpdk_conf.has('RTE_LIB_GRAPH')
>       test_sources += 'test_graph_perf.c'
>       perf_test_names += 'graph_perf_autotest'
>   endif
> +if dpdk_conf.has('RTE_LIB_IP_FRAG')
> +    test_sources += 'test_ipfrag.c'
> +    fast_tests += [['ipfrag_autotest', false, true]]

AFAIK, there is a new patch in flight to add new ip_frag perf autotest:
http://patchwork.dpdk.org/project/dpdk/patch/20230602170147.4828-2-pbhagavatula@marvell.com/
Probably need to be synced with these changes too..


> +endif
>   if dpdk_conf.has('RTE_LIB_METRICS')
>       test_sources += ['test_metrics.c']
>       fast_tests += [['metrics_autotest', true, true]]
> diff --git a/lib/meson.build b/lib/meson.build
> index 757c1a63e9..ea351b236a 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -83,6 +83,7 @@ optional_libs = [
>           'gro',
>           'gso',
>           'kni',
> +        'ip_frag',
>           'jobstats',
>           'latencystats',
>           'member',


Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>




^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v4 2/9] event/dlb2: skip configuration if no eventdev lib
  2023-06-23 15:07   ` [PATCH v4 2/9] event/dlb2: skip configuration if no eventdev lib Bruce Richardson
@ 2023-06-28 10:19     ` David Marchand
  2023-06-29  9:39       ` David Marchand
  0 siblings, 1 reply; 50+ messages in thread
From: David Marchand @ 2023-06-28 10:19 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Timothy McDaniel

On Fri, Jun 23, 2023 at 5:07 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> While the build system will skip building most libs and drivers when a
> dependency is missing for a component, for DLB2 driver, the
> "static_rte_eventdev" object is referenced inside the meson.build file
> itself, which will cause crashes if it doesn't exist i.e. if eventdev is
> disabled. Prevent this issue by skipping processing the file if no
> eventdev. [The build system will still report missing dependency, as the
> dependency is set by default for all eventdev drivers]
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Could we evaluate the class "std_deps" before jumping to each driver
meson.build?


-- 
David Marchand


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v4 2/9] event/dlb2: skip configuration if no eventdev lib
  2023-06-28 10:19     ` David Marchand
@ 2023-06-29  9:39       ` David Marchand
  2023-07-18  9:09         ` Bruce Richardson
  0 siblings, 1 reply; 50+ messages in thread
From: David Marchand @ 2023-06-29  9:39 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Timothy McDaniel

On Wed, Jun 28, 2023 at 12:19 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Fri, Jun 23, 2023 at 5:07 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > While the build system will skip building most libs and drivers when a
> > dependency is missing for a component, for DLB2 driver, the
> > "static_rte_eventdev" object is referenced inside the meson.build file
> > itself, which will cause crashes if it doesn't exist i.e. if eventdev is
> > disabled. Prevent this issue by skipping processing the file if no
> > eventdev. [The build system will still report missing dependency, as the
> > dependency is set by default for all eventdev drivers]
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
>
> Could we evaluate the class "std_deps" before jumping to each driver
> meson.build?

Hum, with my suggestion, we lose the opportunity for drivers to
rewrite completely their "deps".
I doubt we have cases where it really matters, but if this revealed to
be necessary, such driver may be directly referenced in
drivers/meson.build like we do for common/cnxk & friends.

To illustrate the idea, I pushed your series along patches of mine
(target is v23.11) in my github repo.
https://github.com/david-marchand/dpdk/commit/enable_libs~8


-- 
David Marchand


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v4 0/9] expand list of optional libraries
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
                     ` (8 preceding siblings ...)
  2023-06-23 15:07   ` [PATCH v4 9/9] build: make reorder " Bruce Richardson
@ 2023-07-04  1:40   ` fengchengwen
  2023-08-14 15:10   ` Bruce Richardson
  10 siblings, 0 replies; 50+ messages in thread
From: fengchengwen @ 2023-07-04  1:40 UTC (permalink / raw)
  To: Bruce Richardson, dev

Series-acked-by: Chengwen Feng <fengchengwen@huawei.com>

On 2023/6/23 23:06, Bruce Richardson wrote:
> DPDK still has many libraries which cannot be disabled as part of a
> build. With the ongoing work to make it easier to only build a subset
> of the libraries in DPDK, we can also work to expand the list of
> libraries which can be enabled/disabled as desired.
> 
> This patch addresses a number of the "low-hanging fruit" libraries,
> where only the unit test builds need minor changes to support
> making the library optional. The rest of the build system is already
> well set up for selective disabling of libraries.
> 
> For better support of enabling components, especially those more
> integrated into DPDK unit tests, rework of the test meson.build file
> is likely needed. For example, it could probably be better rewritten
> to use a dictionary of files and the dependencies of each file, and
> the unit test commands each provides. However, such rework is a
> significant effort, and outside the scope of this patchset.
> 
> V4:
> - fix more issues with disabling eventdev:
>   * ensure dlb2 driver doesn't directly reference the static lib
>   * ensure l3fwd can be built using makefiles without eventdev
>   * remove dependency on eventdev for unit tests like pdump that
>     don't actually need it.
> 
> V3:
> - rebase on top of main.
> - make eventdev an optional dependency of l3fwd
> - Fix incorrect define reference - RTE_LIB_IP_FRAG vs RTE_IP_FRAG
> 
> V2: fix checkpatch issues, since checkpatch doesn't like empty commit
>     messages (even if the title is pretty self-explanatory!)
> 
> Bruce Richardson (9):
>   examples/l3fwd: make eventdev an optional dependency
>   event/dlb2: skip configuration if no eventdev lib
>   build: make most device classes optional
>   build: make membership library optional
>   build: make bpf library optional
>   build: make efd library optional
>   build: make distributor library optional
>   build: make fragmentation library optional
>   build: make reorder library optional
> 
>  app/test/meson.build                       | 89 +++++++++++++---------
>  drivers/event/dlb2/meson.build             |  2 +-
>  examples/l3fwd/l3fwd_em.c                  |  2 +
>  examples/l3fwd/l3fwd_em_hlm.h              |  2 +
>  examples/l3fwd/l3fwd_event.c               |  2 +
>  examples/l3fwd/l3fwd_event.h               |  7 +-
>  examples/l3fwd/l3fwd_event_generic.c       |  2 +
>  examples/l3fwd/l3fwd_event_internal_port.c |  2 +
>  examples/l3fwd/l3fwd_fib.c                 |  2 +
>  examples/l3fwd/l3fwd_lpm.c                 |  2 +
>  examples/l3fwd/main.c                      | 65 ++++++++++++----
>  examples/l3fwd/meson.build                 |  5 +-
>  lib/meson.build                            | 13 ++++
>  13 files changed, 143 insertions(+), 52 deletions(-)
> 
> --
> 2.39.2
> 
> .
> 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v4 8/9] build: make fragmentation library optional
  2023-06-27  9:32     ` Konstantin Ananyev
@ 2023-07-17 13:19       ` Bruce Richardson
  0 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-07-17 13:19 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Morten Brørup, pbhagavatula

On Tue, Jun 27, 2023 at 10:32:55AM +0100, Konstantin Ananyev wrote:
> 23/06/2023 16:07, Bruce Richardson пишет:
> > This library is not essential for most DPDK uses, so mark it as optional
> > in the build config.
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > Acked-by: Morten Brørup <mb@smartsharesystems.com>
> > ---
> >   app/test/meson.build | 6 ++++--
> >   lib/meson.build      | 1 +
> >   2 files changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/app/test/meson.build b/app/test/meson.build
> > index 0a971997a5..2e447e3402 100644
> > --- a/app/test/meson.build
> > +++ b/app/test/meson.build
> > @@ -56,7 +56,6 @@ test_sources = files(
> >           'test_hash_perf.c',
> >           'test_hash_readwrite_lf_perf.c',
> >           'test_interrupts.c',
> > -        'test_ipfrag.c',
> >           'test_ipsec.c',
> >           'test_ipsec_sad.c',
> >           'test_ipsec_perf.c',
> > @@ -173,7 +172,6 @@ fast_tests = [
> >           ['func_reentrancy_autotest', false, true],
> >           ['hash_autotest', true, true],
> >           ['interrupt_autotest', true, true],
> > -        ['ipfrag_autotest', false, true],
> >           ['lcores_autotest', true, true],
> >           ['logs_autotest', true, true],
> >           ['lpm_autotest', true, true],
> > @@ -376,6 +374,10 @@ if dpdk_conf.has('RTE_LIB_GRAPH')
> >       test_sources += 'test_graph_perf.c'
> >       perf_test_names += 'graph_perf_autotest'
> >   endif
> > +if dpdk_conf.has('RTE_LIB_IP_FRAG')
> > +    test_sources += 'test_ipfrag.c'
> > +    fast_tests += [['ipfrag_autotest', false, true]]
> 
> AFAIK, there is a new patch in flight to add new ip_frag perf autotest:
> http://patchwork.dpdk.org/project/dpdk/patch/20230602170147.4828-2-pbhagavatula@marvell.com/
> Probably need to be synced with these changes too..
> 

Yep, it would.
I'm working on and off in the background to try and improve the way we
manage dependencies for tests, as right now it's a bit of mess, if I'm
honest. It's very condition-based and error prone.


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v4 2/9] event/dlb2: skip configuration if no eventdev lib
  2023-06-29  9:39       ` David Marchand
@ 2023-07-18  9:09         ` Bruce Richardson
  2023-08-01  8:36           ` David Marchand
  0 siblings, 1 reply; 50+ messages in thread
From: Bruce Richardson @ 2023-07-18  9:09 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Timothy McDaniel

On Thu, Jun 29, 2023 at 11:39:53AM +0200, David Marchand wrote:
> On Wed, Jun 28, 2023 at 12:19 PM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > On Fri, Jun 23, 2023 at 5:07 PM Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > >
> > > While the build system will skip building most libs and drivers when a
> > > dependency is missing for a component, for DLB2 driver, the
> > > "static_rte_eventdev" object is referenced inside the meson.build file
> > > itself, which will cause crashes if it doesn't exist i.e. if eventdev is
> > > disabled. Prevent this issue by skipping processing the file if no
> > > eventdev. [The build system will still report missing dependency, as the
> > > dependency is set by default for all eventdev drivers]
> > >
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> >
> > Could we evaluate the class "std_deps" before jumping to each driver
> > meson.build?
> 
> Hum, with my suggestion, we lose the opportunity for drivers to
> rewrite completely their "deps".
> I doubt we have cases where it really matters, but if this revealed to
> be necessary, such driver may be directly referenced in
> drivers/meson.build like we do for common/cnxk & friends.
> 
> To illustrate the idea, I pushed your series along patches of mine
> (target is v23.11) in my github repo.
> https://github.com/david-marchand/dpdk/commit/enable_libs~8
> 
I don't think we should need to worry too much about the case of a driver
needing to rewrite deps. The standard deps should really just be the
minimal deps for a class.

However, for the implementation of that check, I'm not sure I like the
approach of checking std_deps in a loop for each driver. Firstly, the logic
inside the per-driver block is already pretty complicated, but secondly, I
think we can skip that loop entirely if the standard deps for a class are
not met. I think instead it would be better to process std_deps value once
immediately after the "subdir(class)" line, and if not all deps are
present, just loop through all the driver directories for that class
immediately and mark them as unbuildable, before just moving on to the next
class.

WDYT?
/Bruce

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v4 2/9] event/dlb2: skip configuration if no eventdev lib
  2023-07-18  9:09         ` Bruce Richardson
@ 2023-08-01  8:36           ` David Marchand
  2023-08-01  9:17             ` Bruce Richardson
  0 siblings, 1 reply; 50+ messages in thread
From: David Marchand @ 2023-08-01  8:36 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Timothy McDaniel

Hello Bruce,

On Tue, Jul 18, 2023 at 11:10 AM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Thu, Jun 29, 2023 at 11:39:53AM +0200, David Marchand wrote:
> > On Wed, Jun 28, 2023 at 12:19 PM David Marchand
> > <david.marchand@redhat.com> wrote:
> > >
> > > On Fri, Jun 23, 2023 at 5:07 PM Bruce Richardson
> > > <bruce.richardson@intel.com> wrote:
> > > >
> > > > While the build system will skip building most libs and drivers when a
> > > > dependency is missing for a component, for DLB2 driver, the
> > > > "static_rte_eventdev" object is referenced inside the meson.build file
> > > > itself, which will cause crashes if it doesn't exist i.e. if eventdev is
> > > > disabled. Prevent this issue by skipping processing the file if no
> > > > eventdev. [The build system will still report missing dependency, as the
> > > > dependency is set by default for all eventdev drivers]
> > > >
> > > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > >
> > > Could we evaluate the class "std_deps" before jumping to each driver
> > > meson.build?
> >
> > Hum, with my suggestion, we lose the opportunity for drivers to
> > rewrite completely their "deps".
> > I doubt we have cases where it really matters, but if this revealed to
> > be necessary, such driver may be directly referenced in
> > drivers/meson.build like we do for common/cnxk & friends.
> >
> > To illustrate the idea, I pushed your series along patches of mine
> > (target is v23.11) in my github repo.
> > https://github.com/david-marchand/dpdk/commit/enable_libs~8
> >
> I don't think we should need to worry too much about the case of a driver
> needing to rewrite deps. The standard deps should really just be the
> minimal deps for a class.
>
> However, for the implementation of that check, I'm not sure I like the
> approach of checking std_deps in a loop for each driver. Firstly, the logic
> inside the per-driver block is already pretty complicated, but secondly, I
> think we can skip that loop entirely if the standard deps for a class are
> not met. I think instead it would be better to process std_deps value once
> immediately after the "subdir(class)" line, and if not all deps are
> present, just loop through all the driver directories for that class
> immediately and mark them as unbuildable, before just moving on to the next
> class.

Skipping this loop makes the change smaller and the logic in
drivers/meson.build easier to understand.
We lose the exhaustive summary for disabled content (before, every
disabled driver was logged with the associated reason), but we can
still log the reason why a class is disabled.

Your suggestion looks good to me, let me send a patch.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v4 2/9] event/dlb2: skip configuration if no eventdev lib
  2023-08-01  8:36           ` David Marchand
@ 2023-08-01  9:17             ` Bruce Richardson
  0 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-08-01  9:17 UTC (permalink / raw)
  To: David Marchand; +Cc: dev, Timothy McDaniel

On Tue, Aug 01, 2023 at 10:36:30AM +0200, David Marchand wrote:
> Hello Bruce,
> 
> On Tue, Jul 18, 2023 at 11:10 AM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > On Thu, Jun 29, 2023 at 11:39:53AM +0200, David Marchand wrote:
> > > On Wed, Jun 28, 2023 at 12:19 PM David Marchand
> > > <david.marchand@redhat.com> wrote:
> > > >
> > > > On Fri, Jun 23, 2023 at 5:07 PM Bruce Richardson
> > > > <bruce.richardson@intel.com> wrote:
> > > > >
> > > > > While the build system will skip building most libs and drivers when a
> > > > > dependency is missing for a component, for DLB2 driver, the
> > > > > "static_rte_eventdev" object is referenced inside the meson.build file
> > > > > itself, which will cause crashes if it doesn't exist i.e. if eventdev is
> > > > > disabled. Prevent this issue by skipping processing the file if no
> > > > > eventdev. [The build system will still report missing dependency, as the
> > > > > dependency is set by default for all eventdev drivers]
> > > > >
> > > > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > >
> > > > Could we evaluate the class "std_deps" before jumping to each driver
> > > > meson.build?
> > >
> > > Hum, with my suggestion, we lose the opportunity for drivers to
> > > rewrite completely their "deps".
> > > I doubt we have cases where it really matters, but if this revealed to
> > > be necessary, such driver may be directly referenced in
> > > drivers/meson.build like we do for common/cnxk & friends.
> > >
> > > To illustrate the idea, I pushed your series along patches of mine
> > > (target is v23.11) in my github repo.
> > > https://github.com/david-marchand/dpdk/commit/enable_libs~8
> > >
> > I don't think we should need to worry too much about the case of a driver
> > needing to rewrite deps. The standard deps should really just be the
> > minimal deps for a class.
> >
> > However, for the implementation of that check, I'm not sure I like the
> > approach of checking std_deps in a loop for each driver. Firstly, the logic
> > inside the per-driver block is already pretty complicated, but secondly, I
> > think we can skip that loop entirely if the standard deps for a class are
> > not met. I think instead it would be better to process std_deps value once
> > immediately after the "subdir(class)" line, and if not all deps are
> > present, just loop through all the driver directories for that class
> > immediately and mark them as unbuildable, before just moving on to the next
> > class.
> 
> Skipping this loop makes the change smaller and the logic in
> drivers/meson.build easier to understand.
> We lose the exhaustive summary for disabled content (before, every
> disabled driver was logged with the associated reason), but we can
> still log the reason why a class is disabled.
> 

When we "subdir" into the driver class directory to get the standard
dependencies, we also get the list of drivers of that class. We can then
loop through those drivers to individually mark them as disabled for the
summary. It would be a fairly small loop, and would keep things consistent
with what we have now.

On the other hand, having a single line for a whole class of drivers may
make the summary more useful!

/Bruce

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v4 0/9] expand list of optional libraries
  2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
                     ` (9 preceding siblings ...)
  2023-07-04  1:40   ` [PATCH v4 0/9] expand list of optional libraries fengchengwen
@ 2023-08-14 15:10   ` Bruce Richardson
  10 siblings, 0 replies; 50+ messages in thread
From: Bruce Richardson @ 2023-08-14 15:10 UTC (permalink / raw)
  To: dev

On Fri, Jun 23, 2023 at 04:06:59PM +0100, Bruce Richardson wrote:
> DPDK still has many libraries which cannot be disabled as part of a
> build. With the ongoing work to make it easier to only build a subset
> of the libraries in DPDK, we can also work to expand the list of
> libraries which can be enabled/disabled as desired.
> 
> This patch addresses a number of the "low-hanging fruit" libraries,
> where only the unit test builds need minor changes to support
> making the library optional. The rest of the build system is already
> well set up for selective disabling of libraries.
> 
> For better support of enabling components, especially those more
> integrated into DPDK unit tests, rework of the test meson.build file
> is likely needed. For example, it could probably be better rewritten
> to use a dictionary of files and the dependencies of each file, and
> the unit test commands each provides. However, such rework is a
> significant effort, and outside the scope of this patchset.
> 
> V4:
> - fix more issues with disabling eventdev:
>   * ensure dlb2 driver doesn't directly reference the static lib
>   * ensure l3fwd can be built using makefiles without eventdev
>   * remove dependency on eventdev for unit tests like pdump that
>     don't actually need it.
> 
This patch series I'm closing off, and merging in with my patch series to
improve the unit test builds. With the unit test build set applied, most of
the patches in this set just become single-line changes to the optional
list, so just adding them to the end of the test cleanup set makes sense.

/Bruce

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2023-08-14 15:10 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-22 13:48 [PATCH 0/7] expand list of optional libraries Bruce Richardson
2023-06-22 13:48 ` [PATCH 1/7] build: make most device classes optional Bruce Richardson
2023-06-22 13:48 ` [PATCH 2/7] build: make membership library optional Bruce Richardson
2023-06-22 13:48 ` [PATCH 3/7] build: make bpf " Bruce Richardson
2023-06-22 13:48 ` [PATCH 4/7] build: make efd " Bruce Richardson
2023-06-22 13:48 ` [PATCH 5/7] build: make distributor " Bruce Richardson
2023-06-22 13:48 ` [PATCH 6/7] build: make fragmentation libary optional Bruce Richardson
2023-06-22 13:48 ` [PATCH 7/7] build: make reorder library optional Bruce Richardson
2023-06-22 14:30 ` [PATCH 0/7] expand list of optional libraries Morten Brørup
2023-06-22 15:05 ` [PATCH v2 " Bruce Richardson
2023-06-22 15:05   ` [PATCH v2 1/7] build: make most device classes optional Bruce Richardson
2023-06-22 15:05   ` [PATCH v2 2/7] build: make membership library optional Bruce Richardson
2023-06-22 15:05   ` [PATCH v2 3/7] build: make bpf " Bruce Richardson
2023-06-22 15:05   ` [PATCH v2 4/7] build: make efd " Bruce Richardson
2023-06-22 15:05   ` [PATCH v2 5/7] build: make distributor " Bruce Richardson
2023-06-22 15:05   ` [PATCH v2 6/7] build: make fragmentation " Bruce Richardson
2023-06-22 15:05   ` [PATCH v2 7/7] build: make reorder " Bruce Richardson
2023-06-23 10:25   ` [PATCH v2 0/7] expand list of optional libraries David Marchand
2023-06-23 10:31     ` David Marchand
2023-06-23 11:08       ` Bruce Richardson
2023-06-23 11:15 ` [PATCH v3 0/8] " Bruce Richardson
2023-06-23 11:15   ` [PATCH v3 1/8] examples/l3fwd: make eventdev an optional dependency Bruce Richardson
2023-06-23 13:25     ` Bruce Richardson
2023-06-23 11:15   ` [PATCH v3 2/8] build: make most device classes optional Bruce Richardson
2023-06-23 11:15   ` [PATCH v3 3/8] build: make membership library optional Bruce Richardson
2023-06-23 11:15   ` [PATCH v3 4/8] build: make bpf " Bruce Richardson
2023-06-23 11:15   ` [PATCH v3 5/8] build: make efd " Bruce Richardson
2023-06-23 11:15   ` [PATCH v3 6/8] build: make distributor " Bruce Richardson
2023-06-23 11:15   ` [PATCH v3 7/8] build: make fragmentation " Bruce Richardson
2023-06-23 11:15   ` [PATCH v3 8/8] build: make reorder " Bruce Richardson
2023-06-23 15:06 ` [PATCH v4 0/9] expand list of optional libraries Bruce Richardson
2023-06-23 15:07   ` [PATCH v4 1/9] examples/l3fwd: make eventdev an optional dependency Bruce Richardson
2023-06-23 15:07   ` [PATCH v4 2/9] event/dlb2: skip configuration if no eventdev lib Bruce Richardson
2023-06-28 10:19     ` David Marchand
2023-06-29  9:39       ` David Marchand
2023-07-18  9:09         ` Bruce Richardson
2023-08-01  8:36           ` David Marchand
2023-08-01  9:17             ` Bruce Richardson
2023-06-23 15:07   ` [PATCH v4 3/9] build: make most device classes optional Bruce Richardson
2023-06-23 15:07   ` [PATCH v4 4/9] build: make membership library optional Bruce Richardson
2023-06-23 15:07   ` [PATCH v4 5/9] build: make bpf " Bruce Richardson
2023-06-27  9:26     ` Konstantin Ananyev
2023-06-23 15:07   ` [PATCH v4 6/9] build: make efd " Bruce Richardson
2023-06-23 15:07   ` [PATCH v4 7/9] build: make distributor " Bruce Richardson
2023-06-23 15:07   ` [PATCH v4 8/9] build: make fragmentation " Bruce Richardson
2023-06-27  9:32     ` Konstantin Ananyev
2023-07-17 13:19       ` Bruce Richardson
2023-06-23 15:07   ` [PATCH v4 9/9] build: make reorder " Bruce Richardson
2023-07-04  1:40   ` [PATCH v4 0/9] expand list of optional libraries fengchengwen
2023-08-14 15:10   ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).