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 BAE12430B2; Sun, 20 Aug 2023 11:07:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D7A4410D7; Sun, 20 Aug 2023 11:07:38 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id E41C640A80 for ; Sun, 20 Aug 2023 11:07:36 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 9FF7A20718; Sun, 20 Aug 2023 11:07:36 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Bug in non-power-of-2 rings? Date: Sun, 20 Aug 2023 11:07:33 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87B20@smartserver.smartshare.dk> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Bug in non-power-of-2 rings? Thread-Index: AdnTRcFJLofpPgUJQi2nwmJrDMr1dg== From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Bruce Richardson" , , Cc: , X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Bruce, Honnappa, Konstantin, Back in 2017, Bruce added support for non-power-of-2 rings with this = patch [1]. [1]: = https://git.dpdk.org/dpdk/commit/lib/librte_ring/rte_ring.h?id=3Db7446115= 5543430f5253e96ad6d413ebcad36693 I think that the calculation of "entries" in __rte_ring_move_cons_head() = [2][3] is incorrect when the ring capacity is not power-of-2, because it = is missing the capacity comparison you added to rte_ring_count() [4]. = Please review if I'm mistaken. [2]: = https://elixir.bootlin.com/dpdk/v23.07/source/lib/ring/rte_ring_c11_pvt.h= #L159 [3]: = https://elixir.bootlin.com/dpdk/v23.07/source/lib/ring/rte_ring_generic_p= vt.h#L150 [4]: = https://elixir.bootlin.com/dpdk/v23.07/source/lib/ring/rte_ring.h#L502 -Morten