The measure_perf function should be executed after worker threads exit
to collect correct perf data. Otherwise, while workers are running, the
main thread may get incomplete data from workers.
In the meanwhile, remove unnecessary barrier in the test.
For signal variables "ldata.done" and "ldata.start", no operations
should keep the order that being executed after them. So the wmb after
them can be moved.
Fixes:
16a277a24c9f ("test/trace: add performance test cases")
Cc: stable@dpdk.org
Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
for (workers = 0; workers < data->nb_workers; workers++) {
data->ldata[workers].done = 1;
- rte_smp_wmb();
}
}
{ \
struct lcore_data *ldata = arg; \
ldata->started = 1; \
- rte_smp_wmb(); \
__worker_##func(ldata); \
return 0; \
}
wait_till_workers_are_ready(data);
rte_delay_ms(100); /* Wait for some time to accumulate the stats */
- measure_perf(str, data);
signal_workers_to_finish(data);
RTE_LCORE_FOREACH_WORKER(id)
rte_eal_wait_lcore(id);
+
+ measure_perf(str, data);
}
static int