From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 6DBE829CF for ; Thu, 6 Oct 2016 19:45:49 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 06 Oct 2016 10:45:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,454,1473145200"; d="scan'208";a="1050387179" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.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 u96HjjER026589; Thu, 6 Oct 2016 18:45:46 +0100 Received: by linux.site (Postfix, from userid 11342333) id 1A3ABE3BC6; 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:29 +0100 Message-Id: <1475775269-21454-5-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 4/4] app/test: remove hard-coding of crypto num qps 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 ts_params->conf.nb_queue_pairs should not be hard coded with device specific number. It should be retrieved from the device info. Any test which changes it should restore it to orig value. Signed-off-by: Akhil Goyal Signed-off-by: Fiona Trahe --- app/test/test_cryptodev.c | 5 ++++- app/test/test_cryptodev_perf.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index e0b0252..83036a1 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -414,7 +414,6 @@ ut_setup(void) memset(ut_params, 0, sizeof(*ut_params)); /* Reconfigure device to default parameters */ - ts_params->conf.nb_queue_pairs = DEFAULT_NUM_QPS_PER_QAT_DEVICE; ts_params->conf.socket_id = SOCKET_ID_ANY; ts_params->conf.session_mp.nb_objs = DEFAULT_NUM_OPS_INFLIGHT; @@ -526,6 +525,7 @@ static int test_device_configure_invalid_queue_pair_ids(void) { struct crypto_testsuite_params *ts_params = &testsuite_params; + uint16_t orig_nb_qps = ts_params->conf.nb_queue_pairs; /* Stop the device in case it's started so it can be configured */ rte_cryptodev_stop(ts_params->valid_devs[0]); @@ -580,6 +580,9 @@ test_device_configure_invalid_queue_pair_ids(void) ts_params->valid_devs[0], ts_params->conf.nb_queue_pairs); + /* revert to original testsuite value */ + ts_params->conf.nb_queue_pairs = orig_nb_qps; + return TEST_SUCCESS; } diff --git a/app/test/test_cryptodev_perf.c b/app/test/test_cryptodev_perf.c index 27d8cf8..4aee9af 100644 --- a/app/test/test_cryptodev_perf.c +++ b/app/test/test_cryptodev_perf.c @@ -431,7 +431,7 @@ testsuite_setup(void) rte_cryptodev_info_get(ts_params->dev_id, &info); - ts_params->conf.nb_queue_pairs = DEFAULT_NUM_QPS_PER_QAT_DEVICE; + 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; -- 2.5.0