test/crypto: add dpaa crypto test cases
authorAkhil Goyal <akhil.goyal@nxp.com>
Mon, 9 Oct 2017 14:21:41 +0000 (19:51 +0530)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Thu, 12 Oct 2017 14:22:39 +0000 (15:22 +0100)
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
test/test/test_cryptodev.c
test/test/test_cryptodev_aes_test_vectors.h
test/test/test_cryptodev_blockcipher.c
test/test/test_cryptodev_blockcipher.h
test/test/test_cryptodev_des_test_vectors.h
test/test/test_cryptodev_hash_test_vectors.h

index 8be8e57..df84430 100644 (file)
@@ -1767,6 +1767,63 @@ test_AES_cipheronly_qat_all(void)
        return TEST_SUCCESS;
 }
 
+static int
+test_AES_chain_dpaa_sec_all(void)
+{
+       struct crypto_testsuite_params *ts_params = &testsuite_params;
+       int status;
+
+       status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+               ts_params->op_mpool,
+               ts_params->session_mpool,
+               ts_params->valid_devs[0],
+               rte_cryptodev_driver_id_get(
+               RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD)),
+               BLKCIPHER_AES_CHAIN_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
+static int
+test_AES_cipheronly_dpaa_sec_all(void)
+{
+       struct crypto_testsuite_params *ts_params = &testsuite_params;
+       int status;
+
+       status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+               ts_params->op_mpool,
+               ts_params->session_mpool,
+               ts_params->valid_devs[0],
+               rte_cryptodev_driver_id_get(
+               RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD)),
+               BLKCIPHER_AES_CIPHERONLY_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
+static int
+test_authonly_dpaa_sec_all(void)
+{
+       struct crypto_testsuite_params *ts_params = &testsuite_params;
+       int status;
+
+       status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+               ts_params->op_mpool,
+               ts_params->session_mpool,
+               ts_params->valid_devs[0],
+               rte_cryptodev_driver_id_get(
+               RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD)),
+               BLKCIPHER_AUTHONLY_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
 static int
 test_AES_chain_dpaa2_sec_all(void)
 {
@@ -4747,6 +4804,44 @@ test_DES_docsis_mb_all(void)
        return TEST_SUCCESS;
 }
 
+static int
+test_3DES_chain_dpaa_sec_all(void)
+{
+       struct crypto_testsuite_params *ts_params = &testsuite_params;
+       int status;
+
+       status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+               ts_params->op_mpool,
+               ts_params->session_mpool,
+               ts_params->valid_devs[0],
+               rte_cryptodev_driver_id_get(
+               RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD)),
+               BLKCIPHER_3DES_CHAIN_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
+static int
+test_3DES_cipheronly_dpaa_sec_all(void)
+{
+       struct crypto_testsuite_params *ts_params = &testsuite_params;
+       int status;
+
+       status = test_blockcipher_all_tests(ts_params->mbuf_pool,
+               ts_params->op_mpool,
+               ts_params->session_mpool,
+               ts_params->valid_devs[0],
+               rte_cryptodev_driver_id_get(
+               RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD)),
+               BLKCIPHER_3DES_CIPHERONLY_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
 static int
 test_3DES_chain_dpaa2_sec_all(void)
 {
@@ -9073,6 +9168,95 @@ static struct unit_test_suite cryptodev_sw_zuc_testsuite  = {
        }
 };
 
+static struct unit_test_suite cryptodev_dpaa_sec_testsuite  = {
+       .suite_name = "Crypto DPAA_SEC Unit Test Suite",
+       .setup = testsuite_setup,
+       .teardown = testsuite_teardown,
+       .unit_test_cases = {
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                            test_device_configure_invalid_dev_id),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                            test_multi_session),
+
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                            test_AES_chain_dpaa_sec_all),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                            test_3DES_chain_dpaa_sec_all),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                            test_AES_cipheronly_dpaa_sec_all),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                            test_3DES_cipheronly_dpaa_sec_all),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                            test_authonly_dpaa_sec_all),
+
+               /** AES GCM Authenticated Encryption */
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_encryption_test_case_1),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_encryption_test_case_2),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_encryption_test_case_3),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_encryption_test_case_4),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_encryption_test_case_5),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_encryption_test_case_6),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_encryption_test_case_7),
+
+               /** AES GCM Authenticated Decryption */
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_decryption_test_case_1),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_decryption_test_case_2),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_decryption_test_case_3),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_decryption_test_case_4),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_decryption_test_case_5),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_decryption_test_case_6),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_authenticated_decryption_test_case_7),
+
+               /** AES GCM Authenticated Encryption 256 bits key */
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_encryption_test_case_256_1),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_encryption_test_case_256_2),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_encryption_test_case_256_3),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_encryption_test_case_256_4),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_encryption_test_case_256_5),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_encryption_test_case_256_6),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_encryption_test_case_256_7),
+
+               /** AES GCM Authenticated Decryption 256 bits key */
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_decryption_test_case_256_1),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_decryption_test_case_256_2),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_decryption_test_case_256_3),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_decryption_test_case_256_4),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_decryption_test_case_256_5),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_decryption_test_case_256_6),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                       test_AES_GCM_auth_decryption_test_case_256_7),
+
+               TEST_CASES_END() /**< NULL terminate unit test array */
+       }
+};
+
 static struct unit_test_suite cryptodev_dpaa2_sec_testsuite  = {
        .suite_name = "Crypto DPAA2_SEC Unit Test Suite",
        .setup = testsuite_setup,
@@ -9421,6 +9605,22 @@ test_cryptodev_dpaa2_sec(void /*argv __rte_unused, int argc __rte_unused*/)
        return unit_test_suite_runner(&cryptodev_dpaa2_sec_testsuite);
 }
 
