X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=test%2Ftest%2Ftest_cryptodev.c;h=cbbdb1518531dc93759649bf463c2c18536e8b6a;hb=84aaaf8e628ab53869c35430013a19e872b77e69;hp=680082f2bf2fbfc335c6054cb65bafb3ced352fe;hpb=6f4eec25653a3d4591eb41047ad0035b358c4cd6;p=dpdk.git diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c index 680082f2bf..cbbdb15185 100644 --- a/test/test/test_cryptodev.c +++ b/test/test/test_cryptodev.c @@ -39,6 +39,7 @@ #include "test_cryptodev_hmac_test_vectors.h" #define VDEV_ARGS_SIZE 100 +#define MAX_NB_SESSIONS 4 static int gbl_driver_id; @@ -428,15 +429,24 @@ testsuite_setup(void) ts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs; ts_params->conf.socket_id = SOCKET_ID_ANY; - unsigned int session_size = rte_cryptodev_get_private_session_size(dev_id); + unsigned int session_size = + rte_cryptodev_sym_get_private_session_size(dev_id); /* * Create mempool with maximum number of sessions * 2, * to include the session headers */ + if (info.sym.max_nb_sessions != 0 && + info.sym.max_nb_sessions < MAX_NB_SESSIONS) { + RTE_LOG(ERR, USER1, "Device does not support " + "at least %u sessions\n", + MAX_NB_SESSIONS); + return TEST_FAILED; + } + ts_params->session_mpool = rte_mempool_create( "test_sess_mp", - info.sym.max_nb_sessions * 2, + MAX_NB_SESSIONS * 2, session_size, 0, 0, NULL, NULL, NULL, NULL, SOCKET_ID_ANY, @@ -584,7 +594,7 @@ test_device_configure_invalid_dev_id(void) dev_id = ts_params->valid_devs[ts_params->valid_dev_count - 1]; /* Stop the device in case it's started so it can be configured */ - rte_cryptodev_stop(ts_params->valid_devs[dev_id]); + rte_cryptodev_stop(dev_id); TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id, &ts_params->conf), "Failed test for rte_cryptodev_configure: " @@ -3150,8 +3160,11 @@ test_kasumi_encryption_sgl(const struct kasumi_test_data *tdata) struct rte_cryptodev_info dev_info; rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); - if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER)) { - printf("Device doesn't support scatter-gather. " + + uint64_t feat_flags = dev_info.feature_flags; + + if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) { + printf("Device doesn't support in-place scatter-gather. " "Test Skipped.\n"); return 0; } @@ -3298,8 +3311,11 @@ test_kasumi_encryption_oop_sgl(const struct kasumi_test_data *tdata) struct rte_cryptodev_info dev_info; rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); - if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER)) { - printf("Device doesn't support scatter-gather. " + + uint64_t feat_flags = dev_info.feature_flags; + if (!(feat_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT)) { + printf("Device doesn't support out-of-place scatter-gather " + "in both input and output mbufs. " "Test Skipped.\n"); return 0; } @@ -3649,8 +3665,12 @@ test_snow3g_encryption_oop_sgl(const struct snow3g_test_data *tdata) struct rte_cryptodev_info dev_info; rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); - if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER)) { - printf("Device doesn't support scatter-gather. " + + uint64_t feat_flags = dev_info.feature_flags; + + if (!(feat_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT)) { + printf("Device doesn't support out-of-place scatter-gather " + "in both input and output mbufs. " "Test Skipped.\n"); return 0; } @@ -4483,10 +4503,13 @@ test_zuc_encryption_sgl(const struct wireless_test_data *tdata) return -ENOTSUP; rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); - if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER)) { - printf("Device doesn't support scatter-gather. " + + uint64_t feat_flags = dev_info.feature_flags; + + if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) { + printf("Device doesn't support in-place scatter-gather. " "Test Skipped.\n"); - return -ENOTSUP; + return 0; } plaintext_len = ceil_byte_length(tdata->plaintext.len); @@ -6498,10 +6521,10 @@ test_multi_session(void) sessions = rte_malloc(NULL, (sizeof(struct rte_cryptodev_sym_session *) * - dev_info.sym.max_nb_sessions) + 1, 0); + MAX_NB_SESSIONS) + 1, 0); /* Create multiple crypto sessions*/ - for (i = 0; i < dev_info.sym.max_nb_sessions; i++) { + for (i = 0; i < MAX_NB_SESSIONS; i++) { sessions[i] = rte_cryptodev_sym_session_create( ts_params->session_mpool); @@ -6550,7 +6573,7 @@ test_multi_session(void) TEST_ASSERT_NULL(sessions[i], "Session creation succeeded unexpectedly!"); - for (i = 0; i < dev_info.sym.max_nb_sessions; i++) { + for (i = 0; i < MAX_NB_SESSIONS; i++) { rte_cryptodev_sym_session_clear(ts_params->valid_devs[0], sessions[i]); rte_cryptodev_sym_session_free(sessions[i]); @@ -6609,13 +6632,13 @@ test_multi_session_random_usage(void) sessions = rte_malloc(NULL, (sizeof(struct rte_cryptodev_sym_session *) - * dev_info.sym.max_nb_sessions) + 1, 0); + * MAX_NB_SESSIONS) + 1, 0); for (i = 0; i < MB_SESSION_NUMBER; i++) { sessions[i] = rte_cryptodev_sym_session_create( ts_params->session_mpool); - rte_memcpy(&ut_paramz[i].ut_params, &testsuite_params, + rte_memcpy(&ut_paramz[i].ut_params, &unittest_params, sizeof(struct crypto_unittest_params)); test_AES_CBC_HMAC_SHA512_decrypt_create_session_params( @@ -8534,8 +8557,17 @@ test_scheduler_attach_slave_op(void) rte_mempool_free(ts_params->session_mpool); ts_params->session_mpool = NULL; } - unsigned int session_size = rte_cryptodev_get_private_session_size(i); + unsigned int session_size = + rte_cryptodev_sym_get_private_session_size(i); + if (info.sym.max_nb_sessions != 0 && + info.sym.max_nb_sessions < MAX_NB_SESSIONS) { + RTE_LOG(ERR, USER1, + "Device does not support " + "at least %u sessions\n", + MAX_NB_SESSIONS); + return TEST_FAILED; + } /* * Create mempool with maximum number of sessions * 2, * to include the session headers @@ -8543,7 +8575,7 @@ test_scheduler_attach_slave_op(void) if (ts_params->session_mpool == NULL) { ts_params->session_mpool = rte_mempool_create( "test_sess_mp", - info.sym.max_nb_sessions * 2, + MAX_NB_SESSIONS * 2, session_size, 0, 0, NULL, NULL, NULL, NULL, SOCKET_ID_ANY, @@ -9906,9 +9938,9 @@ test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/) RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD)); if (gbl_driver_id == -1) { - 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"); + RTE_LOG(ERR, USER1, "QAT PMD must be loaded. Check that both " + "CONFIG_RTE_LIBRTE_PMD_QAT and CONFIG_RTE_LIBRTE_PMD_QAT_SYM " + "are enabled in config file to run this testsuite.\n"); return TEST_SKIPPED; }