From: Konstantin Ananyev <konstantin.ananyev@huawei.com>
To: <dev@dpdk.org>
Cc: <honnappa.nagarahalli@arm.com>, <jerinj@marvell.com>,
<hemant.agrawal@nxp.com>, <drc@linux.vnet.ibm.com>,
<ruifeng.wang@arm.com>, <mb@smartsharesystems.com>,
<eimear.morrissey@huawei.com>, <stephen@networkplumber.org>,
<stable@dpdk.org>, Phanendra Vukkisala <pvukkisala@marvell.com>
Subject: [PATCH v6 1/7] test/ring: fix failure with custom number of lcores
Date: Mon, 21 Oct 2024 18:47:39 +0100 [thread overview]
Message-ID: <20241021174745.1843-2-konstantin.ananyev@huawei.com> (raw)
In-Reply-To: <20241021174745.1843-1-konstantin.ananyev@huawei.com>
ring_stress_autotest fails to initialize the ring when RTE_MAX_LCORE value
is not a number of 2.
There is a flaw in calculation required number of elements in the ring.
Fix it by aligning number of elements to next power of 2.
Fixes: bf28df24e915 ("test/ring: add contention stress test")
Cc: stable@dpdk.org
Reported-by: Phanendra Vukkisala <pvukkisala@marvell.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
---
app/test/test_ring_stress_impl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/test/test_ring_stress_impl.h b/app/test/test_ring_stress_impl.h
index 8b0bfb11fe..ee5274aeef 100644
--- a/app/test/test_ring_stress_impl.h
+++ b/app/test/test_ring_stress_impl.h
@@ -297,7 +297,7 @@ mt1_init(struct rte_ring **rng, void **data, uint32_t num)
*data = elm;
/* alloc ring */
- nr = 2 * num;
+ nr = rte_align32pow2(2 * num);
sz = rte_ring_get_memsize(nr);
r = rte_zmalloc(NULL, sz, alignof(typeof(*r)));
if (r == NULL) {
--
2.35.3
next prev parent reply other threads:[~2024-10-21 17:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20241015130111.826-1-konstantin.v.ananyev@yandex.ru>
[not found] ` <20241021160823.1072-1-konstantin.v.ananyev@yandex.ru>
2024-10-21 16:08 ` Konstantin Ananyev
[not found] ` <20241021174745.1843-1-konstantin.ananyev@huawei.com>
2024-10-21 17:47 ` Konstantin Ananyev [this message]
[not found] ` <20241030212304.104180-1-konstantin.ananyev@huawei.com>
2024-10-30 21:22 ` [PATCH v7 " Konstantin Ananyev
2024-11-07 11:50 ` Morten Brørup
[not found] ` <20241107182429.60406-1-konstantin.ananyev@huawei.com>
2024-11-07 18:24 ` [PATCH v8 " Konstantin Ananyev
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=20241021174745.1843-2-konstantin.ananyev@huawei.com \
--to=konstantin.ananyev@huawei.com \
--cc=dev@dpdk.org \
--cc=drc@linux.vnet.ibm.com \
--cc=eimear.morrissey@huawei.com \
--cc=hemant.agrawal@nxp.com \
--cc=honnappa.nagarahalli@arm.com \
--cc=jerinj@marvell.com \
--cc=mb@smartsharesystems.com \
--cc=pvukkisala@marvell.com \
--cc=ruifeng.wang@arm.com \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.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).