+static int
+test_cryptodev_dpaa_sec(void /*argv __rte_unused, int argc __rte_unused*/)
+{
+       gbl_driver_id = rte_cryptodev_driver_id_get(
+                       RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD));
+
+       if (gbl_driver_id == -1) {
+               RTE_LOG(ERR, USER1, "DPAA SEC PMD must be loaded. Check if "
+                               "CONFIG_RTE_LIBRTE_PMD_DPAA_SEC is enabled "
+                               "in config file to run this testsuite.\n");
+               return TEST_FAILED;
+       }
+
+       return unit_test_suite_runner(&cryptodev_dpaa_sec_testsuite);
+}
+
 REGISTER_TEST_COMMAND(cryptodev_qat_autotest, test_cryptodev_qat);
 REGISTER_TEST_COMMAND(cryptodev_aesni_mb_autotest, test_cryptodev_aesni_mb);
 REGISTER_TEST_COMMAND(cryptodev_openssl_autotest, test_cryptodev_openssl);
@@ -9431,3 +9631,4 @@ REGISTER_TEST_COMMAND(cryptodev_sw_kasumi_autotest, test_cryptodev_sw_kasumi);
 REGISTER_TEST_COMMAND(cryptodev_sw_zuc_autotest, test_cryptodev_sw_zuc);
 REGISTER_TEST_COMMAND(cryptodev_sw_armv8_autotest, test_cryptodev_armv8);
 REGISTER_TEST_COMMAND(cryptodev_dpaa2_sec_autotest, test_cryptodev_dpaa2_sec);
+REGISTER_TEST_COMMAND(cryptodev_dpaa_sec_autotest, test_cryptodev_dpaa_sec);
index e410018..0c7e48f 100644 (file)
@@ -1197,7 +1197,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CTR HMAC-SHA1 Decryption Digest "
@@ -1208,7 +1209,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-192-CTR XCBC Encryption Digest",
@@ -1245,7 +1247,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-256-CTR HMAC-SHA1 Decryption Digest "
@@ -1256,7 +1259,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CBC HMAC-SHA1 Encryption Digest",
@@ -1267,7 +1271,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CBC HMAC-SHA1 Encryption Digest "
@@ -1298,7 +1303,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CBC HMAC-SHA1 Decryption Digest "
@@ -1316,7 +1322,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CBC HMAC-SHA256 Encryption Digest "
@@ -1335,7 +1342,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CBC HMAC-SHA256 Decryption Digest "
@@ -1352,7 +1360,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CBC HMAC-SHA512 Encryption Digest "
@@ -1383,7 +1392,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CBC HMAC-SHA512 Decryption Digest "
@@ -1441,7 +1451,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CBC HMAC-SHA224 Decryption Digest "
@@ -1452,7 +1463,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CBC HMAC-SHA384 Encryption Digest",
@@ -1462,7 +1474,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CBC HMAC-SHA384 Decryption Digest "
@@ -1473,7 +1486,8 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CBC HMAC-SHA1 Encryption Digest "
@@ -1505,7 +1519,8 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CBC Decryption",
@@ -1515,7 +1530,8 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-192-CBC Encryption",
@@ -1525,7 +1541,8 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-192-CBC Encryption Scater gather",
@@ -1543,7 +1560,8 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-256-CBC Encryption",
@@ -1553,7 +1571,8 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-256-CBC Decryption",
@@ -1563,7 +1582,8 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-256-CBC OOP Encryption",
@@ -1589,7 +1609,8 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CTR Decryption",
@@ -1599,7 +1620,8 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-192-CTR Encryption",
@@ -1609,7 +1631,8 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-192-CTR Decryption",
@@ -1619,7 +1642,8 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-256-CTR Encryption",
@@ -1629,7 +1653,8 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-256-CTR Decryption",
@@ -1639,7 +1664,8 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "AES-128-CTR Encryption (12-byte IV)",
index 89b02e5..167d196 100644 (file)
@@ -92,6 +92,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
                        RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
        int dpaa2_sec_pmd = rte_cryptodev_driver_id_get(
                        RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD));
