pdump: replace constant for device name size
[dpdk.git] / app / test / test_cryptodev.c
index c7975ed..8189053 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2015-2020 Intel Corporation
+ * Copyright 2020 NXP
  */
 
 #include <time.h>
@@ -18,7 +19,7 @@
 #include <rte_cryptodev_pmd.h>
 #include <rte_string_fns.h>
 
-#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
+#ifdef RTE_CRYPTO_SCHEDULER
 #include <rte_cryptodev_scheduler.h>
 #include <rte_cryptodev_scheduler_operations.h>
 #endif
 #include "test_cryptodev_aead_test_vectors.h"
 #include "test_cryptodev_hmac_test_vectors.h"
 #include "test_cryptodev_mixed_test_vectors.h"
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
 #include "test_cryptodev_security_pdcp_test_vectors.h"
+#include "test_cryptodev_security_pdcp_sdap_test_vectors.h"
 #include "test_cryptodev_security_pdcp_test_func.h"
 #include "test_cryptodev_security_docsis_test_vectors.h"
+
+#define SDAP_DISABLED  0
+#define SDAP_ENABLED   1
 #endif
 
 #define VDEV_ARGS_SIZE 100
 #define IN_PLACE 0
 #define OUT_OF_PLACE 1
 
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#endif
+
 static int gbl_driver_id;
 
 static enum rte_security_session_action_type gbl_action_type =
@@ -80,17 +89,17 @@ struct crypto_unittest_params {
        struct rte_crypto_sym_xform cipher_xform;
        struct rte_crypto_sym_xform auth_xform;
        struct rte_crypto_sym_xform aead_xform;
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
        struct rte_security_docsis_xform docsis_xform;
 #endif
 
        union {
                struct rte_cryptodev_sym_session *sess;
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
                struct rte_security_session *sec_session;
 #endif
        };
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
        enum rte_security_session_action_type type;
 #endif
        struct rte_crypto_op *op;
@@ -695,7 +704,7 @@ testsuite_setup(void)
                }
        }
 
-#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
+#ifdef RTE_CRYPTO_SCHEDULER
        char vdev_args[VDEV_ARGS_SIZE] = {""};
        char temp_str[VDEV_ARGS_SIZE] = {"mode=multi-core,"
                "ordering=enable,name=cryptodev_test_scheduler,corelist="};
@@ -708,7 +717,7 @@ testsuite_setup(void)
                /* Identify the Worker Cores
                 * Use 2 worker cores for the device args
                 */
-               RTE_LCORE_FOREACH_SLAVE(i) {
+               RTE_LCORE_FOREACH_WORKER(i) {
                        if (worker_core_count > 1)
                                break;
                        snprintf(vdev_args, sizeof(vdev_args),
@@ -742,7 +751,7 @@ testsuite_setup(void)
                                i, RTE_STR(CRYPTODEV_NAME_SCHEDULER_PMD));
                }
        }
