test/crypto: add CAAM JR validation cases
authorHemant Agrawal <hemant.agrawal@nxp.com>
Tue, 16 Oct 2018 09:47:53 +0000 (09:47 +0000)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 17 Oct 2018 10:23:40 +0000 (12:23 +0200)
This patch adds the validation test cases for
CAAM JR driver

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Akhil Goyal <akhil.goyal@nxp.com>
test/test/test_cryptodev.c
test/test/test_cryptodev.h
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 32600de..84065eb 100644 (file)
@@ -1876,6 +1876,64 @@ test_AES_cipheronly_virtio_all(void)
        return TEST_SUCCESS;
 }
 
+static int
+test_AES_chain_caam_jr_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_CAAM_JR_PMD)),
+               BLKCIPHER_AES_CHAIN_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
+static int
+test_AES_cipheronly_caam_jr_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_CAAM_JR_PMD)),
+               BLKCIPHER_AES_CIPHERONLY_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
+static int
+test_authonly_caam_jr_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_CAAM_JR_PMD)),
+               BLKCIPHER_AUTHONLY_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
+
 static int
 test_AES_chain_dpaa_sec_all(void)
 {
@@ -5148,6 +5206,44 @@ test_DES_docsis_mb_all(void)
        return TEST_SUCCESS;
 }
 
+static int
+test_3DES_chain_caam_jr_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_CAAM_JR_PMD)),
+               BLKCIPHER_3DES_CHAIN_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
+static int
+test_3DES_cipheronly_caam_jr_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_CAAM_JR_PMD)),
+               BLKCIPHER_3DES_CIPHERONLY_TYPE);
+
+       TEST_ASSERT_EQUAL(status, 0, "Test failed");
+
+       return TEST_SUCCESS;
+}
+
 static int
 test_3DES_chain_dpaa_sec_all(void)
 {
@@ -9808,6 +9904,31 @@ static struct unit_test_suite cryptodev_sw_zuc_testsuite  = {
        }
 };
 
+static struct unit_test_suite cryptodev_caam_jr_testsuite  = {
+       .suite_name = "Crypto CAAM JR 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_caam_jr_all),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                            test_3DES_chain_caam_jr_all),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                            test_AES_cipheronly_caam_jr_all),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                            test_3DES_cipheronly_caam_jr_all),
+               TEST_CASE_ST(ut_setup, ut_teardown,
+                            test_authonly_caam_jr_all),
+
+               TEST_CASES_END() /**< NULL terminate unit test array */
+       }
+};
+
 static struct unit_test_suite cryptodev_dpaa_sec_testsuite  = {
        .suite_name = "Crypto DPAA_SEC Unit Test Suite",
        .setup = testsuite_setup,
@@ -10634,6 +10755,22 @@ test_cryptodev_octeontx(void)
        return unit_test_suite_runner(&cryptodev_octeontx_testsuite);
 }
 