+       int dpaa_sec_pmd = rte_cryptodev_driver_id_get(
+                       RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD));
 
        int nb_segs = 1;
 
@@ -114,6 +116,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
                        tdata->auth_key.len);
 
        if (driver_id == dpaa2_sec_pmd ||
+                       driver_id == dpaa_sec_pmd ||
                        driver_id == qat_pmd ||
                        driver_id == openssl_pmd ||
                        driver_id == armv8_pmd) { /* Fall through */
@@ -579,6 +582,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
                        RTE_STR(CRYPTODEV_NAME_OPENSSL_PMD));
        int dpaa2_sec_pmd = rte_cryptodev_driver_id_get(
                        RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD));
+       int dpaa_sec_pmd = rte_cryptodev_driver_id_get(
+                       RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD));
        int scheduler_pmd = rte_cryptodev_driver_id_get(
                        RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD));
        int armv8_pmd = rte_cryptodev_driver_id_get(
@@ -645,6 +650,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
                target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER;
        else if (driver_id == dpaa2_sec_pmd)
                target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC;
+       else if (driver_id == dpaa_sec_pmd)
+               target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC;
        else
                TEST_ASSERT(0, "Unrecognized cryptodev type");
 
index 22b8d20..b81e559 100644 (file)
@@ -53,6 +53,7 @@
 #define BLOCKCIPHER_TEST_TARGET_PMD_ARMV8      0x0008 /* ARMv8 flag */
 #define BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER  0x0010 /* Scheduler */
 #define BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC  0x0020 /* DPAA2_SEC flag */
+#define BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC   0x0040 /* DPAA_SEC flag */
 
 #define BLOCKCIPHER_TEST_OP_CIPHER     (BLOCKCIPHER_TEST_OP_ENCRYPT | \
                                        BLOCKCIPHER_TEST_OP_DECRYPT)
index bb01246..ebf8869 100644 (file)
@@ -1069,7 +1069,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
                .op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "3DES-128-CBC HMAC-SHA1 Decryption Digest Verify",
@@ -1077,7 +1078,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
                .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "3DES-128-CBC SHA1 Encryption Digest",
@@ -1097,7 +1099,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
                .op_mask = BLOCKCIPHER_TEST_OP_ENC_AUTH_GEN,
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "3DES-192-CBC HMAC-SHA1 Decryption Digest Verify",
@@ -1105,7 +1108,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
                .op_mask = BLOCKCIPHER_TEST_OP_AUTH_VERIFY_DEC,
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "3DES-192-CBC SHA1 Encryption Digest",
@@ -1214,7 +1218,8 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
                .op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "3DES-128-CBC Decryption",
@@ -1222,7 +1227,8 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
                .op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "3DES-192-CBC Encryption",
@@ -1230,7 +1236,8 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
                .op_mask = BLOCKCIPHER_TEST_OP_ENCRYPT,
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "3DES-192-CBC Decryption",
@@ -1238,7 +1245,8 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
                .op_mask = BLOCKCIPHER_TEST_OP_DECRYPT,
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
        },
        {
                .test_descr = "3DES-128-CTR Encryption",
index b7fe9d9..3b840ce 100644 (file)
@@ -368,6 +368,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
        {
@@ -378,6 +379,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
        {
@@ -400,6 +402,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
        {
@@ -410,6 +413,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
        {
@@ -432,6 +436,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
        {
@@ -442,6 +447,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
        {
@@ -464,6 +470,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
        {
@@ -474,6 +481,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
        {
@@ -496,6 +504,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
        {
@@ -506,6 +515,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
        {
@@ -528,6 +538,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
        {
@@ -538,6 +549,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT
        },
 };