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

Function test_authenticated_encryption_SGL

dpdk/app/test/test_cryptodev.c:15517–15825  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15515#define SGL_MAX_NO 16
15516
15517static int
15518test_authenticated_encryption_SGL(const struct aead_test_data *tdata,
15519 const int oop, uint32_t fragsz, uint32_t fragsz_oop)
15520{
15521 struct crypto_testsuite_params *ts_params = &testsuite_params;
15522 struct crypto_unittest_params *ut_params = &unittest_params;
15523 struct rte_mbuf *buf, *buf_oop = NULL, *buf_last_oop = NULL;
15524 int retval;
15525 int to_trn = 0;
15526 int to_trn_tbl[SGL_MAX_NO];
15527 int segs = 1;
15528 unsigned int trn_data = 0;
15529 uint8_t *plaintext, *ciphertext, *auth_tag;
15530 struct rte_cryptodev_info dev_info;
15531
15532 /* Verify the capabilities */
15533 struct rte_cryptodev_sym_capability_idx cap_idx;
15534 cap_idx.type = RTE_CRYPTO_SYM_XFORM_AEAD;
15535 cap_idx.algo.aead = tdata->algo;
15536 if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
15537 &cap_idx) == NULL)
15538 return TEST_SKIPPED;
15539
15540 /*
15541 * SGL not supported on AESNI_MB PMD CPU crypto,
15542 * OOP not supported on AESNI_GCM CPU crypto
15543 */
15544 if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO &&
15545 (gbl_driver_id == rte_cryptodev_driver_id_get(
15546 RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD)) || oop))
15547 return TEST_SKIPPED;
15548
15549 /* Detailed check for the particular SGL support flag */
15550 rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
15551 if (!oop) {
15552 unsigned int sgl_in = fragsz < tdata->plaintext.len;
15553 if (sgl_in && (!(dev_info.feature_flags &
15554 RTE_CRYPTODEV_FF_IN_PLACE_SGL)))
15555 return TEST_SKIPPED;
15556
15557 uint64_t feat_flags = dev_info.feature_flags;
15558
15559 if ((global_api_test_type == CRYPTODEV_RAW_API_TEST) &&
15560 (!(feat_flags & RTE_CRYPTODEV_FF_SYM_RAW_DP))) {
15561 printf("Device doesn't support RAW data-path APIs.\n");
15562 return TEST_SKIPPED;
15563 }
15564 } else {
15565 unsigned int sgl_in = fragsz < tdata->plaintext.len;
15566 unsigned int sgl_out = (fragsz_oop ? fragsz_oop : fragsz) <
15567 tdata->plaintext.len;
15568 /* Raw data path API does not support OOP */
15569 if (global_api_test_type == CRYPTODEV_RAW_API_TEST)
15570 return TEST_SKIPPED;
15571 if (sgl_in && !sgl_out) {
15572 if (!(dev_info.feature_flags &
15573 RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT))
15574 return TEST_SKIPPED;

Calls 15

rte_cryptodev_info_getFunction · 0.85
rte_pktmbuf_allocFunction · 0.85
rte_pktmbuf_appendFunction · 0.85
create_aead_sessionFunction · 0.85
memsetFunction · 0.85
rte_pktmbuf_tailroomFunction · 0.85
process_cpu_aead_opFunction · 0.85
process_sym_raw_dp_opFunction · 0.85

Tested by

no test coverage detected