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 CC34DA04A5; Thu, 18 Jun 2020 14:16:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 816B31BEF2; Thu, 18 Jun 2020 14:16:18 +0200 (CEST) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40071.outbound.protection.outlook.com [40.107.4.71]) by dpdk.org (Postfix) with ESMTP id CE09E1BEE5 for ; Thu, 18 Jun 2020 14:16:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FIu+5+lB6RTwfoJuVidG8/sgfYwIzYc1F+yqhX82qhlfyCT3d93iHOQAph7iaSWuKE1CHMxEFHSMjdf0e16gmQuFPdPY2yiT0xkRQatuNAQJPpIXZV+yk/YW6qPS5gklSXs7oQ4tThr+pAKQd0nMNd2SV2foa0BbbbhTtn253PVITTU0fcXk+nETvj1FIZdKax/U0EHdQ8GsNKnIfZfx5K7Hhvm8tFvG1+wLPHU5a4FBL++2BBQ366ydwKd6DpLuQ8ki1xG3tVqZ7O894RpBAY+XwVNnmofFycPc0RST9Aw4WANVckcsGOyY6C+ln8BMQG6JT8U8PJQpZ6G6Qaor6w== 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=KVMIcTrXcbkL5rvUKRm/4bgxxfgq3TPqsJOJUQJZ5CA=; b=bYKKYQkjmq68fC3C2xv4S7LjDGkV2ANcuIlquumRfVhrs+dG6hwBjAvpK2TvKwth1Cco9nbR1CVOnkZP8c5mQMZ/Wc6PAZrKZyneKwYaSmTu7vEMbx62bBkwXCegIrFQe0KoIuWzGjbZnHmvvfTEALoef5WnjYkHEmHDaCCKP6htCJbaGjAWjZHNmmnXGYkt7y9L3BPn58mRdp1WnMpg6qXEY4lwNvq60CQSP+4kTtqHsqhiomNjH9L7RF7DnlDn5Z8yz3r++NTxUeXONalHBMWJI6Tn5xo2yNW8Zuc8v1CSfJyr+qJINgwhd7rgQtxmb1p+ZR/404ArWXoabQk4Jg== 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=KVMIcTrXcbkL5rvUKRm/4bgxxfgq3TPqsJOJUQJZ5CA=; b=RHMPV2fLItBNf5SGGahbzlOOsy2EHTDxXWAwjfw/A0EZsGDzKuTb6JnDZC5PTUNuVWPjksgAAvTlwP3vPfMeaBE6HVPuA96yh0kH3cor6A7Q+VbaDS89y/HAVXJOTOvzbtRfJ5W0G8WFY2Z62zMjTY4jotsVpt0shvydtpHLJXc= Received: from AM0PR05MB4866.eurprd05.prod.outlook.com (2603:10a6:208:c0::32) by AM0PR05MB5299.eurprd05.prod.outlook.com (2603:10a6:208:ed::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Thu, 18 Jun 2020 12:16:15 +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 12:16:15 +0000 From: Parav Pandit To: Parav Pandit , 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: AQHWP0sbqePDFySEQEqfAS6rxROb86jaGSoAgAJkToCAAagKwIAALgWQ Date: Thu, 18 Jun 2020 12:16:15 +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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; 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: a53e361d-5463-429f-8bdc-08d813816616 x-ms-traffictypediagnostic: AM0PR05MB5299: 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:10000; x-forefront-prvs: 0438F90F17 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: scFLjvXZuoqBKceYmtdRSUGLZ1sgNHyAbWrunGmRM5fI1B6BQHDSQ8S10ZmLdhKyGjFtzEg6VxmbNdtyymmg6b1FiA3s+5SStECWkzEE5DUMNLhud0G2cYjcLOorb347Wb6V1W9RXBhgX0vCIi3BqoEitxFLzmVrZ+V/b58Jidf7ROjvgL2pkicok/MzzqZ3O6Qt+YcO+TvFJO0sPgEBsyWcIJ26m2AG7cnXNWQQNa0myAhP2HlzW6SmltXSfsUn5lNxeap6KW7r3rrEFk8HpG6kYw71GCYDEe4NjZDpf7fDi3gvaiKGolyOK+rf0mQg 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)(366004)(39860400002)(396003)(136003)(376002)(66446008)(64756008)(76116006)(66476007)(66556008)(66946007)(110136005)(54906003)(9686003)(478600001)(316002)(55016002)(2940100002)(4326008)(6506007)(53546011)(52536014)(86362001)(8936002)(5660300002)(186003)(2906002)(71200400001)(33656002)(26005)(66574015)(7696005)(107886003)(55236004)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: J4XKqjgG8d3IbF5rSfe2/cVH3Eapc+QVvnoCF/KCIdKAclVPvuKX+v1qnT3Ef1jQ/6Xfu24c3Ttu2nGIJdgJnwBKL1DgV3JwGCiryF+l80dgZyvpXWQI80LR3lHt9XJyAx3uTvP3bhvcAgNG0PeCFCalCvphOWbOLB2tPayFF4f02zOfWOwEfmiSghWjnq9/nDZHvoeP3CjKQ3ng7aK6HkV/inDCg8kkTU2EQh5dh59JJ8InUTIuDhekx9EgpTu2dEU9TfQTM9RTFOALvzIy+R80uUx+0pzJo2RW00oL1M/8ASjwvNInMHqNnXl4CUsYmjdGZCxq9pe9EzDm6JDxMiow/POHvS4x3SfVa14aUQE/h6fwzij6DfR6DfMPbPvfznos9F+3a5ugJxdJ57pQ6AC2MtLMzrOfgCjRz/WBgn9IhOd7pAWeM6EBftGuT7hGVXeMSiLPuj28OGzdnCmIYo9a3TuRnCTaY0T/N86McnA= 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: a53e361d-5463-429f-8bdc-08d813816616 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jun 2020 12:16:15.6068 (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: N3AMn0XtQjo6/fEz2N7qHxRdj0duTT1WzalTcXlsP18Yj2Uip1nHspaaeN8cbDPVFPiQui4Ln2oEQQZC1TIpfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5299 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" Hi Thomas, > From: dev On Behalf Of Parav Pandit > Sent: Thursday, June 18, 2020 2:55 PM >=20 > > From: Thomas Monjalon > > Sent: Wednesday, June 17, 2020 1:35 PM > > > > 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 spa= ce. > > > > + > > > > +#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+ locatio= ns and > defined in 10+ drivers. > Once we have this macro, it can gradually be replaced. >=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 > > > 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. I see that rte_bitops.h already exist and this new definition doesn't fit w= ell in the rte_bitops.h. The intent of the rte_bitops.h is to have generic mostly macros to replace = current duplication of: Such as BIT() BIT_ULL() BITS_PER_BYTE() BITS_TO_LONGS() They do not fit well in rte_bitops.h which works on the 'bitmap'.