X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_distributor_perf.c;h=fdbeae6d2f11021836122474cc46d40cd92577a7;hb=7df485eb3d56fbe5e6fcd160d33ca971bc3d3572;hp=664530ff9e333fb62f02f0637628ebda9122e3aa;hpb=bb79646a47643c8802788ae2e9e99d81c1f9fcc0;p=dpdk.git diff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_perf.c index 664530ff9e..fdbeae6d2f 100644 --- a/app/test/test_distributor_perf.c +++ b/app/test/test_distributor_perf.c @@ -25,7 +25,7 @@ static volatile unsigned worker_idx; struct worker_stats { volatile unsigned handled_packets; } __rte_cache_aligned; -struct worker_stats worker_stats[RTE_MAX_LCORE]; +static struct worker_stats worker_stats[RTE_MAX_LCORE]; /* * worker thread used for testing the time to do a round-trip of a cache @@ -54,10 +54,10 @@ time_cache_line_switch(void) /* allocate a full cache line for data, we use only first byte of it */ uint64_t data[RTE_CACHE_LINE_SIZE*3 / sizeof(uint64_t)]; - unsigned i, slaveid = rte_get_next_lcore(rte_lcore_id(), 0, 0); + unsigned int i, workerid = rte_get_next_lcore(rte_lcore_id(), 0, 0); volatile uint64_t *pdata = &data[0]; *pdata = 1; - rte_eal_remote_launch((lcore_function_t *)flip_bit, &data[0], slaveid); + rte_eal_remote_launch((lcore_function_t *)flip_bit, &data[0], workerid); while (*pdata) rte_pause(); @@ -72,7 +72,7 @@ time_cache_line_switch(void) while (*pdata) rte_pause(); *pdata = 2; - rte_eal_wait_lcore(slaveid); + rte_eal_wait_lcore(workerid); printf("==== Cache line switch test ===\n"); printf("Time for %u iterations = %"PRIu64" ticks\n", (1<hash.usr = i << 1; - rte_distributor_process(d, bufs, num_workers); + rte_distributor_process(d, &bufs[i], 1); + } rte_mempool_put_bulk(p, (void *)bufs, num_workers); rte_distributor_process(d, NULL, 0); + rte_distributor_flush(d); rte_eal_mp_wait_lcore(); quit = 0; worker_idx = 0; @@ -251,13 +253,13 @@ test_distributor_perf(void) } printf("=== Performance test of distributor (single mode) ===\n"); - rte_eal_mp_remote_launch(handle_work, ds, SKIP_MASTER); + rte_eal_mp_remote_launch(handle_work, ds, SKIP_MAIN); if (perf_test(ds, p) < 0) return -1; quit_workers(ds, p); printf("=== Performance test of distributor (burst mode) ===\n"); - rte_eal_mp_remote_launch(handle_work, db, SKIP_MASTER); + rte_eal_mp_remote_launch(handle_work, db, SKIP_MAIN); if (perf_test(db, p) < 0) return -1; quit_workers(db, p);