Hi Fiona/Adam, > This patch adds a new test suite for verification of the "internal > QAT IM buffer too small" case handling. These unit tests are > specific to the QAT PMD only - that's why they are contained in > a separate test suite. > > Signed-off-by: Adam Dybkowski <adamx.dybkow...@intel.com> > ---
Why do we need to have separate testsuite for QAT? Can't we have a single one and based on capability of the driver, Determine which tests need to be skipped in case they are not supported. This would create a mess in the longer run just like cryptodev. Please fix this, we cannot take this patch as is. > + > +static struct unit_test_suite compressdev_testsuite = { > + .suite_name = "compressdev unit test suite", > + .setup = testsuite_setup, > + .teardown = testsuite_teardown, > + .unit_test_cases = { > + TEST_CASE_ST(NULL, NULL, > + test_compressdev_invalid_configuration), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_stateless_fixed), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_stateless_dynamic), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_stateless_dynamic_big), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_stateless_multi_op), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_stateless_multi_level), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_stateless_multi_xform), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_stateless_sgl), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_stateless_checksum), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_out_of_space_buffer), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_stateful_decomp), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + > test_compressdev_deflate_stateful_decomp_checksum), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_external_mbufs), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_stateless_fixed_oos_recoverable), > + TEST_CASES_END() /**< NULL terminate unit test array */ > + } > +}; > + > +/**********************************/ > + > +static struct unit_test_suite compressdev_testsuite_qat = { > + .suite_name = "compressdev unit test suite for QAT PMD", > + .setup = testsuite_setup, > + .teardown = testsuite_teardown, > + .unit_test_cases = { > + /* Positive test cases for IM buffer handling verification */ > + > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_im_buffers_LB_1op), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_im_buffers_LB_2ops_first), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + > test_compressdev_deflate_im_buffers_LB_2ops_second), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_im_buffers_LB_3ops), > + > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_im_buffers_LB_4ops), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_im_buffers_SGL_1op), > + > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_im_buffers_SGL_2ops_first), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + > test_compressdev_deflate_im_buffers_SGL_2ops_second), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_im_buffers_SGL_3ops), > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_im_buffers_SGL_4ops), > + > + /* Negative test cases for IM buffer handling verification */ > + > + /* For this test huge mempool is necessary. > + * It tests one case: > + * only one op containing big amount of data, so that > + * number of requested descriptors higher than number > + * of available descriptors (128) > + */ > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + test_compressdev_deflate_im_buffers_SGL_over_1op), > + > + /* For this test huge mempool is necessary. > + * 2 ops. First op contains big amount of data: > + * number of requested descriptors higher than number > + * of available descriptors (128), the second op is > + * relatively small. In this case both ops are rejected > + */ > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + > test_compressdev_deflate_im_buffers_SGL_over_2ops_first), > + > + TEST_CASE_ST(generic_ut_setup, generic_ut_teardown, > + > test_compressdev_deflate_im_buffers_SGL_over_2ops_second), > + > + TEST_CASES_END() /**< NULL terminate unit test array */ > + } > +}; > + > +static int > +test_compressdev(void) > +{ > + testsuite_params.suite_name = compressdev_testsuite.suite_name; > + return unit_test_suite_runner(&compressdev_testsuite); > +} > + > +static int > +test_compressdev_qat_specific(void) > +{ > + /* All tests are run on device 0. Check if it's QAT PMD. */ > + if (rte_compressdev_count() == 0 || > + !ENDS_WITH(rte_compressdev_name_get(0), > "qat_comp")) { > + RTE_LOG(ERR, USER1, "QAT PMD must be loaded. Check if " > + "CONFIG_RTE_LIBRTE_PMD_QAT is enabled " > + "in config file to run this testsuite.\n"); > + return TEST_FAILED; > + } > + > + testsuite_params.suite_name = compressdev_testsuite_qat.suite_name; > + return unit_test_suite_runner(&compressdev_testsuite_qat); > } > > REGISTER_TEST_COMMAND(compressdev_autotest, test_compressdev); > +REGISTER_TEST_COMMAND(compressdev_qat_specific, > test_compressdev_qat_specific); > -- > 2.17.1