From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id A096C29CF for ; Thu, 6 Oct 2016 19:45:48 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP; 06 Oct 2016 10:45:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,454,1473145200"; d="scan'208";a="17002543" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga005.jf.intel.com with ESMTP; 06 Oct 2016 10:45:46 -0700 Received: from linux.site (sisvmlab045.ir.intel.com [10.237.216.52]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id u96Hjj7p026585; Thu, 6 Oct 2016 18:45:45 +0100 Received: by linux.site (Postfix, from userid 11342333) id 15B12E3BC3; Thu, 6 Oct 2016 18:34:51 +0100 (IST) From: Fiona Trahe To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com, akhil.goyal@nxp.com Date: Thu, 6 Oct 2016 18:34:27 +0100 Message-Id: <1475775269-21454-3-git-send-email-fiona.trahe@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <20160926163300.22990-1-akhil.goyal@nxp.com> References: <20160926163300.22990-1-akhil.goyal@nxp.com> Subject: [dpdk-dev] [PATCH v3 2/4] app/test: remove pointless for loop X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2016 17:45:49 -0000 Signed-off-by: Fiona Trahe --- app/test/test_cryptodev.c | 49 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index 8f40dea..db2f23c 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); - 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; + /* + * 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 + */ - 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->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->qp_conf.nb_descriptors = MAX_NUM_OPS_INFLIGHT; + 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); - 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); - } + 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); } return TEST_SUCCESS; -- 2.5.0