| 1374 | } |
| 1375 | |
| 1376 | static int |
| 1377 | dev_configure_and_start(uint64_t ff_disable) |
| 1378 | { |
| 1379 | struct crypto_testsuite_params *ts_params = &testsuite_params; |
| 1380 | struct crypto_unittest_params *ut_params = &unittest_params; |
| 1381 | |
| 1382 | uint16_t qp_id; |
| 1383 | |
| 1384 | /* Clear unit test parameters before running test */ |
| 1385 | memset(ut_params, 0, sizeof(*ut_params)); |
| 1386 | |
| 1387 | /* Reconfigure device to default parameters */ |
| 1388 | ts_params->conf.socket_id = SOCKET_ID_ANY; |
| 1389 | ts_params->conf.ff_disable = ff_disable; |
| 1390 | ts_params->qp_conf.nb_descriptors = MAX_NUM_OPS_INFLIGHT; |
| 1391 | ts_params->qp_conf.mp_session = ts_params->session_mpool; |
| 1392 | |
| 1393 | TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0], |
| 1394 | &ts_params->conf), |
| 1395 | "Failed to configure cryptodev %u", |
| 1396 | ts_params->valid_devs[0]); |
| 1397 | |
| 1398 | for (qp_id = 0; qp_id < ts_params->conf.nb_queue_pairs ; qp_id++) { |
| 1399 | TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup( |
| 1400 | ts_params->valid_devs[0], qp_id, |
| 1401 | &ts_params->qp_conf, |
| 1402 | rte_cryptodev_socket_id(ts_params->valid_devs[0])), |
| 1403 | "Failed to setup queue pair %u on cryptodev %u", |
| 1404 | qp_id, ts_params->valid_devs[0]); |
| 1405 | } |
| 1406 | |
| 1407 | |
| 1408 | rte_cryptodev_stats_reset(ts_params->valid_devs[0]); |
| 1409 | |
| 1410 | /* Start the device */ |
| 1411 | TEST_ASSERT_SUCCESS(rte_cryptodev_start(ts_params->valid_devs[0]), |
| 1412 | "Failed to start cryptodev %u", |
| 1413 | ts_params->valid_devs[0]); |
| 1414 | |
| 1415 | return TEST_SUCCESS; |
| 1416 | } |
| 1417 | |
| 1418 | int |
| 1419 | ut_setup(void) |
no test coverage detected