DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
To: Feifei Wang <feifei.wang2@arm.com>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	Harry van Haaren <harry.van.haaren@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"Honnappa.Nagarahalli@arm.com" <Honnappa.Nagarahalli@arm.com>,
	"nd@arm.com" <nd@arm.com>, "stable@dpdk.org" <stable@dpdk.org>,
	Ruifeng Wang <ruifeng.wang@arm.com>
Subject: Re: [dpdk-dev] [EXT] [PATCH v1 1/5] app/eventdev: fix SMP barrier bugs for perf test
Date: Mon, 25 Jan 2021 17:50:47 +0000	[thread overview]
Message-ID: <CO6PR18MB3828307DDE72ADB079537BF9DEBD9@CO6PR18MB3828.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20210114070830.707550-2-feifei.wang2@arm.com>

>This patch fixes RTE SMP barrier bugs for the perf test of eventdev.
>
>For the "perf_process_last_stage" function, wmb after storing
>processed_pkts should be moved before it. This is because the worker
>lcore should ensure it has really finished data processing, e.g. event
>stored into buffers, before the shared variables "w-
>>processed_pkts"are
>stored.
>
>For the "perf_process_last_stage_latency", on the one hand, the wmb
>should be moved before storing into "w->processed_pkts". The reason
>is
>the same as above. But on the other hand, for "w->latency", wmb is
>unnecessary due to data dependency.
>
>Fixes: 2369f73329f8 ("app/testeventdev: add perf queue worker
>functions")
>Cc: jerinj@marvell.com
>Cc: stable@dpdk.org
>
>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 | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
>diff --git a/app/test-eventdev/test_perf_common.h b/app/test-
>eventdev/test_perf_common.h
>index ff9705df8..e7233e5a5 100644
>--- a/app/test-eventdev/test_perf_common.h
>+++ b/app/test-eventdev/test_perf_common.h
>@@ -97,8 +97,13 @@ perf_process_last_stage(struct rte_mempool
>*const pool,
> 		void *bufs[], int const buf_sz, uint8_t count)
> {
> 	bufs[count++] = ev->event_ptr;
>-	w->processed_pkts++;
>+
>+	/* wmb here ensures event_prt is stored before
>+	 * updating the number of processed packets
>+	 * for worker lcores
>+	 */
> 	rte_smp_wmb();
>+	w->processed_pkts++;
>
> 	if (unlikely(count == buf_sz)) {
> 		count = 0;
>@@ -116,6 +121,12 @@ perf_process_last_stage_latency(struct
>rte_mempool *const pool,
> 	struct perf_elt *const m = ev->event_ptr;
>
> 	bufs[count++] = ev->event_ptr;
>+
>+	/* wmb here ensures event_prt is stored before
>+	 * updating the number of processed packets
>+	 * for worker lcores
>+	 */
>+	rte_smp_wmb();
> 	w->processed_pkts++;
>
> 	if (unlikely(count == buf_sz)) {
>@@ -127,7 +138,6 @@ perf_process_last_stage_latency(struct
>rte_mempool *const pool,
> 	}
>
> 	w->latency += latency;
>-	rte_smp_wmb();
> 	return count;
> }
>
>--
>2.25.1


  reply	other threads:[~2021-01-25 17:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14  7:08 [dpdk-dev] [PATCH v1 0/5] refactor smp barriers in app/eventdev Feifei Wang
2021-01-14  7:08 ` [dpdk-dev] [PATCH v1 1/5] app/eventdev: fix SMP barrier bugs for perf test Feifei Wang
2021-01-25 17:50   ` Pavan Nikhilesh Bhagavatula [this message]
2021-01-14  7:08 ` [dpdk-dev] [PATCH v1 2/5] app/eventdev: remove unnecessary barriers " Feifei Wang
2021-01-25 17:48   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-01-14  7:08 ` [dpdk-dev] [PATCH v1 3/5] app/eventdev: replace wmb with thread fence " Feifei Wang
2021-01-25 17:50   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-01-14  7:08 ` [dpdk-dev] [PATCH v1 4/5] app/eventdev: remove unnecessary barriers for pipeline test Feifei Wang
2021-01-25 17:50   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-01-14  7:08 ` [dpdk-dev] [PATCH v1 5/5] app/eventdev: remove unnecessary barriers for order test Feifei Wang
2021-01-25 17:49   ` [dpdk-dev] [EXT] " Pavan Nikhilesh Bhagavatula
2021-01-26 15:56     ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO6PR18MB3828307DDE72ADB079537BF9DEBD9@CO6PR18MB3828.namprd18.prod.outlook.com \
    --to=pbhagavatula@marvell.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=dev@dpdk.org \
    --cc=feifei.wang2@arm.com \
    --cc=harry.van.haaren@intel.com \
    --cc=jerinj@marvell.com \
    --cc=nd@arm.com \
    --cc=ruifeng.wang@arm.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).