for (i = 0; i < sched_ctx->nb_slaves; i++) {
uint8_t slave_dev_id = sched_ctx->slaves[i].dev_id;
- struct rte_cryptodev *slave_dev =
- rte_cryptodev_pmd_get_dev(slave_dev_id);
- ret = (*slave_dev->dev_ops->dev_configure)(slave_dev,
- config);
+ ret = rte_cryptodev_configure(slave_dev_id, config);
if (ret < 0)
break;
}
/** Setup a queue pair */
static int
scheduler_pmd_qp_setup(struct rte_cryptodev *dev, uint16_t qp_id,
- __rte_unused const struct rte_cryptodev_qp_conf *qp_conf, int socket_id)
+ const struct rte_cryptodev_qp_conf *qp_conf, int socket_id)
{
struct scheduler_ctx *sched_ctx = dev->data->dev_private;
struct scheduler_qp_ctx *qp_ctx;
char name[RTE_CRYPTODEV_NAME_MAX_LEN];
+ uint32_t i;
+ int ret;
if (snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN,
"CRYTO_SCHE PMD %u QP %u",
if (dev->data->queue_pairs[qp_id] != NULL)
scheduler_pmd_qp_release(dev, qp_id);
+ for (i = 0; i < sched_ctx->nb_slaves; i++) {
+ uint8_t slave_id = sched_ctx->slaves[i].dev_id;
+
+ ret = rte_cryptodev_queue_pair_setup(slave_id, qp_id,
+ qp_conf, socket_id);
+ if (ret < 0)
+ return ret;
+ }
+
/* Allocate the queue pair data structure. */
qp_ctx = rte_zmalloc_socket(name, sizeof(*qp_ctx), RTE_CACHE_LINE_SIZE,
socket_id);
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
uint8_t sched_id = ts_params->valid_devs[0];
- uint32_t nb_devs, qp_id, i, nb_devs_attached = 0;
+ uint32_t nb_devs, i, nb_devs_attached = 0;
int ret;
- struct rte_cryptodev_config config = {
- .nb_queue_pairs = 8,
- .socket_id = SOCKET_ID_ANY,
- .session_mp = {
- .nb_objs = 2048,
- .cache_size = 256
- }
- };
- struct rte_cryptodev_qp_conf qp_conf = {2048};
/* create 2 AESNI_MB if necessary */
nb_devs = rte_cryptodev_count_devtype(
if (info.dev_type != RTE_CRYPTODEV_AESNI_MB_PMD)
continue;
- ret = rte_cryptodev_configure(i, &config);
- TEST_ASSERT(ret == 0,
- "Failed to configure device %u of pmd : %s", i,
- RTE_STR(CRYPTODEV_NAME_AESNI_MB_PMD));
-
- for (qp_id = 0; qp_id < info.max_nb_queue_pairs; qp_id++) {
- TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
- i, qp_id, &qp_conf,
- rte_cryptodev_socket_id(i)),
- "Failed to setup queue pair %u on "
- "cryptodev %u", qp_id, i);
- }
-
ret = rte_cryptodev_scheduler_slave_attach(sched_id,
(uint8_t)i);