[v2] test_compressdev:fix test case skipping due to missing device init

Message ID 20211108123542.404239-1-wuchangsheng2@huawei.com (mailing list archive)
State Rejected, archived
Delegated to: akhil goyal
Headers
Series [v2] test_compressdev:fix test case skipping due to missing device init |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Changsheng Wu Nov. 8, 2021, 12:35 p.m. UTC
  The testsuite_setup function in the compressdev_autotest test case, 
the rte_compressdev_count() return 0 due to the lack of device init. 
It is considered that there is no equitment to skip execution. 
So add rte_vdev_init init compress_zlib device. 

Signed-off-by: Changsheng Wu <wuchangsheng2@huawei.com>
---
 app/test/test_compressdev.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Akhil Goyal Nov. 11, 2021, 11:32 a.m. UTC | #1
> The testsuite_setup function in the compressdev_autotest test case,
> the rte_compressdev_count() return 0 due to the lack of device init.
> It is considered that there is no equitment to skip execution.
> So add rte_vdev_init init compress_zlib device.

Why? Devices can be added as command line argument.
* Use ``--vdev="compress_isal"`` in the EAL options, which will call ``rte_vdev_init()`` internally.
See documentation of compressdevs.

And if at all it is required, why only the zlib, there are other devices as well.


> 
> Signed-off-by: Changsheng Wu <wuchangsheng2@huawei.com>
> ---
>  app/test/test_compressdev.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/app/test/test_compressdev.c b/app/test/test_compressdev.c
> index a1b9f06250..f15fbe7f2d 100644
> --- a/app/test/test_compressdev.c
> +++ b/app/test/test_compressdev.c
> @@ -14,6 +14,7 @@
>  #include <rte_mbuf.h>
>  #include <rte_compressdev.h>
>  #include <rte_string_fns.h>
> +#include <rte_bus_vdev.h>
> 
>  #include "test_compressdev_test_buffer.h"
>  #include "test.h"
> @@ -197,6 +198,11 @@ testsuite_setup(void)
>  	uint32_t max_buf_size = 0;
>  	unsigned int i;
> 
> +	if (rte_vdev_init("compress_zlib", NULL) != 0) {
> +		RTE_LOG(WARNING, USER1, "not find compress_zlib
> device\n");
> +		return TEST_SKIPPED;
> +	}
> +
>  	if (rte_compressdev_count() == 0) {
>  		RTE_LOG(WARNING, USER1, "Need at least one compress
> device\n");
>  		return TEST_SKIPPED;
> --
> 2.27.0
  
Akhil Goyal Nov. 11, 2021, 11:42 a.m. UTC | #2
> > The testsuite_setup function in the compressdev_autotest test case,
> > the rte_compressdev_count() return 0 due to the lack of device init.
> > It is considered that there is no equitment to skip execution.
> > So add rte_vdev_init init compress_zlib device.
> 
> Why? Devices can be added as command line argument.
> * Use ``--vdev="compress_isal"`` in the EAL options, which will call
> ``rte_vdev_init()`` internally.
> See documentation of compressdevs.
> 
> And if at all it is required, why only the zlib, there are other devices as well.
> 
Please mark your previous versions of patches as superseded in patchworks.
It creates confusion when you change the title of the patch.
  

Patch

diff --git a/app/test/test_compressdev.c b/app/test/test_compressdev.c
index a1b9f06250..f15fbe7f2d 100644
--- a/app/test/test_compressdev.c
+++ b/app/test/test_compressdev.c
@@ -14,6 +14,7 @@ 
 #include <rte_mbuf.h>
 #include <rte_compressdev.h>
 #include <rte_string_fns.h>
+#include <rte_bus_vdev.h>
 
 #include "test_compressdev_test_buffer.h"
 #include "test.h"
@@ -197,6 +198,11 @@  testsuite_setup(void)
 	uint32_t max_buf_size = 0;
 	unsigned int i;
 
+	if (rte_vdev_init("compress_zlib", NULL) != 0) {
+		RTE_LOG(WARNING, USER1, "not find compress_zlib device\n");
+		return TEST_SKIPPED;
+	}
+
 	if (rte_compressdev_count() == 0) {
 		RTE_LOG(WARNING, USER1, "Need at least one compress device\n");
 		return TEST_SKIPPED;