net/virtio: add vectorized packed ring NEON Rx
[dpdk.git] / app / test-sad / main.c
index 22e10cb..1024757 100644 (file)
@@ -518,6 +518,9 @@ lookup(void *arg)
        uint32_t burst_sz;
        struct rte_ipsec_sad *sad = arg;
 
+       if (config.nb_tuples == 0)
+               return 0;
+
        burst_sz = RTE_MIN(config.burst_sz, config.nb_tuples);
        for (i = 0; i < config.nb_tuples; i += burst_sz) {
                for (j = 0; j < burst_sz; j++)
@@ -533,6 +536,7 @@ lookup(void *arg)
                                print_result(keys[j], vals[j]);
                }
        }
+       acc = (acc == 0) ? UINT64_MAX : acc;
        printf("Average lookup cycles %.2Lf, lookups/sec: %.2Lf\n",
                (long double)acc / config.nb_tuples,
                (long double)config.nb_tuples * rte_get_tsc_hz() / acc);
@@ -613,7 +617,7 @@ main(int argc, char **argv)
 {
        int ret;
        struct rte_ipsec_sad *sad;
-       struct rte_ipsec_sad_conf conf;
+       struct rte_ipsec_sad_conf conf = {0};
        unsigned int lcore_id;
 
        ret = rte_eal_init(argc, argv);
@@ -653,11 +657,11 @@ main(int argc, char **argv)
 
        add_rules(sad, 10);
        if (config.parallel_lookup)
-               rte_eal_mp_remote_launch(lookup, sad, SKIP_MASTER);
+               rte_eal_mp_remote_launch(lookup, sad, SKIP_MAIN);
 
        lookup(sad);
        if (config.parallel_lookup)
-               RTE_LCORE_FOREACH_SLAVE(lcore_id)
+               RTE_LCORE_FOREACH_WORKER(lcore_id)
                        if (rte_eal_wait_lcore(lcore_id) < 0)
                                return -1;