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 BD46CA0508; Wed, 13 Apr 2022 09:08:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ACF35410DD; Wed, 13 Apr 2022 09:08:19 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 59E004068B for ; Wed, 13 Apr 2022 09:08:18 +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 1/1] common/cnxk: added new macros to platform layer Date: Wed, 13 Apr 2022 09:08:16 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D86FD7@smartserver.smartshare.dk> In-Reply-To: <20220412174224.13143-1-syalavarthi@marvell.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 1/1] common/cnxk: added new macros to platform layer Thread-Index: AdhOlL9xW/+I9rEsQ129RCFxvtI/XgAb+KHw References: <20220412174224.13143-1-syalavarthi@marvell.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Srikanth Yalavarthi" , "Nithin Dabilpuram" , "Kiran Kumar K" , "Sunil Kumar Kori" , "Satha Rao" 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 > From: Srikanth Yalavarthi [mailto:syalavarthi@marvell.com] > Sent: Tuesday, 12 April 2022 19.42 >=20 > Added new macros for pointer operations, bitwise operations, > spinlocks and 32 bit read and write. >=20 > Signed-off-by: Srikanth Yalavarthi > --- > drivers/common/cnxk/roc_bits.h | 12 ++++++++++++ > drivers/common/cnxk/roc_platform.h | 28 +++++++++++++++++++--------- > 2 files changed, 31 insertions(+), 9 deletions(-) >=20 > diff --git a/drivers/common/cnxk/roc_bits.h > b/drivers/common/cnxk/roc_bits.h > index 11216d9d63..ce3dffa08d 100644 > --- a/drivers/common/cnxk/roc_bits.h > +++ b/drivers/common/cnxk/roc_bits.h > @@ -29,4 +29,16 @@ > (~0ULL >> (BITS_PER_LONG_LONG - 1 - (h)))) > #endif >=20 > +#ifndef IS_BIT_SET > +#define IS_BIT_SET(num, n) ((num) & (1 << (n))) > +#endif > + > +#ifndef SET_BIT > +#define SET_BIT(num, n) ((num) | (1 << (n))) > +#endif > + > +#ifndef CLEAR_BIT > +#define CLEAR_BIT(num, n) ((num) &=3D ~((1) << (n))) > +#endif > + > #endif /* _ROC_BITS_H_ */ You could consider replacing these with explicit 32/64 bit variants, = using the RTE_BIT64() and RTE_BIT32() macros instead of (1 << (n)). Just a suggestion - I'll leave it up to you. -Morten