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

Function test_enqdeq_callback_null_cipher

dpdk/app/test/test_cryptodev.c:13595–13640  ·  view source on GitHub ↗

* Process enqueue/dequeue NULL crypto request to verify callback with RCU. */

Source from the content-addressed store, hash-verified

13593 * Process enqueue/dequeue NULL crypto request to verify callback with RCU.
13594 */
13595static int
13596test_enqdeq_callback_null_cipher(void)
13597{
13598 struct crypto_testsuite_params *ts_params = &testsuite_params;
13599 struct crypto_unittest_params *ut_params = &unittest_params;
13600
13601 /* Setup Cipher Parameters */
13602 ut_params->cipher_xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
13603 ut_params->cipher_xform.next = &ut_params->auth_xform;
13604
13605 ut_params->cipher_xform.cipher.algo = RTE_CRYPTO_CIPHER_NULL;
13606 ut_params->cipher_xform.cipher.op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
13607
13608 /* Setup Auth Parameters */
13609 ut_params->auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH;
13610 ut_params->auth_xform.next = NULL;
13611
13612 ut_params->auth_xform.auth.algo = RTE_CRYPTO_AUTH_NULL;
13613 ut_params->auth_xform.auth.op = RTE_CRYPTO_AUTH_OP_GENERATE;
13614
13615 /* Create Crypto session */
13616 ut_params->sess = rte_cryptodev_sym_session_create(ts_params->valid_devs[0],
13617 &ut_params->auth_xform, ts_params->session_mpool);
13618 TEST_ASSERT_NOT_NULL(ut_params->sess, "Session creation failed");
13619
13620 ut_params->op = rte_crypto_op_alloc(ts_params->op_mpool, RTE_CRYPTO_OP_TYPE_SYMMETRIC);
13621 TEST_ASSERT_NOT_NULL(ut_params->op, "Failed to allocate symmetric crypto op");
13622
13623 /* Allocate mbuf */
13624 ut_params->ibuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
13625 TEST_ASSERT_NOT_NULL(ut_params->ibuf, "Failed to allocate mbuf");
13626
13627 /* Append some random data */
13628 TEST_ASSERT_NOT_NULL(rte_pktmbuf_append(ut_params->ibuf, sizeof(unsigned int)),
13629 "no room to append data");
13630
13631 rte_crypto_op_attach_sym_session(ut_params->op, ut_params->sess);
13632
13633 ut_params->op->sym->m_src = ut_params->ibuf;
13634
13635 /* Process crypto operation */
13636 TEST_ASSERT_NOT_NULL(process_crypto_request(ts_params->valid_devs[0], ut_params->op),
13637 "failed to process sym crypto op");
13638
13639 return 0;
13640}
13641
13642static int
13643test_enq_callback_setup(void)

Callers 2

test_enq_callback_setupFunction · 0.85
test_deq_callback_setupFunction · 0.85

Calls 6

rte_crypto_op_allocFunction · 0.85
rte_pktmbuf_allocFunction · 0.85
rte_pktmbuf_appendFunction · 0.85
process_crypto_requestFunction · 0.70

Tested by

no test coverage detected