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

Function process_cpu_aead_op

dpdk/app/test/test_cryptodev.c:442–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440}
441
442static void
443process_cpu_aead_op(uint8_t dev_id, struct rte_crypto_op *op)
444{
445 int32_t n, st;
446 struct rte_crypto_sym_op *sop;
447 union rte_crypto_sym_ofs ofs;
448 struct rte_crypto_sgl sgl;
449 struct rte_crypto_sym_vec symvec;
450 struct rte_crypto_va_iova_ptr iv_ptr, aad_ptr, digest_ptr;
451 struct rte_crypto_vec vec[UINT8_MAX];
452
453 sop = op->sym;
454
455 n = rte_crypto_mbuf_to_vec(sop->m_src, sop->aead.data.offset,
456 sop->aead.data.length, vec, RTE_DIM(vec));
457
458 if (n < 0 || n != sop->m_src->nb_segs) {
459 op->status = RTE_CRYPTO_OP_STATUS_ERROR;
460 return;
461 }
462
463 sgl.vec = vec;
464 sgl.num = n;
465 symvec.src_sgl = &sgl;
466 symvec.iv = &iv_ptr;
467 symvec.digest = &digest_ptr;
468 symvec.aad = &aad_ptr;
469 symvec.status = &st;
470 symvec.num = 1;
471
472 /* for CPU crypto the IOVA address is not required */
473 iv_ptr.va = rte_crypto_op_ctod_offset(op, void *, IV_OFFSET);
474 digest_ptr.va = (void *)sop->aead.digest.data;
475 aad_ptr.va = (void *)sop->aead.aad.data;
476
477 ofs.raw = 0;
478
479 n = rte_cryptodev_sym_cpu_crypto_process(dev_id, sop->session, ofs,
480 &symvec);
481
482 if (n != 1)
483 op->status = RTE_CRYPTO_OP_STATUS_AUTH_FAILED;
484 else
485 op->status = RTE_CRYPTO_OP_STATUS_SUCCESS;
486}
487
488static void
489process_cpu_crypt_auth_op(uint8_t dev_id, struct rte_crypto_op *op)

Calls 2

rte_crypto_mbuf_to_vecFunction · 0.85

Tested by

no test coverage detected