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

Function test_queue_pair_descriptor_setup

dpdk/app/test/test_cryptodev.c:1698–1800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1696}
1697
1698static int
1699test_queue_pair_descriptor_setup(void)
1700{
1701 struct crypto_testsuite_params *ts_params = &testsuite_params;
1702 struct rte_cryptodev_qp_conf qp_conf = {
1703 .nb_descriptors = MAX_NUM_OPS_INFLIGHT
1704 };
1705 uint16_t qp_id;
1706
1707 /* Stop the device in case it's started so it can be configured */
1708 rte_cryptodev_stop(ts_params->valid_devs[0]);
1709
1710 TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
1711 &ts_params->conf),
1712 "Failed to configure cryptodev %u",
1713 ts_params->valid_devs[0]);
1714
1715 /*
1716 * Test various ring sizes on this device. memzones can't be
1717 * freed so are re-used if ring is released and re-created.
1718 */
1719 qp_conf.nb_descriptors = MIN_NUM_OPS_INFLIGHT; /* min size*/
1720 qp_conf.mp_session = ts_params->session_mpool;
1721
1722 for (qp_id = 0; qp_id < ts_params->conf.nb_queue_pairs; qp_id++) {
1723 TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
1724 ts_params->valid_devs[0], qp_id, &qp_conf,
1725 rte_cryptodev_socket_id(
1726 ts_params->valid_devs[0])),
1727 "Failed test for "
1728 "rte_cryptodev_queue_pair_setup: num_inflights "
1729 "%u on qp %u on cryptodev %u",
1730 qp_conf.nb_descriptors, qp_id,
1731 ts_params->valid_devs[0]);
1732 }
1733
1734 qp_conf.nb_descriptors = (uint32_t)(MAX_NUM_OPS_INFLIGHT / 2);
1735
1736 for (qp_id = 0; qp_id < ts_params->conf.nb_queue_pairs; qp_id++) {
1737 TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
1738 ts_params->valid_devs[0], qp_id, &qp_conf,
1739 rte_cryptodev_socket_id(
1740 ts_params->valid_devs[0])),
1741 "Failed test for"
1742 " rte_cryptodev_queue_pair_setup: num_inflights"
1743 " %u on qp %u on cryptodev %u",
1744 qp_conf.nb_descriptors, qp_id,
1745 ts_params->valid_devs[0]);
1746 }
1747
1748 qp_conf.nb_descriptors = MAX_NUM_OPS_INFLIGHT; /* valid */
1749
1750 for (qp_id = 0; qp_id < ts_params->conf.nb_queue_pairs; qp_id++) {
1751 TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
1752 ts_params->valid_devs[0], qp_id, &qp_conf,
1753 rte_cryptodev_socket_id(
1754 ts_params->valid_devs[0])),
1755 "Failed test for "

Callers

nothing calls this directly

Calls 4

rte_cryptodev_stopFunction · 0.85
rte_cryptodev_configureFunction · 0.85
rte_cryptodev_socket_idFunction · 0.85

Tested by

no test coverage detected