-#endif /* RTE_LIBRTE_PMD_CRYPTO_SCHEDULER */
+#endif /* RTE_CRYPTO_SCHEDULER */
 
        nb_devs = rte_cryptodev_count();
        if (nb_devs < 1) {
@@ -773,9 +782,15 @@ testsuite_setup(void)
        unsigned int session_size =
                rte_cryptodev_sym_get_private_session_size(dev_id);
 
+#ifdef RTE_LIB_SECURITY
+       unsigned int security_session_size = rte_security_session_get_size(
+                       rte_cryptodev_get_sec_ctx(dev_id));
+
+       if (session_size < security_session_size)
+               session_size = security_session_size;
+#endif
        /*
-        * Create mempool with maximum number of sessions * 2,
-        * to include the session headers
+        * Create mempool with maximum number of sessions.
         */
        if (info.sym.max_nb_sessions != 0 &&
                        info.sym.max_nb_sessions < MAX_NB_SESSIONS) {
@@ -915,7 +930,7 @@ ut_teardown(void)
        struct rte_cryptodev_stats stats;
 
        /* free crypto session structure */
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
        if (ut_params->type == RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) {
                if (ut_params->sec_session) {
                        rte_security_session_destroy(rte_cryptodev_get_sec_ctx
@@ -2665,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;
@@ -2753,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;
@@ -2835,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;
@@ -2921,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;
@@ -3142,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;
@@ -3250,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,
@@ -3334,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,
@@ -3418,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;
@@ -3506,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,
@@ -3585,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;
@@ -3674,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;
@@ -3763,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,
@@ -3849,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;
@@ -3971,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,
@@ -4072,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;
@@ -4158,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,
@@ -4251,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;
@@ -4349,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;
@@ -4466,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;
@@ -4655,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;
@@ -4869,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;
@@ -5050,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;
@@ -5246,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;
@@ -5359,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 */
@@ -5451,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;
@@ -5557,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;
@@ -6661,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))
@@ -6677,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(
@@ -6756,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");
 
@@ -6857,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))
@@ -6961,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");
 
@@ -7617,7 +7709,7 @@ test_authenticated_encryption(const struct aead_test_data *tdata)
 
 }
 
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
 static int
 security_proto_supported(enum rte_security_session_action_type action,
        enum rte_security_session_protocol proto)
@@ -7653,14 +7745,18 @@ security_proto_supported(enum rte_security_session_action_type action,
  * on input_vec. Checks the output of the crypto operation against
  * output_vec.
  */
-static int
-test_pdcp_proto(int i, int oop,
-       enum rte_crypto_cipher_operation opc,
-       enum rte_crypto_auth_operation opa,
-       uint8_t *input_vec,
-       unsigned int input_vec_len,
-       uint8_t *output_vec,
-       unsigned int output_vec_len)
+static int test_pdcp_proto(int i, int oop, enum rte_crypto_cipher_operation opc,
+                          enum rte_crypto_auth_operation opa,
+                          const uint8_t *input_vec, unsigned int input_vec_len,
+                          const uint8_t *output_vec,
+                          unsigned int output_vec_len,
+                          enum rte_crypto_cipher_algorithm cipher_alg,
+                          const uint8_t *cipher_key, uint32_t cipher_key_len,
+                          enum rte_crypto_auth_algorithm auth_alg,
+                          const uint8_t *auth_key, uint32_t auth_key_len,
+                          uint8_t bearer, enum rte_security_pdcp_domain domain,
+                          uint8_t packet_direction, uint8_t sn_size,
+                          uint32_t hfn, uint32_t hfn_threshold, uint8_t sdap)
 {
        struct crypto_testsuite_params *ts_params = &testsuite_params;
        struct crypto_unittest_params *ut_params = &unittest_params;
@@ -7675,7 +7771,7 @@ test_pdcp_proto(int i, int oop,
 
        sec_cap_idx.action = ut_params->type;
        sec_cap_idx.protocol = RTE_SECURITY_PROTOCOL_PDCP;
-       sec_cap_idx.pdcp.domain = pdcp_test_params[i].domain;
+       sec_cap_idx.pdcp.domain = domain;
        if (rte_security_capability_get(ctx, &sec_cap_idx) == NULL)
                return -ENOTSUP;
 
@@ -7701,24 +7797,22 @@ test_pdcp_proto(int i, int oop,
 
        /* Setup Cipher Parameters */
        ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
-       ut_params->cipher_xform.cipher.algo = pdcp_test_params[i].cipher_alg;
+       ut_params->cipher_xform.cipher.algo = cipher_alg;
        ut_params->cipher_xform.cipher.op = opc;
-       ut_params->cipher_xform.cipher.key.data = pdcp_test_crypto_key[i];
-       ut_params->cipher_xform.cipher.key.length =
-                                       pdcp_test_params[i].cipher_key_len;
+       ut_params->cipher_xform.cipher.key.data = cipher_key;
+       ut_params->cipher_xform.cipher.key.length = cipher_key_len;
        ut_params->cipher_xform.cipher.iv.length =
-                               pdcp_test_packet_direction[i] ? 4 : 0;
+                               packet_direction ? 4 : 0;
        ut_params->cipher_xform.cipher.iv.offset = IV_OFFSET;
 
        /* Setup HMAC Parameters if ICV header is required */
-       if (pdcp_test_params[i].auth_alg != 0) {
+       if (auth_alg != 0) {
                ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
                ut_params->auth_xform.next = NULL;
-               ut_params->auth_xform.auth.algo = pdcp_test_params[i].auth_alg;
+               ut_params->auth_xform.auth.algo = auth_alg;
                ut_params->auth_xform.auth.op = opa;
-               ut_params->auth_xform.auth.key.data = pdcp_test_auth_key[i];
-               ut_params->auth_xform.auth.key.length =
-                                       pdcp_test_params[i].auth_key_len;
+               ut_params->auth_xform.auth.key.data = auth_key;
+               ut_params->auth_xform.auth.key.length = auth_key_len;
 
                ut_params->cipher_xform.next = &ut_params->auth_xform;
        } else {
@@ -7729,29 +7823,30 @@ test_pdcp_proto(int i, int oop,
                .action_type = ut_params->type,
                .protocol = RTE_SECURITY_PROTOCOL_PDCP,
                {.pdcp = {
-                       .bearer = pdcp_test_bearer[i],
-                       .domain = pdcp_test_params[i].domain,
-                       .pkt_dir = pdcp_test_packet_direction[i],
-                       .sn_size = pdcp_test_data_sn_size[i],
-                       .hfn = pdcp_test_packet_direction[i] ?
-                               0 : pdcp_test_hfn[i],
-                               /**
-                                * hfn can be set as pdcp_test_hfn[i]
-                                * if hfn_ovrd is not set. Here, PDCP
-                                * packet direction is just used to
-                                * run half of the cases with session
-                                * HFN and other half with per packet
-                                * HFN.
-                                */
-                       .hfn_threshold = pdcp_test_hfn_threshold[i],
-                       .hfn_ovrd = pdcp_test_packet_direction[i] ? 1 : 0,
+                       .bearer = bearer,
+                       .domain = domain,
+                       .pkt_dir = packet_direction,
+                       .sn_size = sn_size,
+                       .hfn = packet_direction ? 0 : hfn,
+                       /**
+                        * hfn can be set as pdcp_test_hfn[i]
+                        * if hfn_ovrd is not set. Here, PDCP
+                        * packet direction is just used to
+                        * run half of the cases with session
+                        * HFN and other half with per packet
+                        * HFN.
+                        */
+                       .hfn_threshold = hfn_threshold,
+                       .hfn_ovrd = packet_direction ? 1 : 0,
+                       .sdap_enabled = sdap,
                } },
                .crypto_xform = &ut_params->cipher_xform
        };
 
        /* Create security session */
        ut_params->sec_session = rte_security_session_create(ctx,
-                               &sess_conf, ts_params->session_priv_mpool);
+                               &sess_conf, ts_params->session_mpool,
+                               ts_params->session_priv_mpool);
 
        if (!ut_params->sec_session) {
                printf("TestCase %s()-%d line %d failed %s: ",
@@ -7773,7 +7868,7 @@ test_pdcp_proto(int i, int oop,
 
        uint32_t *per_pkt_hfn = rte_crypto_op_ctod_offset(ut_params->op,
                                        uint32_t *, IV_OFFSET);
-       *per_pkt_hfn = pdcp_test_packet_direction[i] ? pdcp_test_hfn[i] : 0;
+       *per_pkt_hfn = packet_direction ? hfn : 0;
 
        rte_security_attach_session(ut_params->op, ut_params->sec_session);
 
@@ -8011,7 +8106,8 @@ test_pdcp_proto_SGL(int i, int oop,
 
        /* Create security session */
        ut_params->sec_session = rte_security_session_create(ctx,
-                               &sess_conf, ts_params->session_priv_mpool);
+                               &sess_conf, ts_params->session_mpool,
+                               ts_params->session_priv_mpool);
 
        if (!ut_params->sec_session) {
                printf("TestCase %s()-%d line %d failed %s: ",
@@ -8114,74 +8210,97 @@ on_err:
 int
 test_pdcp_proto_cplane_encap(int i)
 {
-       return test_pdcp_proto(i, 0,
-               RTE_CRYPTO_CIPHER_OP_ENCRYPT,
-               RTE_CRYPTO_AUTH_OP_GENERATE,
-               pdcp_test_data_in[i],
-               pdcp_test_data_in_len[i],
-               pdcp_test_data_out[i],
-               pdcp_test_data_in_len[i]+4);
+       return test_pdcp_proto(
+               i, 0, RTE_CRYPTO_CIPHER_OP_ENCRYPT, RTE_CRYPTO_AUTH_OP_GENERATE,
+               pdcp_test_data_in[i], pdcp_test_data_in_len[i],
+               pdcp_test_data_out[i], pdcp_test_data_in_len[i] + 4,
+               pdcp_test_params[i].cipher_alg, pdcp_test_crypto_key[i],
+               pdcp_test_params[i].cipher_key_len,
+               pdcp_test_params[i].auth_alg, pdcp_test_auth_key[i],
+               pdcp_test_params[i].auth_key_len, pdcp_test_bearer[i],
+               pdcp_test_params[i].domain, pdcp_test_packet_direction[i],
+               pdcp_test_data_sn_size[i], pdcp_test_hfn[i],
+               pdcp_test_hfn_threshold[i], SDAP_DISABLED);
 }
 
 int
 test_pdcp_proto_uplane_encap(int i)
 {
-       return test_pdcp_proto(i, 0,
-               RTE_CRYPTO_CIPHER_OP_ENCRYPT,
-               RTE_CRYPTO_AUTH_OP_GENERATE,
-               pdcp_test_data_in[i],
-               pdcp_test_data_in_len[i],
-               pdcp_test_data_out[i],
-               pdcp_test_data_in_len[i]);
-
+       return test_pdcp_proto(
+               i, 0, RTE_CRYPTO_CIPHER_OP_ENCRYPT, RTE_CRYPTO_AUTH_OP_GENERATE,
+               pdcp_test_data_in[i], pdcp_test_data_in_len[i],
+               pdcp_test_data_out[i], pdcp_test_data_in_len[i],
+               pdcp_test_params[i].cipher_alg, pdcp_test_crypto_key[i],
+               pdcp_test_params[i].cipher_key_len,
+               pdcp_test_params[i].auth_alg, pdcp_test_auth_key[i],
+               pdcp_test_params[i].auth_key_len, pdcp_test_bearer[i],
+               pdcp_test_params[i].domain, pdcp_test_packet_direction[i],
+               pdcp_test_data_sn_size[i], pdcp_test_hfn[i],
+               pdcp_test_hfn_threshold[i], SDAP_DISABLED);
 }
 
 int
 test_pdcp_proto_uplane_encap_with_int(int i)
 {
-       return test_pdcp_proto(i, 0,
-               RTE_CRYPTO_CIPHER_OP_ENCRYPT,
-               RTE_CRYPTO_AUTH_OP_GENERATE,
-               pdcp_test_data_in[i],
-               pdcp_test_data_in_len[i],
-               pdcp_test_data_out[i],
-               pdcp_test_data_in_len[i] + 4);
+       return test_pdcp_proto(
+               i, 0, RTE_CRYPTO_CIPHER_OP_ENCRYPT, RTE_CRYPTO_AUTH_OP_GENERATE,
+               pdcp_test_data_in[i], pdcp_test_data_in_len[i],
+               pdcp_test_data_out[i], pdcp_test_data_in_len[i] + 4,
+               pdcp_test_params[i].cipher_alg, pdcp_test_crypto_key[i],
+               pdcp_test_params[i].cipher_key_len,
+               pdcp_test_params[i].auth_alg, pdcp_test_auth_key[i],
+               pdcp_test_params[i].auth_key_len, pdcp_test_bearer[i],
+               pdcp_test_params[i].domain, pdcp_test_packet_direction[i],
+               pdcp_test_data_sn_size[i], pdcp_test_hfn[i],
+               pdcp_test_hfn_threshold[i], SDAP_DISABLED);
 }
 
 int
 test_pdcp_proto_cplane_decap(int i)
 {
-       return test_pdcp_proto(i, 0,
-               RTE_CRYPTO_CIPHER_OP_DECRYPT,
-               RTE_CRYPTO_AUTH_OP_VERIFY,
-               pdcp_test_data_out[i],
-               pdcp_test_data_in_len[i] + 4,
-               pdcp_test_data_in[i],
-               pdcp_test_data_in_len[i]);
+       return test_pdcp_proto(
+               i, 0, RTE_CRYPTO_CIPHER_OP_DECRYPT, RTE_CRYPTO_AUTH_OP_VERIFY,
+               pdcp_test_data_out[i], pdcp_test_data_in_len[i] + 4,
+               pdcp_test_data_in[i], pdcp_test_data_in_len[i],
+               pdcp_test_params[i].cipher_alg, pdcp_test_crypto_key[i],
+               pdcp_test_params[i].cipher_key_len,
+               pdcp_test_params[i].auth_alg, pdcp_test_auth_key[i],
+               pdcp_test_params[i].auth_key_len, pdcp_test_bearer[i],
+               pdcp_test_params[i].domain, pdcp_test_packet_direction[i],
+               pdcp_test_data_sn_size[i], pdcp_test_hfn[i],
+               pdcp_test_hfn_threshold[i], SDAP_DISABLED);
 }
 
 int
 test_pdcp_proto_uplane_decap(int i)
 {
-       return test_pdcp_proto(i, 0,
-               RTE_CRYPTO_CIPHER_OP_DECRYPT,
-               RTE_CRYPTO_AUTH_OP_VERIFY,
-               pdcp_test_data_out[i],
-               pdcp_test_data_in_len[i],
-               pdcp_test_data_in[i],
-               pdcp_test_data_in_len[i]);
+       return test_pdcp_proto(
+               i, 0, RTE_CRYPTO_CIPHER_OP_DECRYPT, RTE_CRYPTO_AUTH_OP_VERIFY,
+               pdcp_test_data_out[i], pdcp_test_data_in_len[i],
+               pdcp_test_data_in[i], pdcp_test_data_in_len[i],
+               pdcp_test_params[i].cipher_alg, pdcp_test_crypto_key[i],
+               pdcp_test_params[i].cipher_key_len,
+               pdcp_test_params[i].auth_alg, pdcp_test_auth_key[i],
+               pdcp_test_params[i].auth_key_len, pdcp_test_bearer[i],
+               pdcp_test_params[i].domain, pdcp_test_packet_direction[i],
+               pdcp_test_data_sn_size[i], pdcp_test_hfn[i],
+               pdcp_test_hfn_threshold[i], SDAP_DISABLED);
 }
 
 int
 test_pdcp_proto_uplane_decap_with_int(int i)
 {
-       return test_pdcp_proto(i, 0,
-               RTE_CRYPTO_CIPHER_OP_DECRYPT,
-               RTE_CRYPTO_AUTH_OP_VERIFY,
-               pdcp_test_data_out[i],
-               pdcp_test_data_in_len[i] + 4,
-               pdcp_test_data_in[i],
-               pdcp_test_data_in_len[i]);
+       return test_pdcp_proto(
+               i, 0, RTE_CRYPTO_CIPHER_OP_DECRYPT, RTE_CRYPTO_AUTH_OP_VERIFY,
+               pdcp_test_data_out[i], pdcp_test_data_in_len[i] + 4,
+               pdcp_test_data_in[i], pdcp_test_data_in_len[i],
+               pdcp_test_params[i].cipher_alg, pdcp_test_crypto_key[i],
+               pdcp_test_params[i].cipher_key_len,
+               pdcp_test_params[i].auth_alg, pdcp_test_auth_key[i],
+               pdcp_test_params[i].auth_key_len, pdcp_test_bearer[i],
+               pdcp_test_params[i].domain, pdcp_test_packet_direction[i],
+               pdcp_test_data_sn_size[i], pdcp_test_hfn[i],
+               pdcp_test_hfn_threshold[i], SDAP_DISABLED);
 }
 
 static int
@@ -8250,6 +8369,90 @@ test_PDCP_PROTO_SGL_oop_128B_32B(void)
                        128, 32);
 }
 
+static int
+test_PDCP_SDAP_PROTO_encap_all(void)
+{
+       int i = 0, size = 0;
+       int err, all_err = TEST_SUCCESS;
+       const struct pdcp_sdap_test *cur_test;
+
+       size = ARRAY_SIZE(list_pdcp_sdap_tests);
+
+       for (i = 0; i < size; i++) {
+               cur_test = &list_pdcp_sdap_tests[i];
+               err = test_pdcp_proto(
+                       i, 0, RTE_CRYPTO_CIPHER_OP_ENCRYPT,
+                       RTE_CRYPTO_AUTH_OP_GENERATE, cur_test->data_in,
+                       cur_test->in_len, cur_test->data_out,
+                       cur_test->in_len + ((cur_test->auth_key) ? 4 : 0),
+                       cur_test->param.cipher_alg, cur_test->cipher_key,
+                       cur_test->param.cipher_key_len,
+                       cur_test->param.auth_alg,
+                       cur_test->auth_key, cur_test->param.auth_key_len,
+                       cur_test->bearer, cur_test->param.domain,
+                       cur_test->packet_direction, cur_test->sn_size,
+                       cur_test->hfn,
+                       cur_test->hfn_threshold, SDAP_ENABLED);
+               if (err) {
+                       printf("\t%d) %s: Encapsulation failed\n",
+                                       cur_test->test_idx,
+                                       cur_test->param.name);
+                       err = TEST_FAILED;
+               } else {
+                       printf("\t%d) %s: Encap PASS\n", cur_test->test_idx,
+                                       cur_test->param.name);
+                       err = TEST_SUCCESS;
+               }
+               all_err += err;
+       }
+
+       printf("Success: %d, Failure: %d\n", size + all_err, -all_err);
+
+       return (all_err == TEST_SUCCESS) ? TEST_SUCCESS : TEST_FAILED;
+}
+
+static int
+test_PDCP_SDAP_PROTO_decap_all(void)
+{
+       int i = 0, size = 0;
+       int err, all_err = TEST_SUCCESS;
+       const struct pdcp_sdap_test *cur_test;
+
+       size = ARRAY_SIZE(list_pdcp_sdap_tests);
+
+       for (i = 0; i < size; i++) {
+               cur_test = &list_pdcp_sdap_tests[i];
+               err = test_pdcp_proto(
+                       i, 0, RTE_CRYPTO_CIPHER_OP_DECRYPT,
+                       RTE_CRYPTO_AUTH_OP_VERIFY,
+                       cur_test->data_out,
+                       cur_test->in_len + ((cur_test->auth_key) ? 4 : 0),
+                       cur_test->data_in, cur_test->in_len,
+                       cur_test->param.cipher_alg,
+                       cur_test->cipher_key, cur_test->param.cipher_key_len,
+                       cur_test->param.auth_alg, cur_test->auth_key,
+                       cur_test->param.auth_key_len, cur_test->bearer,
+                       cur_test->param.domain, cur_test->packet_direction,
+                       cur_test->sn_size, cur_test->hfn,
+                       cur_test->hfn_threshold, SDAP_ENABLED);
+               if (err) {
+                       printf("\t%d) %s: Decapsulation failed\n",
+                                       cur_test->test_idx,
+                                       cur_test->param.name);
+                       err = TEST_FAILED;
+               } else {
+                       printf("\t%d) %s: Decap PASS\n", cur_test->test_idx,
+                                       cur_test->param.name);
+                       err = TEST_SUCCESS;
+               }
+               all_err += err;
+       }
+
+       printf("Success: %d, Failure: %d\n", size + all_err, -all_err);
+
+       return (all_err == TEST_SUCCESS) ? TEST_SUCCESS : TEST_FAILED;
+}
+
 static int
 test_PDCP_PROTO_all(void)
 {
@@ -8281,6 +8484,8 @@ test_PDCP_PROTO_all(void)
        status += test_PDCP_PROTO_SGL_oop_32B_128B();
        status += test_PDCP_PROTO_SGL_oop_32B_40B();
        status += test_PDCP_PROTO_SGL_oop_128B_32B();
+       status += test_PDCP_SDAP_PROTO_encap_all();
+       status += test_PDCP_SDAP_PROTO_decap_all();
 
        if (status)
                return TEST_FAILED;
@@ -8368,6 +8573,7 @@ test_docsis_proto_uplink(int i, struct docsis_test_data *d_td)
 
        /* Create security session */
        ut_params->sec_session = rte_security_session_create(ctx, &sess_conf,
+                                       ts_params->session_mpool,
                                        ts_params->session_priv_mpool);
 
        if (!ut_params->sec_session) {
@@ -8543,6 +8749,7 @@ test_docsis_proto_downlink(int i, struct docsis_test_data *d_td)
 
        /* Create security session */
        ut_params->sec_session = rte_security_session_create(ctx, &sess_conf,
+                                       ts_params->session_mpool,
                                        ts_params->session_priv_mpool);
 
        if (!ut_params->sec_session) {
@@ -10939,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;
 
@@ -12607,7 +12814,7 @@ test_chacha20_poly1305_decrypt_test_case_rfc8439(void)
        return test_authenticated_decryption(&chacha20_poly1305_case_rfc8439);
 }
 
-#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
+#ifdef RTE_CRYPTO_SCHEDULER
 
 /* global AESNI worker IDs for the scheduler test */
 uint8_t aesni_ids[2];
@@ -12827,7 +13034,7 @@ static struct unit_test_suite cryptodev_scheduler_testsuite  = {
        }
 };
 
-#endif /* RTE_LIBRTE_PMD_CRYPTO_SCHEDULER */
+#endif /* RTE_CRYPTO_SCHEDULER */
 
 static struct unit_test_suite cryptodev_testsuite  = {
        .suite_name = "Crypto Unit Test Suite",
@@ -13457,7 +13664,7 @@ static struct unit_test_suite cryptodev_testsuite  = {
                TEST_CASE_ST(ut_setup, ut_teardown,
                        test_verify_auth_aes_cmac_cipher_null_test_case_1),
 
-#ifdef RTE_LIBRTE_SECURITY
+#ifdef RTE_LIB_SECURITY
                TEST_CASE_ST(ut_setup_security, ut_teardown,
                        test_PDCP_PROTO_all),
                TEST_CASE_ST(ut_setup_security, ut_teardown,
@@ -13750,7 +13957,7 @@ test_cryptodev_mrvl(void)
        return unit_test_suite_runner(&cryptodev_mrvl_testsuite);
 }
 
-#ifdef RTE_LIBRTE_PMD_CRYPTO_SCHEDULER
+#ifdef RTE_CRYPTO_SCHEDULER
 
 static int
 test_cryptodev_scheduler(void /*argv __rte_unused, int argc __rte_unused*/)
@@ -13892,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;
        }