diff mbox series

[v1,3/5] app/eventdev: replace wmb with thread fence for perf test

Message ID 20210114070830.707550-4-feifei.wang2@arm.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers show
Series refactor smp barriers in app/eventdev | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Feifei Wang Jan. 14, 2021, 7:08 a.m. UTC
Simply replace rte_smp barrier with atomic threand fence.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 app/test-eventdev/test_perf_common.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Pavan Nikhilesh Bhagavatula Jan. 25, 2021, 5:50 p.m. UTC | #1
>Simply replace rte_smp barrier with atomic threand fence.
>
>Signed-off-by: Phil Yang <phil.yang@arm.com>
>Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
>Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>---
> app/test-eventdev/test_perf_common.h | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
>diff --git a/app/test-eventdev/test_perf_common.h b/app/test-
>eventdev/test_perf_common.h
>index e7233e5a5..9785dc3e2 100644
>--- a/app/test-eventdev/test_perf_common.h
>+++ b/app/test-eventdev/test_perf_common.h
>@@ -98,11 +98,11 @@ perf_process_last_stage(struct rte_mempool
>*const pool,
> {
> 	bufs[count++] = ev->event_ptr;
>
>-	/* wmb here ensures event_prt is stored before
>-	 * updating the number of processed packets
>-	 * for worker lcores
>+	/* release fence here ensures event_prt is
>+	 * stored before updating the number of
>+	 * processed packets for worker lcores
> 	 */
>-	rte_smp_wmb();
>+	rte_atomic_thread_fence(__ATOMIC_RELEASE);
> 	w->processed_pkts++;
>
> 	if (unlikely(count == buf_sz)) {
>@@ -122,11 +122,11 @@ perf_process_last_stage_latency(struct
>rte_mempool *const pool,
>
> 	bufs[count++] = ev->event_ptr;
>
>-	/* wmb here ensures event_prt is stored before
>-	 * updating the number of processed packets
>-	 * for worker lcores
>+	/* release fence here ensures event_prt is
>+	 * stored before updating the number of
>+	 * processed packets for worker lcores
> 	 */
>-	rte_smp_wmb();
>+	rte_atomic_thread_fence(__ATOMIC_RELEASE);
> 	w->processed_pkts++;
>
> 	if (unlikely(count == buf_sz)) {
>--
>2.25.1
diff mbox series

Patch

diff --git a/app/test-eventdev/test_perf_common.h b/app/test-eventdev/test_perf_common.h
index e7233e5a5..9785dc3e2 100644
--- a/app/test-eventdev/test_perf_common.h
+++ b/app/test-eventdev/test_perf_common.h
@@ -98,11 +98,11 @@  perf_process_last_stage(struct rte_mempool *const pool,
 {
 	bufs[count++] = ev->event_ptr;
 
-	/* wmb here ensures event_prt is stored before
-	 * updating the number of processed packets
-	 * for worker lcores
+	/* release fence here ensures event_prt is
+	 * stored before updating the number of
+	 * processed packets for worker lcores
 	 */
-	rte_smp_wmb();
+	rte_atomic_thread_fence(__ATOMIC_RELEASE);
 	w->processed_pkts++;
 
 	if (unlikely(count == buf_sz)) {
@@ -122,11 +122,11 @@  perf_process_last_stage_latency(struct rte_mempool *const pool,
 
 	bufs[count++] = ev->event_ptr;
 
-	/* wmb here ensures event_prt is stored before
-	 * updating the number of processed packets
-	 * for worker lcores
+	/* release fence here ensures event_prt is
+	 * stored before updating the number of
+	 * processed packets for worker lcores
 	 */
-	rte_smp_wmb();
+	rte_atomic_thread_fence(__ATOMIC_RELEASE);
 	w->processed_pkts++;
 
 	if (unlikely(count == buf_sz)) {