Skip to contentSkip to conversation

app/test: drop dependency on crypto scheduler driver

PATCH In review Bruce Richardson 3 participants 9 messages Sep 28, 2023 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/test: drop dependency on crypto scheduler driver

The cryptodev autotests make use of the crypto scheduler driver when it is available, but build fine without. We can therefore remove the hard dependency on that driver when building the crypto test files.

Fixes 50823f30f0c8 ("test: build using per-file dependencies")
---
 app/test/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/meson.build +1 -1
index 05bae9216d..29ddf18502 100644
@@ -11,7 +11,7 @@ packet_burst_generator_deps = ['net']
 sample_packet_forward_deps = ['net_ring', 'ethdev', 'bus_vdev']
 virtual_pmd_deps = ['ethdev', 'net', 'bus_pci']
 # test_cryptodev has material that other crypto tests need
-test_cryptodev_deps = ['bus_vdev', 'net', 'cryptodev', 'crypto_scheduler', 'security']
+test_cryptodev_deps = ['bus_vdev', 'net', 'cryptodev', 'security']
 
 source_file_deps = {
     # The C files providing functionality to other test cases
Signature · 1 line
2.39.2
#2 lore raw
Quoted 4 lines · Akhil Goyal
Quoted 4 lines

The cryptodev autotests make use of the crypto scheduler driver when it is available, but build fine without. We can therefore remove the hard dependency on that driver when building the crypto test files.

loongarch CI does not seem to agree, can you have a look?

Quoted 6 lines
Quoted 5 lines
Fixes 50823f30f0c8 ("test: build using per-file dependencies")
Signature · 1 line
David Marchand
#3 lore raw
Quoted 8 lines · David Marchand
Quoted 4 lines · Akhil Goyal
Quoted 4 lines

The cryptodev autotests make use of the crypto scheduler driver when it is available, but build fine without. We can therefore remove the hard dependency on that driver when building the crypto test files.

loongarch CI does not seem to agree, can you have a look?

Yes, although I find the error reported a little strange as it should not be including the header if the component is not available.

However, first I'm looking into some other issues I caught post-post of the patch. The dependency tracking is also not correct after this change, so I need to do a little more digging to fix this. I probably need a precursor patch to fix the dependency assignment for the binary, as having optional dependencies means we can no longer use the dependency list for determining what objects we need to link against (and what header paths to search). Instead for the unit tests, we should just link against everything we have built.

Please ignore this patch for now. V2 set coming soon...

/Bruce

#4 lore raw

PATCH 1/2 app/test: add support for optional dependencies

In reply to Bruce Richardson

Some tests make optionally use a component but don't require it for building. If we include the dependency in the per-file lists, then tests may be unnecessarily omitted, as the dependency is not required. On the other hand, removing the optional dependency from the list can cause build failures, as the test case may include the optional code, but then fail to build as the build system won't have added the necessary paths for header inclusion, or the necessary libraries for linking.

Resolve this by explicitly providing a list of optional dependencies. Any items in this list will be added to the dependency list if available, but otherwise won't be involved in enable/disable of specific tests.

---
 app/test/meson.build | 10 ++++++++++
 1 file changed, 10 insertions(+)
app/test/meson.build +10 -0
index 05bae9216d..80b60f68b2 100644
@@ -5,6 +5,10 @@
 deps += ['cmdline', 'ring', 'mempool', 'mbuf']
 sources += files('commands.c', 'test.c')
 
+# optional dependencies: some files may use these - and so we should link them in -
+# but do not explicitly require them so they are not listed in the per-file lists below
+optional_deps = []
+
 # some other utility C files, providing functions used by various tests
 # so we need to include these deps in the dependency list for the files using those fns.
 packet_burst_generator_deps = ['net']
@@ -226,6 +230,12 @@ foreach f, f_deps : source_file_deps
         sources += files(f)
     endif
 endforeach
+# add the optional dependencies
+foreach d:optional_deps
+    if is_variable(def_lib + '_rte_' + d) and d not in deps
+        deps += d
+    endif
+endforeach
 
 if cc.has_argument('-Wno-format-truncation')
     cflags += '-Wno-format-truncation'
Signature · 1 line
2.39.2
#5 lore raw

PATCH 2/2 app/test: make crypto scheduler an optional dependency

The cryptodev autotests make use of the crypto scheduler driver when it is available, but build fine without. We can therefore remove the hard dependency on that driver when building the crypto test files.

Fixes 50823f30f0c8 ("test: build using per-file dependencies")
---
 app/test/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
app/test/meson.build +2 -2
index 80b60f68b2..bf9fc90612 100644
@@ -7,7 +7,7 @@ sources += files('commands.c', 'test.c')
 
 # optional dependencies: some files may use these - and so we should link them in -
 # but do not explicitly require them so they are not listed in the per-file lists below
-optional_deps = []
+optional_deps = ['crypto_scheduler']
 
 # some other utility C files, providing functions used by various tests
 # so we need to include these deps in the dependency list for the files using those fns.
@@ -15,7 +15,7 @@ packet_burst_generator_deps = ['net']
 sample_packet_forward_deps = ['net_ring', 'ethdev', 'bus_vdev']
 virtual_pmd_deps = ['ethdev', 'net', 'bus_pci']
 # test_cryptodev has material that other crypto tests need
-test_cryptodev_deps = ['bus_vdev', 'net', 'cryptodev', 'crypto_scheduler', 'security']
+test_cryptodev_deps = ['bus_vdev', 'net', 'cryptodev', 'security']
 
 source_file_deps = {
     # The C files providing functionality to other test cases
Signature · 1 line
2.39.2
Reviewed-by on v1 1/2
#6 lore raw

Re: [PATCH 1/2] app/test: add support for optional dependencies

In reply to Bruce Richardson
Quoted 2 lines · Bruce Richardson

Some tests make optionally use a component but don't require it for

s/make //

Quoted 7 lines

building. If we include the dependency in the per-file lists, then tests may be unnecessarily omitted, as the dependency is not required. On the other hand, removing the optional dependency from the list can cause build failures, as the test case may include the optional code, but then fail to build as the build system won't have added the necessary paths for header inclusion, or the necessary libraries for linking.

Quoted 6 lines

Resolve this by explicitly providing a list of optional dependencies. Any items in this list will be added to the dependency list if available, but otherwise won't be involved in enable/disable of specific tests.

For the series,

Akhil can you confirm this series works for you?

Thanks!

Signature · 1 line
David Marchand
Tested-by
#7 lore raw

RE: [EXT] Re: [PATCH 1/2] app/test: add support for optional dependencies

Quoted 19 lines
Quoted 2 lines · Bruce Richardson

Some tests make optionally use a component but don't require it for

s/make //

Quoted 12 lines

building. If we include the dependency in the per-file lists, then tests may be unnecessarily omitted, as the dependency is not required. On the other hand, removing the optional dependency from the list can cause build failures, as the test case may include the optional code, but then fail to build as the build system won't have added the necessary paths for header inclusion, or the necessary libraries for linking.

Resolve this by explicitly providing a list of optional dependencies. Any items in this list will be added to the dependency list if available, but otherwise won't be involved in enable/disable of specific tests.

Quoted 6 lines
Quoted 1 line

For the series,

Akhil can you confirm this series works for you?

#8 lore raw

Re: [EXT] Re: [PATCH 1/2] app/test: add support for optional dependencies

Quoted 11 lines · Akhil Goyal
Quoted 11 lines
Quoted 1 line

Some tests make optionally use a component but don't require it for

s/make //

Quoted 7 lines

building. If we include the dependency in the per-file lists, then tests may be unnecessarily omitted, as the dependency is not required. On the other hand, removing the optional dependency from the list can cause build failures, as the test case may include the optional code, but then fail to build as the build system won't have added the necessary paths for header inclusion, or the necessary libraries for linking.

Quoted 8 lines
Quoted 7 lines
Quoted 6 lines

Resolve this by explicitly providing a list of optional dependencies. Any items in this list will be added to the dependency list if available, but otherwise won't be involved in enable/disable of specific tests.

Series applied, thanks for the quick fix Bruce.

Signature · 1 line
David Marchand