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

Function test_deq_callback_setup

dpdk/app/test/test_cryptodev.c:13767–13890  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13765}
13766
13767static int
13768test_deq_callback_setup(void)
13769{
13770 struct crypto_testsuite_params *ts_params = &testsuite_params;
13771 struct rte_cryptodev_sym_capability_idx cap_idx;
13772 struct rte_cryptodev_info dev_info;
13773 struct rte_cryptodev_qp_conf qp_conf = {
13774 .nb_descriptors = MAX_NUM_OPS_INFLIGHT
13775 };
13776
13777 struct rte_cryptodev_cb *cb;
13778 uint16_t qp_id = 0;
13779 int j = 0;
13780
13781 /* Skip test if synchronous API is used */
13782 if (gbl_action_type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO)
13783 return TEST_SKIPPED;
13784
13785 /* Verify the crypto capabilities for which enqueue/dequeue is done. */
13786 cap_idx.type = RTE_CRYPTO_SYM_XFORM_AUTH;
13787 cap_idx.algo.auth = RTE_CRYPTO_AUTH_NULL;
13788 if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
13789 &cap_idx) == NULL)
13790 return TEST_SKIPPED;
13791 cap_idx.type = RTE_CRYPTO_SYM_XFORM_CIPHER;
13792 cap_idx.algo.cipher = RTE_CRYPTO_CIPHER_NULL;
13793 if (rte_cryptodev_sym_capability_get(ts_params->valid_devs[0],
13794 &cap_idx) == NULL)
13795 return TEST_SKIPPED;
13796
13797 /* Stop the device in case it's started so it can be configured */
13798 rte_cryptodev_stop(ts_params->valid_devs[0]);
13799
13800 rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
13801
13802 TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
13803 &ts_params->conf),
13804 "Failed to configure cryptodev %u",
13805 ts_params->valid_devs[0]);
13806
13807 qp_conf.nb_descriptors = MAX_NUM_OPS_INFLIGHT;
13808 qp_conf.mp_session = ts_params->session_mpool;
13809
13810 TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
13811 ts_params->valid_devs[0], qp_id, &qp_conf,
13812 rte_cryptodev_socket_id(ts_params->valid_devs[0])),
13813 "Failed test for "
13814 "rte_cryptodev_queue_pair_setup: num_inflights "
13815 "%u on qp %u on cryptodev %u",
13816 qp_conf.nb_descriptors, qp_id,
13817 ts_params->valid_devs[0]);
13818
13819 deq_cb_called = false;
13820 /* Test with invalid crypto device */
13821 cb = rte_cryptodev_add_deq_callback(RTE_CRYPTO_MAX_DEVS,
13822 qp_id, test_deq_callback, NULL);
13823 if (rte_errno == ENOTSUP) {
13824 RTE_LOG(ERR, USER1, "%s line %d: "

Callers

nothing calls this directly

Calls 11

rte_cryptodev_stopFunction · 0.85
rte_cryptodev_info_getFunction · 0.85
rte_cryptodev_configureFunction · 0.85
rte_cryptodev_socket_idFunction · 0.85
rte_cryptodev_startFunction · 0.85
rte_delay_msFunction · 0.85

Tested by

no test coverage detected