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 9197DA00C2; Mon, 22 Aug 2022 09:25:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 830F641611; Mon, 22 Aug 2022 09:25:26 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 90AE640150 for ; Mon, 22 Aug 2022 09:25:25 +0200 (CEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH 3/3] eal: deduplicate roundup code Date: Mon, 22 Aug 2022 09:25:23 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D8728F@smartserver.smartshare.dk> In-Reply-To: <20220821205009.1317044-4-dmitry.kozliuk@gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 3/3] eal: deduplicate roundup code Thread-Index: Adi1n7MjF1tnn6JdRp2LIOY1/RwMfAAWJiDA References: <20220821205009.1317044-1-dmitry.kozliuk@gmail.com> <20220821205009.1317044-4-dmitry.kozliuk@gmail.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Dmitry Kozlyuk" , 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 > From: Dmitry Kozlyuk [mailto:dmitry.kozliuk@gmail.com] > Sent: Sunday, 21 August 2022 22.50 >=20 > RTE_CACHE_LINE_ROUNDUP() implementation repeated RTE_ALIGN_MUL_CEIL(). > In other places RTE_CACHE_LINE_SIZE is assumed to be a power-of-2, > so define RTE_CACHE_LINE_ROUNDUP() using RTE_ALIGN_CEIL(). >=20 > Signed-off-by: Dmitry Kozlyuk > --- > lib/eal/include/rte_common.h | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > diff --git a/lib/eal/include/rte_common.h > b/lib/eal/include/rte_common.h > index 772e40f8c2..86c50c55e0 100644 > --- a/lib/eal/include/rte_common.h > +++ b/lib/eal/include/rte_common.h > @@ -425,9 +425,7 @@ rte_is_aligned(void *ptr, unsigned align) > #define RTE_CACHE_LINE_MASK (RTE_CACHE_LINE_SIZE-1) >=20 > /** Return the first cache-aligned value greater or equal to size. */ > -#define RTE_CACHE_LINE_ROUNDUP(size) \ > - (RTE_CACHE_LINE_SIZE * ((size + RTE_CACHE_LINE_SIZE - 1) / \ > - RTE_CACHE_LINE_SIZE)) > +#define RTE_CACHE_LINE_ROUNDUP(size) RTE_ALIGN_CEIL(size, > RTE_CACHE_LINE_SIZE) >=20 > /** Cache line size in terms of log2 */ > #if RTE_CACHE_LINE_SIZE =3D=3D 64 > -- > 2.33.1 >=20 Reviewed-by: Morten Br=F8rup