From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A343145B94 for ; Mon, 21 Oct 2024 18:09:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D8C940263; Mon, 21 Oct 2024 18:09:15 +0200 (CEST) Received: from forward500a.mail.yandex.net (forward500a.mail.yandex.net [178.154.239.80]) by mails.dpdk.org (Postfix) with ESMTP id 884CF40263; Mon, 21 Oct 2024 18:09:14 +0200 (CEST) Received: from mail-nwsmtp-smtp-production-main-54.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-54.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:728f:0:640:9453:0]) by forward500a.mail.yandex.net (Yandex) with ESMTPS id D193F610EB; Mon, 21 Oct 2024 19:09:13 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-54.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id P8UpSj0ZqW20-BZO8NB7Q; Mon, 21 Oct 2024 19:09:12 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1729526952; bh=NfEmfDXE7xPELBy8Nbe8CvSK31AkvIJBaXJOouzep54=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=hvGWbrjn87qcQ/zt9bej0n26KNNf9HG9hbzb3z1ryymqfaAFXMzCXGJwis15nMGpJ TOOhQzFRdsGw3Ycd/sknf0ElnQWns4XgAHMM2gAtgO+AATZucdEgvny32L3Q6kr8+r bV2bKaspsN/zSBC7DSdnVU99uox4CEeWlyoT6dfs= Authentication-Results: mail-nwsmtp-smtp-production-main-54.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Konstantin Ananyev 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, Konstantin Ananyev , stable@dpdk.org, Phanendra Vukkisala Subject: [PATCH v6 1/7] test/ring: fix failure with custom number of lcores Date: Mon, 21 Oct 2024 17:08:17 +0100 Message-Id: <20241021160823.1072-2-konstantin.v.ananyev@yandex.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241021160823.1072-1-konstantin.v.ananyev@yandex.ru> References: <20241015130111.826-1-konstantin.v.ananyev@yandex.ru> <20241021160823.1072-1-konstantin.v.ananyev@yandex.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Konstantin Ananyev 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 Signed-off-by: Konstantin Ananyev --- 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