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 F06EDA04F1; Thu, 18 Jun 2020 11:25:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E28A31BEA6; Thu, 18 Jun 2020 11:25:08 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80040.outbound.protection.outlook.com [40.107.8.40]) by dpdk.org (Postfix) with ESMTP id A2D2C1F28 for ; Thu, 18 Jun 2020 11:25:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DEWmNCnbC8YAQ8PRxIvkCODnAvQ8mc0FqJJYAmPym0qVKUiEB9iW6gRzdX8dEs1Qs+f/AikHxYT2hik+5wLoggHht9UrI+LdP8xX/w1vYzWvu9mNRQGpsIZUI0XBplXhQo8YcgGPL3dNVuTMQhYa8XJ8ZSk+gFSw6Qw1F7A001LVy3ucRIMt8wnZrhj3CYWdLXoncOpsOjWbdmcbvo7OxwHmmVL6OmPpBkuwzbqhs6lrVx39TvNuYiSz1sxAXMTHNADYfmEBPfNopCQmORcv4LDm0tY9nkopgklfl6uWd0VS9U5BpIg89+9mhMDH8uZSD/qhQiai0Fseg12/0Mslkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6Baj6XBC8Y+b92MziOifUPJJ7JZnafXFU2SF1+AtsNo=; b=D1o28fzpdsMFIhLZcOdXawOh3UvBvYiUN3xUAIK2VcP18bfSYXj3EZfm5TrAZbNjUAjSk497qfh3TWSTL4/bBNpDo5yWlVzX6VXFrkYgkAIm0UgpI55YDBNlcFZK63VtVprZAiVGF5Lf4IhHDDNUEIJAPlBccTlO5Hapljuuxub6V0AJvA3165twPejjbmcfXKq60zwXAoQxAwsIgEbHCsf07owm7LluMkFQVMk8wUzaFsujvEk4koT+cT13z0X1opBdh6u//52arWqC2I9WtezmZ9f6v5VUVOjSpWO/PIS7pkcnUk4qHXdJKJiYPQv2wI2HRGSKrTx9parmSJe1EA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6Baj6XBC8Y+b92MziOifUPJJ7JZnafXFU2SF1+AtsNo=; b=kmj/rgrTgWyU12Cy7okOixJcAjB5vlVx7MnmTmYyvWvmnQOHfjFgM9Ta8429gFRDcQHHm8xfCyfS/biTiL0Pq7AQpSL0KNzSaRnPQuwjwyZ5/ij2FdJU7wkdOQ6SgSBNix6PDli405gIhagX1ZklMjUKLnQS2+neVDovqZUpQPE= Received: from AM0PR05MB4866.eurprd05.prod.outlook.com (2603:10a6:208:c0::32) by AM0PR05MB4820.eurprd05.prod.outlook.com (2603:10a6:208:c4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3088.23; Thu, 18 Jun 2020 09:25:05 +0000 Received: from AM0PR05MB4866.eurprd05.prod.outlook.com ([fe80::d44d:a804:c730:d2b7]) by AM0PR05MB4866.eurprd05.prod.outlook.com ([fe80::d44d:a804:c730:d2b7%2]) with mapi id 15.20.3109.021; Thu, 18 Jun 2020 09:25:04 +0000 From: Parav Pandit To: Thomas Monjalon , =?iso-8859-1?Q?Ga=EBtan_Rivet?= CC: "dev@dpdk.org" , "ferruh.yigit@intel.com" , Ori Kam , Matan Azrad Thread-Topic: [dpdk-dev] [RFC PATCH 1/6] eal: introduce macros for getting value for bit Thread-Index: AQHWP0sbqePDFySEQEqfAS6rxROb86jaGSoAgAJkToCAAagKwA== Date: Thu, 18 Jun 2020 09:25:04 +0000 Message-ID: References: <20200610171728.89-1-parav@mellanox.com> <20200610171728.89-2-parav@mellanox.com> <20200615193342.7c42ctm7sdefdtjw@u256.net> <1989192.1E77PIGTGh@thomas> In-Reply-To: <1989192.1E77PIGTGh@thomas> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [106.51.29.68] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 382f6228-2913-4503-37f4-08d813697c35 x-ms-traffictypediagnostic: AM0PR05MB4820: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0438F90F17 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GBSz7vTsgwA+7DBvm9oIazNvA9JbudqgOZUi5AcO9p8N0NfdADMeU7tqBknO5xyHq+86MHjh+oCTM7SpWUsinz8Q7Cbu2U3nBKGiatfHOm7ZzO08Gis+4Fz45GmvKHOdoUNW9vvib+Dx/nOo3rUFaP/Cv/WNZayB7VohAzYpzKf1+5TXFxaBj+y6H4OlOLoCgtJI/R+K8eFagZWL9yAOTI3TJMHLIjIq3uMAM4k2MgdP16fratMfa8KS7shjQ4VbueonGegiYkwFFdUJDVOwhvY1OkcLNqRBf60bHNJO5Tzks5thNw0uMgxnXEo6kzT9 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB4866.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(346002)(39860400002)(376002)(396003)(366004)(136003)(64756008)(76116006)(66476007)(66556008)(86362001)(4326008)(66446008)(5660300002)(71200400001)(66946007)(9686003)(66574015)(8936002)(55016002)(52536014)(26005)(186003)(316002)(8676002)(478600001)(55236004)(6506007)(53546011)(7696005)(33656002)(2906002)(110136005)(107886003)(54906003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: g4ag50JG5+NVqsR3gAFgeU037AReXgnM+gzD4n4bYd8kI0RzlXN4t7DS50HF7FJC0eFQp7mBmUPb7Unk1MfkwEH1WzLYxaBpp7hYSCPoHigGCVTyasJV931Y12Ug0xFUAUk9/F79NDl4WAwWLfbwJ/IyEz14/iSiUjqEUE3mk/Sf3KAMtHwT7siyOPBqz3EHeKbWXJ93PB68xj0iSTXmWrnFtRkjagP0eMcRjFgpmhdWs/wFUygEPBPOp2x344j8N1CK/7xnj+H/OCjklDcDMIFrODef47mV95vgzjlqyhH95azXLF1b3IEL0RtLVgi5Ucqw1yu67yHKwJ7kNZM0VbFm/kLgh/hRPVEsDvZ7HdrlEuiamgInkDjuZtNLTK4RiGtaQLjaaKv5I/c+wr6lnEzY2TAH3g/ROOr2WdZHXzn4Su8k/6ufFyguYdTRsq3Nlfyla20UTdjjRW9kSGJOxQDxFFkwvKx0k4Lk26TAOyk= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 382f6228-2913-4503-37f4-08d813697c35 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jun 2020 09:25:04.8172 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: GHToUTrDELXEz6LV9PAsfkLD3CQ0jw6hoE/ECZIATVTBZ7dJhUBHvyDnw3pouEWCNjzze2sqX95EpaTCVOXrZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4820 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" > From: Thomas Monjalon > Sent: Wednesday, June 17, 2020 1:35 PM >=20 > 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. > > > > > > 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 > > > > I'm not sure this kind of macro is needed, but if multiple drivers are > > using the patterns let's say ok. > > Yes. we certainly need it. Currently BIT() macro is used at 3000+ locations= and defined in 10+ drivers. Once we have this macro, it can gradually be replaced. > > However I don't think it needs its own header. Would it be ok in > > lib/librte_eal/include/rte_common.h for example? >=20 > If we want to reuse an existing file, it could be > lib/librte_eal/include/rte_bitops.h >=20 o.k. I will rename file from rte_bits.h to rte_bitops.h More such macros will be available here to avoid redefinitions in drivers.