MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_pdcp_proto_SGL

Function test_pdcp_proto_SGL

dpdk/app/test/test_cryptodev.c:9274–9576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9272}
9273
9274static int
9275test_pdcp_proto_SGL(int i, int oop,
9276 enum rte_crypto_cipher_operation opc,
9277 enum rte_crypto_auth_operation opa,
9278 uint8_t *input_vec,
9279 unsigned int input_vec_len,
9280 uint8_t *output_vec,
9281 unsigned int output_vec_len,
9282 uint32_t fragsz,
9283 uint32_t fragsz_oop)
9284{
9285 struct crypto_testsuite_params *ts_params = &testsuite_params;
9286 struct crypto_unittest_params *ut_params = &unittest_params;
9287 uint8_t *plaintext;
9288 struct rte_mbuf *buf, *buf_oop = NULL;
9289 int ret = TEST_SUCCESS;
9290 int to_trn = 0;
9291 int to_trn_tbl[16];
9292 int segs = 1;
9293 unsigned int trn_data = 0;
9294 struct rte_cryptodev_info dev_info;
9295 uint64_t feat_flags;
9296 void *ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
9297 struct rte_mbuf *temp_mbuf;
9298
9299 rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
9300 feat_flags = dev_info.feature_flags;
9301
9302 if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) &&
9303 (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) {
9304 printf("Device does not support RAW data-path APIs.\n");
9305 return -ENOTSUP;
9306 }
9307 /* Verify the capabilities */
9308 struct rte_security_capability_idx sec_cap_idx;
9309
9310 sec_cap_idx.action = ut_params->type;
9311 sec_cap_idx.protocol = RTE_SECURITY_PROTOCOL_PDCP;
9312 sec_cap_idx.pdcp.domain = pdcp_test_params[i].domain;
9313 if (rte_security_capability_get(ctx, &sec_cap_idx) == NULL)
9314 return TEST_SKIPPED;
9315
9316 if (fragsz > input_vec_len)
9317 fragsz = input_vec_len;
9318
9319 uint16_t plaintext_len = fragsz;
9320 uint16_t frag_size_oop = fragsz_oop ? fragsz_oop : fragsz;
9321
9322 if (fragsz_oop > output_vec_len)
9323 frag_size_oop = output_vec_len;
9324
9325 int ecx = 0;
9326 if (input_vec_len % fragsz != 0) {
9327 if (input_vec_len / fragsz + 1 > 16)
9328 return 1;
9329 } else if (input_vec_len / fragsz > 16)
9330 return 1;
9331

Calls 15

rte_cryptodev_info_getFunction · 0.85
rte_pktmbuf_allocFunction · 0.85
rte_pktmbuf_appendFunction · 0.85
memsetFunction · 0.85
rte_pktmbuf_tailroomFunction · 0.85
rte_crypto_op_allocFunction · 0.85
process_sym_raw_dp_opFunction · 0.85
rte_hexdumpFunction · 0.85

Tested by

no test coverage detected