test_compressdev:fix test case skipping due to missing device init
PATCH v2 1/1 test_compressdev:fix test case skipping due to missing device init
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.
--- app/test/test_compressdev.c | 6 ++++++ 1 file changed, 6 insertions(+)
app/test/test_compressdev.c +6 -0
@@ -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 ;
Signature · 1 line
2.27.0
Quoted 4 lines
The
testsuite_setupfunction in thecompressdev_autotesttest case, therte_compressdev_count()return 0 due to the lack of device init. It is considered that there is no equitment to skip execution. So addrte_vdev_initinitcompress_zlibdevice.
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.
Quoted 34 lines
Signed-off-by Changsheng Wu <[email protected]>--- app/test/test_compressdev.c | 6 ++++++ 1 file changed, 6 insertions(+)app/test/test_compressdev.c +6
-0@@ -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 compressdevice\n");
returnTEST_SKIPPED;
--
2.27.0
Quoted 7 lines
Quoted 6 lines
The
testsuite_setupfunction in thecompressdev_autotesttest case, therte_compressdev_count()return 0 due to the lack of device init. It is considered that there is no equitment to skip execution. So addrte_vdev_initinitcompress_zlibdevice.
Quoted 7 lines
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.