* Process enqueue/dequeue NULL crypto request to verify callback with RCU. */
| 13593 | * Process enqueue/dequeue NULL crypto request to verify callback with RCU. |
| 13594 | */ |
| 13595 | static int |
| 13596 | test_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 | |
| 13642 | static int |
| 13643 | test_enq_callback_setup(void) |
no test coverage detected