ethdev: add TTL change actions to flow API
[dpdk.git] / app / test-crypto-perf / main.c
index 83a9d7b..d905e13 100644 (file)
@@ -80,12 +80,12 @@ cperf_initialize_cryptodev(struct cperf_options *opts, uint8_t *enabled_cdevs,
 
        nb_lcores = rte_lcore_count() - 1;
 
-       if (enabled_cdev_count > nb_lcores) {
-               printf("Number of capable crypto devices (%d) "
-                               "has to be less or equal to number of slave "
-                               "cores (%d)\n", enabled_cdev_count, nb_lcores);
-               return -EINVAL;
-       }
+       /*
+        * Use less number of devices,
+        * if there are more available than cores.
+        */
+       if (enabled_cdev_count > nb_lcores)
+               enabled_cdev_count = nb_lcores;
 
        /* Create a mempool shared by all the devices */
        uint32_t max_sess_size = 0, sess_size;
@@ -579,19 +579,17 @@ main(int argc, char **argv)
                        i = 0;
                        RTE_LCORE_FOREACH_SLAVE(lcore_id) {
 
-                               if (i == nb_cryptodevs)
+                               if (i == total_nb_qps)
                                        break;
 
-                               cdev_id = enabled_cdevs[i];
-
                                rte_eal_remote_launch(cperf_testmap[opts.test].runner,
-                                       ctx[cdev_id], lcore_id);
+                                       ctx[i], lcore_id);
                                i++;
                        }
                        i = 0;
                        RTE_LCORE_FOREACH_SLAVE(lcore_id) {
 
-                               if (i == nb_cryptodevs)
+                               if (i == total_nb_qps)
                                        break;
                                rte_eal_wait_lcore(lcore_id);
                                i++;
@@ -634,8 +632,6 @@ err:
                if (i == total_nb_qps)
                        break;
 
-               cdev_id = enabled_cdevs[i];
-
                if (ctx[i] && cperf_testmap[opts.test].destructor)
                        cperf_testmap[opts.test].destructor(ctx[i]);
                i++;