From 5cba7cbd9f2bbb29034df8c19413e92e7346a624 Mon Sep 17 00:00:00 2001 From: Fiona Trahe Date: Thu, 6 Oct 2016 18:34:27 +0100 Subject: [PATCH] app/test: remove useless loop for crypto Signed-off-by: Fiona Trahe --- app/test/test_cryptodev.c | 48 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 9767704e48..7ff56736fb 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -357,37 +357,35 @@ testsuite_setup(void) return TEST_FAILED; /* Set up all the qps on the first of the valid devices found */ - for (i = 0; i < 1; i++) { - dev_id = ts_params->valid_devs[i]; - rte_cryptodev_info_get(dev_id, &info); + dev_id = ts_params->valid_devs[0]; - /* - * Since we can't free and re-allocate queue memory always set - * the queues on this device up to max size first so enough - * memory is allocated for any later re-configures needed by - * other tests - */ + rte_cryptodev_info_get(dev_id, &info); + + /* + * Since we can't free and re-allocate queue memory always set + * the queues on this device up to max size first so enough + * memory is allocated for any later re-configures needed by + * other tests + */ - ts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs; - ts_params->conf.socket_id = SOCKET_ID_ANY; - ts_params->conf.session_mp.nb_objs = info.sym.max_nb_sessions; + ts_params->conf.nb_queue_pairs = info.max_nb_queue_pairs; + ts_params->conf.socket_id = SOCKET_ID_ANY; + ts_params->conf.session_mp.nb_objs = info.sym.max_nb_sessions; - TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id, - &ts_params->conf), - "Failed to configure cryptodev %u with %u qps", - dev_id, ts_params->conf.nb_queue_pairs); + TEST_ASSERT_SUCCESS(rte_cryptodev_configure(dev_id, + &ts_params->conf), + "Failed to configure cryptodev %u with %u qps", + dev_id, ts_params->conf.nb_queue_pairs); - ts_params->qp_conf.nb_descriptors = MAX_NUM_OPS_INFLIGHT; + ts_params->qp_conf.nb_descriptors = MAX_NUM_OPS_INFLIGHT; - for (qp_id = 0; qp_id < info.max_nb_queue_pairs; qp_id++) { - TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup( - dev_id, qp_id, &ts_params->qp_conf, - rte_cryptodev_socket_id(dev_id)), - "Failed to setup queue pair %u on " - "cryptodev %u", - qp_id, dev_id); - } + for (qp_id = 0; qp_id < info.max_nb_queue_pairs; qp_id++) { + TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup( + dev_id, qp_id, &ts_params->qp_conf, + rte_cryptodev_socket_id(dev_id)), + "Failed to setup queue pair %u on cryptodev %u", + qp_id, dev_id); } return TEST_SUCCESS; -- 2.20.1