From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3D0FCA04A5; Wed, 17 Jun 2020 10:05:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B96FD1252; Wed, 17 Jun 2020 10:05:20 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 597301150 for ; Wed, 17 Jun 2020 10:05:19 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id CA9B85C010C; Wed, 17 Jun 2020 04:05:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 17 Jun 2020 04:05:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= e2MxfeL6qk0Yd6c1OL0umA0eQnDSKV905a8e7Fm6y68=; b=inrt522n1Sa2DM85 Scd/I9a+uK2XQ8aRv1v5WMJTZyk26XHERsfR7MkrzkuaXfu45pcUym7iJscfpHyb anf00HnoWxY+N+dGNKClevjvWKLzvgihapwvRS+yc5i8RUHgzp34LpbbANLiF7Mo iGgKdu/T/obGSInJOt4G0R3mrCkHGOI/W3KJtrPiBGUgy8i/Z65FRLPqe7zh43t6 YQo+BH+65Y44TghK7/JYmPKpuH7Im980NRwv9ewFkx513mmPbxNVag3vV/z7Ar2n AeonNBHr8S9YMwqGsVi/fy490aM/NRiRXA1AdsSFtbXQvCbobV+q6jlCB8DMzN/7 51cg2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=e2MxfeL6qk0Yd6c1OL0umA0eQnDSKV905a8e7Fm6y 68=; b=AvyllGOHAA3QJNQ28udRWwX091beuWJdRivir/vRvKijXCba/INcWRmnR unoH5ZLrlaw7zLmm9fH1aea7lkkghoqQ6WwmBy5qvzQDfwRaRyJFC0paoO2ihQ5d thX3973aJiBo2cndIcxK4EJpIeeDme1dQOKZ7tlvavBtTDDIsQfb6VlRGM4jeteh 55OH4d9nTsGLD5nbR2v36AFUnSfx5IrD+JgklY/1MQsUcY4lBL6iU/7fDESzmejL OinJ8pjnVDjpwS5iOMZkWcbfY5uZdBNLRR1yid23IAWPHvFxuugnORnrQRv+UXsM tsFwcweqQzHDT51dHq1QE0tST/QuQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudejvdcutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvffufffkjghfggfgtgesthhqredttddtudenucfhrhhomhepvfhhohhmrghsucfo ohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtffrrg htthgvrhhnpeefgeffiefhfeettdfhvdfgteekffffudekvedtvedtvdfgveeuudevgedv geegtdenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdr nhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 59F593060F09; Wed, 17 Jun 2020 04:05:16 -0400 (EDT) From: Thomas Monjalon To: Parav Pandit , =?ISO-8859-1?Q?Ga=EBtan?= Rivet Cc: dev@dpdk.org, ferruh.yigit@intel.com, orika@mellanox.com, matan@mellanox.com Date: Wed, 17 Jun 2020 10:05:13 +0200 Message-ID: <1989192.1E77PIGTGh@thomas> In-Reply-To: <20200615193342.7c42ctm7sdefdtjw@u256.net> References: <20200610171728.89-1-parav@mellanox.com> <20200610171728.89-2-parav@mellanox.com> <20200615193342.7c42ctm7sdefdtjw@u256.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: Re: [dpdk-dev] [RFC PATCH 1/6] eal: introduce macros for getting value for bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 15/06/2020 21:33, Ga=EBtan Rivet: > On 10/06/20 17:17 +0000, Parav Pandit wrote: > > There are several drivers which duplicate bit generation macro. > > Introduce a generic bit macros so that such drivers avoid redefining > > same in multiple drivers. > >=20 > > Signed-off-by: Parav Pandit > > --- [...] > > --- /dev/null > > +++ b/lib/librte_eal/include/rte_bits.h > > @@ -0,0 +1,10 @@ > > +/* SPDX-License-Identifier: BSD-3-Clause > > + * Copyright 2020 Mellanox Technologies, Ltd. > > + */ > > + > > +#ifndef _RTE_BITS_H_ > > +#define _RTE_BITS_H_ > > + > > +#define RTE_BIT(bit_num) (1UL << (bit_num)) > ^ The tab here should be replaced by a space. > > + > > +#endif >=20 > I'm not sure this kind of macro is needed, but if multiple > drivers are using the patterns let's say ok. >=20 > However I don't think it needs its own header. Would it be ok in > lib/librte_eal/include/rte_common.h for example? If we want to reuse an existing file, it could be lib/librte_eal/include/rte_bitops.h