Basic algorithm run function for async inplace mode. * Creates a session from input parameters and runs one operation * on input_vec. Checks the output of the crypto operation against * output_vec. */
| 9072 | * output_vec. |
| 9073 | */ |
| 9074 | static int test_pdcp_proto(int i, int oop, enum rte_crypto_cipher_operation opc, |
| 9075 | enum rte_crypto_auth_operation opa, |
| 9076 | const uint8_t *input_vec, unsigned int input_vec_len, |
| 9077 | const uint8_t *output_vec, |
| 9078 | unsigned int output_vec_len, |
| 9079 | enum rte_crypto_cipher_algorithm cipher_alg, |
| 9080 | const uint8_t *cipher_key, uint32_t cipher_key_len, |
| 9081 | enum rte_crypto_auth_algorithm auth_alg, |
| 9082 | const uint8_t *auth_key, uint32_t auth_key_len, |
| 9083 | uint8_t bearer, enum rte_security_pdcp_domain domain, |
| 9084 | uint8_t packet_direction, uint8_t sn_size, |
| 9085 | uint32_t hfn, uint32_t hfn_threshold, uint8_t sdap) |
| 9086 | { |
| 9087 | struct crypto_testsuite_params *ts_params = &testsuite_params; |
| 9088 | struct crypto_unittest_params *ut_params = &unittest_params; |
| 9089 | uint8_t *plaintext; |
| 9090 | int ret = TEST_SUCCESS; |
| 9091 | void *ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]); |
| 9092 | struct rte_cryptodev_info dev_info; |
| 9093 | uint64_t feat_flags; |
| 9094 | |
| 9095 | rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); |
| 9096 | feat_flags = dev_info.feature_flags; |
| 9097 | |
| 9098 | /* Verify the capabilities */ |
| 9099 | struct rte_security_capability_idx sec_cap_idx; |
| 9100 | |
| 9101 | sec_cap_idx.action = ut_params->type; |
| 9102 | sec_cap_idx.protocol = RTE_SECURITY_PROTOCOL_PDCP; |
| 9103 | sec_cap_idx.pdcp.domain = domain; |
| 9104 | if (rte_security_capability_get(ctx, &sec_cap_idx) == NULL) |
| 9105 | return TEST_SKIPPED; |
| 9106 | |
| 9107 | /* Generate test mbuf data */ |
| 9108 | ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); |
| 9109 | |
| 9110 | /* clear mbuf payload */ |
| 9111 | memset(rte_pktmbuf_mtod(ut_params->ibuf, uint8_t *), 0, |
| 9112 | rte_pktmbuf_tailroom(ut_params->ibuf)); |
| 9113 | |
| 9114 | plaintext = (uint8_t *)rte_pktmbuf_append(ut_params->ibuf, |
| 9115 | input_vec_len); |
| 9116 | memcpy(plaintext, input_vec, input_vec_len); |
| 9117 | |
| 9118 | if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) && |
| 9119 | (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) { |
| 9120 | printf("Device does not support RAW data-path APIs.\n"); |
| 9121 | return TEST_SKIPPED; |
| 9122 | } |
| 9123 | /* Out of place support */ |
| 9124 | if (oop) { |
| 9125 | /* |
| 9126 | * For out-of-place we need to alloc another mbuf |
| 9127 | */ |
| 9128 | ut_params->obuf = rte_pktmbuf_alloc(ts_params->mbuf_pool); |
| 9129 | rte_pktmbuf_append(ut_params->obuf, output_vec_len); |
| 9130 | } |
| 9131 |
no test coverage detected