app/test: remove crypto queue number hard-coding
authorFiona Trahe <fiona.trahe@intel.com>
Thu, 6 Oct 2016 17:34:29 +0000 (18:34 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Sat, 8 Oct 2016 15:54:38 +0000 (17:54 +0200)
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 <akhil.goyal@nxp.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
app/test/test_cryptodev.c
app/test/test_cryptodev_perf.c

index 63317bb..2917454 100644 (file)
@@ -413,7 +413,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;
 
@@ -525,6 +524,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]);
@@ -579,6 +579,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;
 }
 
index 27d8cf8..4aee9af 100644 (file)
@@ -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;