+static int
+test_cryptodev_caam_jr(void /*argv __rte_unused, int argc __rte_unused*/)
+{
+       gbl_driver_id = rte_cryptodev_driver_id_get(
+                       RTE_STR(CRYPTODEV_NAME_CAAM_JR_PMD));
+
+       if (gbl_driver_id == -1) {
+               RTE_LOG(ERR, USER1, "CAAM_JR PMD must be loaded. Check if "
+                               "CONFIG_RTE_LIBRTE_PMD_CAAM_JR is enabled "
+                               "in config file to run this testsuite.\n");
+               return TEST_FAILED;
+       }
+
+       return unit_test_suite_runner(&cryptodev_caam_jr_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);
@@ -10649,3 +10786,4 @@ REGISTER_TEST_COMMAND(cryptodev_dpaa_sec_autotest, test_cryptodev_dpaa_sec);
 REGISTER_TEST_COMMAND(cryptodev_ccp_autotest, test_cryptodev_ccp);
 REGISTER_TEST_COMMAND(cryptodev_virtio_autotest, test_cryptodev_virtio);
 REGISTER_TEST_COMMAND(cryptodev_octeontx_autotest, test_cryptodev_octeontx);
+REGISTER_TEST_COMMAND(cryptodev_caam_jr_autotest, test_cryptodev_caam_jr);
index f2d41ae..a73a49e 100644 (file)
@@ -65,6 +65,7 @@
 #define CRYPTODEV_NAME_CCP_PMD         crypto_ccp
 #define CRYPTODEV_NAME_VIRTIO_PMD      crypto_virtio
 #define CRYPTODEV_NAME_OCTEONTX_SYM_PMD        crypto_octeontx
+#define CRYPTODEV_NAME_CAAM_JR_PMD     crypto_caam_jr
 
 /**
  * Write (spread) data from buffer to mbuf data
index 5db46f4..fff28bc 100644 (file)
@@ -1171,6 +1171,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP
        },
@@ -1185,6 +1186,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP
        },
@@ -1225,6 +1227,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP
        },
@@ -1239,6 +1242,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP
        },
@@ -1253,6 +1257,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -1279,6 +1284,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
        },
        {
@@ -1293,6 +1299,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -1305,6 +1312,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                .feature_mask = BLOCKCIPHER_TEST_FEATURE_SG,
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                            BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                           BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                            BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
        },
        {
@@ -1327,6 +1335,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -1375,6 +1384,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -1413,6 +1423,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -1459,6 +1470,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
        },
        {
@@ -1472,6 +1484,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
        },
        {
@@ -1484,6 +1497,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
        },
@@ -1498,6 +1512,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
        },
@@ -1511,6 +1526,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP
        },
@@ -1525,6 +1541,7 @@ static const struct blockcipher_test_case aes_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP
        },
@@ -1564,6 +1581,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO |
@@ -1579,6 +1597,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO |
@@ -1594,6 +1613,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -1607,6 +1627,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
        },
        {
@@ -1619,6 +1640,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -1630,6 +1652,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                .feature_mask = BLOCKCIPHER_TEST_FEATURE_SG,
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
        },
        {
@@ -1642,6 +1665,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO |
@@ -1657,6 +1681,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO |
@@ -1671,6 +1696,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO
        },
@@ -1683,6 +1709,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO
        },
@@ -1696,6 +1723,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -1710,6 +1738,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -1724,6 +1753,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
        },
@@ -1737,6 +1767,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
        },
@@ -1750,6 +1781,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -1764,6 +1796,7 @@ static const struct blockcipher_test_case aes_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
index 6df1321..1c3f29f 100644 (file)
@@ -68,6 +68,8 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
                        RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD));
        int dpaa_sec_pmd = rte_cryptodev_driver_id_get(
                        RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD));
+       int caam_jr_pmd = rte_cryptodev_driver_id_get(
+                       RTE_STR(CRYPTODEV_NAME_CAAM_JR_PMD));
        int mrvl_pmd = rte_cryptodev_driver_id_get(
                        RTE_STR(CRYPTODEV_NAME_MVSAM_PMD));
        int virtio_pmd = rte_cryptodev_driver_id_get(
@@ -111,6 +113,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 
        if (driver_id == dpaa2_sec_pmd ||
                        driver_id == dpaa_sec_pmd ||
+                       driver_id == caam_jr_pmd ||
                        driver_id == qat_pmd ||
                        driver_id == openssl_pmd ||
                        driver_id == armv8_pmd ||
@@ -631,6 +634,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
                        RTE_STR(CRYPTODEV_NAME_DPAA2_SEC_PMD));
        int dpaa_sec_pmd = rte_cryptodev_driver_id_get(
                        RTE_STR(CRYPTODEV_NAME_DPAA_SEC_PMD));
+       int caam_jr_pmd = rte_cryptodev_driver_id_get(
+                       RTE_STR(CRYPTODEV_NAME_CAAM_JR_PMD));
        int scheduler_pmd = rte_cryptodev_driver_id_get(
                        RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD));
        int armv8_pmd = rte_cryptodev_driver_id_get(
@@ -707,6 +712,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
                target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_CCP;
        else if (driver_id == dpaa_sec_pmd)
                target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC;
+       else if (driver_id == caam_jr_pmd)
+               target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR;
        else if (driver_id == mrvl_pmd)
                target_pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_MVSAM;
        else if (driver_id == virtio_pmd)
index 57e678f..f8bd858 100644 (file)
@@ -30,6 +30,7 @@
 #define BLOCKCIPHER_TEST_TARGET_PMD_CCP                0x0040 /* CCP flag */
 #define BLOCKCIPHER_TEST_TARGET_PMD_VIRTIO     0x0200 /* VIRTIO flag */
 #define BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX   0x0100 /* OCTEON TX flag */
+#define BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR    0x0400 /* CAAM_JR flag */
 
 #define BLOCKCIPHER_TEST_OP_CIPHER     (BLOCKCIPHER_TEST_OP_ENCRYPT | \
                                        BLOCKCIPHER_TEST_OP_DECRYPT)
index 0789881..f1b8cbd 100644 (file)
@@ -1069,6 +1069,7 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP
        },
        {
@@ -1079,6 +1080,7 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP
        },
        {
@@ -1103,6 +1105,7 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -1115,6 +1118,7 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -1195,7 +1199,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR
        },
        {
                .test_descr = "3DES-128-CBC HMAC-SHA1 Decryption Digest"
@@ -1206,7 +1211,8 @@ static const struct blockcipher_test_case triple_des_chain_test_cases[] = {
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_OPENSSL |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
-                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC
+                       BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR
        },
        {
                .test_descr = "3DES-128-CBC HMAC-SHA1 Encryption Digest"
@@ -1254,6 +1260,7 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB
        },
@@ -1265,6 +1272,7 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB
        },
@@ -1276,6 +1284,7 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
@@ -1289,6 +1298,7 @@ static const struct blockcipher_test_case triple_des_cipheronly_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_MB |
index af1e29e..a02dfb3 100644 (file)
@@ -393,6 +393,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -406,6 +407,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -437,6 +439,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
@@ -449,6 +452,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                .feature_mask = BLOCKCIPHER_TEST_FEATURE_SG,
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                            BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                           BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                            BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
        },
        {
@@ -460,6 +464,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
@@ -472,6 +477,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                .feature_mask = BLOCKCIPHER_TEST_FEATURE_SG,
                .pmd_mask = BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                            BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                           BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                            BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
        },
        {
@@ -501,6 +507,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -514,6 +521,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_OCTEONTX
@@ -545,6 +553,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
@@ -559,6 +568,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
@@ -591,6 +601,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
@@ -605,6 +616,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
@@ -637,6 +649,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |
@@ -651,6 +664,7 @@ static const struct blockcipher_test_case hash_test_cases[] = {
                        BLOCKCIPHER_TEST_TARGET_PMD_SCHEDULER |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA2_SEC |
                        BLOCKCIPHER_TEST_TARGET_PMD_DPAA_SEC |
+                       BLOCKCIPHER_TEST_TARGET_PMD_CAAM_JR |
                        BLOCKCIPHER_TEST_TARGET_PMD_QAT |
                        BLOCKCIPHER_TEST_TARGET_PMD_CCP |
                        BLOCKCIPHER_TEST_TARGET_PMD_MVSAM |