pdump: replace constant for device name size
[dpdk.git] / app / test / test_cryptodev.c
index 384b487..8189053 100644 (file)
@@ -2680,6 +2680,9 @@ test_snow3g_authentication(const struct snow3g_hash_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Verify the capabilities */
        struct rte_cryptodev_sym_capability_idx cap_idx;
        cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -2768,6 +2771,9 @@ test_snow3g_authentication_verify(const struct snow3g_hash_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Verify the capabilities */
        struct rte_cryptodev_sym_capability_idx cap_idx;
        cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -2850,6 +2856,9 @@ test_kasumi_authentication(const struct kasumi_hash_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Verify the capabilities */
        struct rte_cryptodev_sym_capability_idx cap_idx;
        cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -2936,6 +2945,9 @@ test_kasumi_authentication_verify(const struct kasumi_hash_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Verify the capabilities */
        struct rte_cryptodev_sym_capability_idx cap_idx;
        cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -3157,6 +3169,9 @@ test_kasumi_encryption(const struct kasumi_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Verify the capabilities */
        struct rte_cryptodev_sym_capability_idx cap_idx;
        cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
@@ -3265,6 +3280,9 @@ test_kasumi_encryption_sgl(const struct kasumi_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Create KASUMI session */
        retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
                                        RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -3349,6 +3367,9 @@ test_kasumi_encryption_oop(const struct kasumi_test_data *tdata)
        if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
                return -ENOTSUP;
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Create KASUMI session */
        retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
                                        RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -3433,6 +3454,9 @@ test_kasumi_encryption_oop_sgl(const struct kasumi_test_data *tdata)
        if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
                return -ENOTSUP;
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
        uint64_t feat_flags = dev_info.feature_flags;
@@ -3521,6 +3545,9 @@ test_kasumi_decryption_oop(const struct kasumi_test_data *tdata)
        if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
                return -ENOTSUP;
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Create KASUMI session */
        retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
                                        RTE_CRYPTO_CIPHER_OP_DECRYPT,
@@ -3600,6 +3627,9 @@ test_kasumi_decryption(const struct kasumi_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Verify the capabilities */
        struct rte_cryptodev_sym_capability_idx cap_idx;
        cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
@@ -3689,6 +3719,9 @@ test_snow3g_encryption(const struct snow3g_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Verify the capabilities */
        struct rte_cryptodev_sym_capability_idx cap_idx;
        cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
@@ -3778,6 +3811,9 @@ test_snow3g_encryption_oop(const struct snow3g_test_data *tdata)
        if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
                return -ENOTSUP;
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Create SNOW 3G session */
        retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
                                        RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -3864,6 +3900,9 @@ test_snow3g_encryption_oop_sgl(const struct snow3g_test_data *tdata)
        if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
                return -ENOTSUP;
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
        uint64_t feat_flags = dev_info.feature_flags;
@@ -3986,6 +4025,9 @@ test_snow3g_encryption_offset_oop(const struct snow3g_test_data *tdata)
        if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
                return -ENOTSUP;
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Create SNOW 3G session */
        retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
                                        RTE_CRYPTO_CIPHER_OP_ENCRYPT,
@@ -4087,6 +4129,9 @@ static int test_snow3g_decryption(const struct snow3g_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Verify the capabilities */
        struct rte_cryptodev_sym_capability_idx cap_idx;
        cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
@@ -4173,6 +4218,9 @@ static int test_snow3g_decryption_oop(const struct snow3g_test_data *tdata)
        if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
                return -ENOTSUP;
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Create SNOW 3G session */
        retval = create_wireless_algo_cipher_session(ts_params->valid_devs[0],
                                        RTE_CRYPTO_CIPHER_OP_DECRYPT,
@@ -4266,6 +4314,9 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Check if device supports ZUC EEA3 */
        cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
        cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_ZUC_EEA3;
@@ -4364,6 +4415,9 @@ test_snow3g_cipher_auth(const struct snow3g_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Verify the capabilities */
        struct rte_cryptodev_sym_capability_idx cap_idx;
        cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -4481,6 +4535,9 @@ test_snow3g_auth_cipher(const struct snow3g_test_data *tdata,
                        &cap_idx) == NULL)
                return -ENOTSUP;
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
        uint64_t feat_flags = dev_info.feature_flags;
@@ -4670,6 +4727,9 @@ test_snow3g_auth_cipher_sgl(const struct snow3g_test_data *tdata,
                        &cap_idx) == NULL)
                return -ENOTSUP;
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
        uint64_t feat_flags = dev_info.feature_flags;
@@ -4884,6 +4944,9 @@ test_kasumi_auth_cipher(const struct kasumi_test_data *tdata,
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        if (op_mode == OUT_OF_PLACE) {
                if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
                        return -ENOTSUP;
@@ -5065,6 +5128,9 @@ test_kasumi_auth_cipher_sgl(const struct kasumi_test_data *tdata,
                        &cap_idx) == NULL)
                return -ENOTSUP;
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
        uint64_t feat_flags = dev_info.feature_flags;
@@ -5261,6 +5327,9 @@ test_kasumi_cipher_auth(const struct kasumi_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Verify the capabilities */
        struct rte_cryptodev_sym_capability_idx cap_idx;
        cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
@@ -5374,6 +5443,9 @@ test_zuc_encryption(const struct wireless_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        struct rte_cryptodev_sym_capability_idx cap_idx;
 
        /* Check if device supports ZUC EEA3 */
@@ -5466,6 +5538,9 @@ test_zuc_encryption_sgl(const struct wireless_test_data *tdata)
                        &cap_idx) == NULL)
                return -ENOTSUP;
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
 
        uint64_t feat_flags = dev_info.feature_flags;
@@ -5572,6 +5647,9 @@ test_zuc_authentication(const struct wireless_test_data *tdata)
                return -ENOTSUP;
        }
 
+       if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
+               return -ENOTSUP;
+
        /* Check if device supports ZUC EIA3 */
        cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
        cap_idx.algo.auth = RTE_CRYPTO_AUTH_ZUC_EIA3;
@@ -6676,6 +6754,7 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
        unsigned int ciphertext_len;
 
        struct rte_cryptodev_info dev_info;
+       struct rte_crypto_op *op;
 
        /* Check if device supports particular algorithms separately */
        if (test_mixed_check_if_unsupported(tdata))
@@ -6692,9 +6771,6 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
                return -ENOTSUP;
        }
 
-       if (op_mode == OUT_OF_PLACE)
-               return -ENOTSUP;
-
        /* Create the session */
        if (verify)
                retval = create_wireless_algo_cipher_auth_session(
@@ -6771,17 +6847,17 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,
        if (retval < 0)
                return retval;
 
-       ut_params->op = process_crypto_request(ts_params->valid_devs[0],
-                       ut_params->op);
+       op = process_crypto_request(ts_params->valid_devs[0], ut_params->op);
 
        /* Check if the op failed because the device doesn't */
        /* support this particular combination of algorithms */
-       if (ut_params->op == NULL && ut_params->op->status ==
+       if (op == NULL && ut_params->op->status ==
                        RTE_CRYPTO_OP_STATUS_INVALID_SESSION) {
                printf("Device doesn't support this mixed combination. "
                                "Test Skipped.\n");
                return -ENOTSUP;
        }
+       ut_params->op = op;
 
        TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf");
 
@@ -6872,6 +6948,7 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
        uint8_t digest_buffer[10000];
 
        struct rte_cryptodev_info dev_info;
+       struct rte_crypto_op *op;
 
        /* Check if device supports particular algorithms */
        if (test_mixed_check_if_unsupported(tdata))
@@ -6976,17 +7053,17 @@ test_mixed_auth_cipher_sgl(const struct mixed_cipher_auth_test_data *tdata,
        if (retval < 0)
                return retval;
 
-       ut_params->op = process_crypto_request(ts_params->valid_devs[0],
-                       ut_params->op);
+       op = process_crypto_request(ts_params->valid_devs[0], ut_params->op);
 
        /* Check if the op failed because the device doesn't */
        /* support this particular combination of algorithms */
-       if (ut_params->op == NULL && ut_params->op->status ==
+       if (op == NULL && ut_params->op->status ==
                        RTE_CRYPTO_OP_STATUS_INVALID_SESSION) {
                printf("Device doesn't support this mixed combination. "
                                "Test Skipped.\n");
                return -ENOTSUP;
        }
+       ut_params->op = op;
 
        TEST_ASSERT_NOT_NULL(ut_params->op, "failed to retrieve obuf");
 
@@ -11069,8 +11146,8 @@ test_AES_GMAC_authentication_SGL(const struct gmac_test_data *tdata,
        rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
        feature_flags = dev_info.feature_flags;
 
-       if ((!(feature_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) &&
-                       (!(feature_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT)) &&
+       if ((!(feature_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) ||
+                       (!(feature_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT)) ||
                        (!(feature_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT)))
                return -ENOTSUP;
 
@@ -14022,9 +14099,7 @@ test_cryptodev_qat_raw_api(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 that both "
-               "CONFIG_RTE_LIBRTE_PMD_QAT and CONFIG_RTE_LIBRTE_PMD_QAT_SYM "
-               "are enabled in config file to run this testsuite.\n");
+               RTE_LOG(ERR, USER1, "QAT PMD must be loaded.\n");
                return TEST_SKIPPED;
        }