[dpdk-dev] [PATCH v1 1/2] app/test: remove unnecessary barriers for ring stress test
Feifei Wang
feifei.wang2 at arm.com
Tue Dec 22 07:30:53 CET 2020
The variable "wrk_cmd" is a signal to control threads from running and
stopping. When worker lcores load "wrk_cmd == WRK_CMD_RUN", they start
running and when worker lcores load "wrk_cmd == WRK_CMD_STOP", they
stop.
For the wmb in test_mt1, no storing operations must keep the order
after storing "wrk_cmd". Thus the wmb is unnecessary.
For the rmb in test_worker, the parameters have been prepared when
worker lcores call "test_worker". It is unnessary to wait wrk_cmd to be
loaded, then the parameters can be loaded, So the rmb can be removed.
In the meanwhile, fix a typo. The note above storing "stop" into
"wrk_cmd" should be "stop test" rather than "start test".
Signed-off-by: Feifei Wang <feifei.wang2 at arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli at arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang at arm.com>
---
app/test/test_ring_stress_impl.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/app/test/test_ring_stress_impl.h b/app/test/test_ring_stress_impl.h
index f9ca63b90..384555ef9 100644
--- a/app/test/test_ring_stress_impl.h
+++ b/app/test/test_ring_stress_impl.h
@@ -198,7 +198,6 @@ test_worker(void *arg, const char *fname, int32_t prcs)
fill_ring_elm(&loc_elm, lc);
while (wrk_cmd != WRK_CMD_RUN) {
- rte_smp_rmb();
rte_pause();
}
@@ -357,13 +356,11 @@ test_mt1(int (*test)(void *))
/* signal worker to start test */
wrk_cmd = WRK_CMD_RUN;
- rte_smp_wmb();
usleep(run_time * US_PER_S);
- /* signal worker to start test */
+ /* signal worker to stop test */
wrk_cmd = WRK_CMD_STOP;
- rte_smp_wmb();
/* wait for workers and collect stats. */
mc = rte_lcore_id();
--
2.17.1
More information about the dev
mailing list