From: Ruifeng Wang <ruifeng.wang@arm.com>
To: david.hunt@intel.com
Cc: dev@dpdk.org, hkalra@marvell.com, gavin.hu@arm.com,
honnappa.nagarahalli@arm.com, nd@arm.com,
Ruifeng Wang <ruifeng.wang@arm.com>,
stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2 2/2] test/distributor: fix false unit test failure
Date: Sat, 12 Oct 2019 10:43:52 +0800 [thread overview]
Message-ID: <20191012024352.23545-3-ruifeng.wang@arm.com> (raw)
In-Reply-To: <20191012024352.23545-1-ruifeng.wang@arm.com>
Sanity test could spuriously fail with reporting flush count error.
It was caused by worker stat coherent issue between distributor and
worker thread.
Fix this issue by using atomic operations to update worker stat.
Fixes: c3eabff124e6 ("distributor: add unit tests")
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
---
app/test/test_distributor.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c
index 7090b55f8..ba1f81cf8 100644
--- a/app/test/test_distributor.c
+++ b/app/test/test_distributor.c
@@ -70,12 +70,14 @@ handle_work(void *arg)
buf[i] = NULL;
num = rte_distributor_get_pkt(db, id, buf, buf, num);
while (!quit) {
- worker_stats[id].handled_packets += num;
+ __atomic_fetch_add(&worker_stats[id].handled_packets, num,
+ __ATOMIC_RELAXED);
count += num;
num = rte_distributor_get_pkt(db, id,
buf, buf, num);
}
- worker_stats[id].handled_packets += num;
+ __atomic_fetch_add(&worker_stats[id].handled_packets, num,
+ __ATOMIC_RELAXED);
count += num;
rte_distributor_return_pkt(db, id, buf, num);
return 0;
--
2.17.1
next prev parent reply other threads:[~2019-10-12 2:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-08 9:55 [dpdk-dev] [PATCH] lib/distributor: fix deadlock issue for aarch64 Ruifeng Wang
2019-10-08 12:53 ` Hunt, David
2019-10-08 17:05 ` Aaron Conole
2019-10-08 19:46 ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-10-08 20:08 ` Aaron Conole
2019-10-09 5:52 ` Ruifeng Wang (Arm Technology China)
2019-10-17 11:42 ` [dpdk-dev] [EXT] " Harman Kalra
2019-10-17 13:48 ` Ruifeng Wang (Arm Technology China)
2019-10-12 2:43 ` [dpdk-dev] [PATCH v2 0/2] fix distributor unit test Ruifeng Wang
2019-10-12 2:43 ` [dpdk-dev] [PATCH v2 1/2] lib/distributor: fix deadlock issue for aarch64 Ruifeng Wang
2019-10-13 2:31 ` Honnappa Nagarahalli
2019-10-14 10:00 ` Ruifeng Wang (Arm Technology China)
2019-10-12 2:43 ` Ruifeng Wang [this message]
2019-10-15 9:28 ` [dpdk-dev] [PATCH v3 0/2] fix distributor unit test Ruifeng Wang
2019-10-15 9:28 ` [dpdk-dev] [PATCH v3 1/2] lib/distributor: fix deadlock issue for aarch64 Ruifeng Wang
2019-10-25 8:13 ` Hunt, David
2019-10-15 9:28 ` [dpdk-dev] [PATCH v3 2/2] test/distributor: fix false unit test failure Ruifeng Wang
2019-10-25 8:13 ` Hunt, David
2019-10-24 19:31 ` [dpdk-dev] [PATCH v3 0/2] fix distributor unit test David Marchand
2019-10-25 8:11 ` Hunt, David
2019-10-25 8:18 ` David Marchand
2019-10-25 8:20 ` Hunt, David
2019-10-25 8:33 ` David Marchand
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=20191012024352.23545-3-ruifeng.wang@arm.com \
--to=ruifeng.wang@arm.com \
--cc=david.hunt@intel.com \
--cc=dev@dpdk.org \
--cc=gavin.hu@arm.com \
--cc=hkalra@marvell.com \
--cc=honnappa.nagarahalli@arm.com \
--cc=nd@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).