From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00058.outbound.protection.outlook.com [40.107.0.58]) by dpdk.org (Postfix) with ESMTP id 150D42A7 for ; Tue, 27 Feb 2018 20:30:42 +0100 (CET) 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; bh=m3R4EL9BxgkVCcYs3QKJqC4LuBD3ouYSaYbCvhPkge4=; b=pPfB4xZB9kMp1OfmdsmSGBNZCi6PFuwfeWlthE3RBmcYYr1t65FoAg52EPePK5Z2t82vLn3XGuQzj9OdX0i1524LyiPDUiXGUxAk2zv1QUsaHhA/mzMxPPlVTJZXQcj7x3yB2HWtvBrlOjbrkFx2k3Ae3A24Tsqy8eyMbJt/IEw= Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com (10.172.215.19) by AM4PR0501MB2835.eurprd05.prod.outlook.com (10.172.216.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.506.18; Tue, 27 Feb 2018 19:30:40 +0000 Received: from AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::79a1:db23:42bd:25e2]) by AM4PR0501MB2657.eurprd05.prod.outlook.com ([fe80::79a1:db23:42bd:25e2%9]) with mapi id 15.20.0548.013; Tue, 27 Feb 2018 19:30:40 +0000 From: Matan Azrad To: Pavan Nikhilesh , "jerin.jacob@caviumnetworks.com" , "keith.wiles@intel.com" , Thomas Monjalon CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 1/2] eal: add API to align integer to previous power of 2 Thread-Index: AQHTqXYInsRxA9tL/US2y6QvecxbQqOroBPggAt34gCAAM83MA== Date: Tue, 27 Feb 2018 19:30:40 +0000 Message-ID: References: <20180217104934.17291-1-pbhagavatula@caviumnetworks.com> <20180219113643.10337-1-pbhagavatula@caviumnetworks.com> <20180226191017.GA9950@ltp-pvn> In-Reply-To: <20180226191017.GA9950@ltp-pvn> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [85.64.136.190] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR0501MB2835; 7:2/5v6Wq7PEca/VUC2xrNb0pBzA5ROGsnBahNftr7ffumOL8xaXVhA+ivbgkIFOujZShyxZpAS1IJLEOKQYzaQsyr8Xyc8Knd349pt8c46NHOwvkzd2HUbf9W6xVmf4nmCUsqbSDtC/x/Hz3biqOTCFjjceqL7HopOeqPKuAjzrc3ojzWtUcFrQkP0EfwvJCVL9Avp/1uhm4MAK2/9/wJTjWKv3hURZLEE/RL30Irv4tkEHAhQPaq5wllOAYHq97m x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 96d84a15-9ebf-4e20-6b15-08d57e1895ff x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:AM4PR0501MB2835; x-ms-traffictypediagnostic: AM4PR0501MB2835: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231220)(944501161)(52105095)(3002001)(6055026)(6041288)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:AM4PR0501MB2835; BCL:0; PCL:0; RULEID:; SRVR:AM4PR0501MB2835; x-forefront-prvs: 05961EBAFC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39380400002)(366004)(376002)(39860400002)(346002)(396003)(189003)(76104003)(199004)(2950100002)(305945005)(9686003)(68736007)(7736002)(14454004)(74316002)(5250100002)(6246003)(97736004)(81166006)(2906002)(5660300001)(2501003)(105586002)(106356001)(25786009)(478600001)(8676002)(55016002)(3280700002)(6436002)(3846002)(66066001)(81156014)(93886005)(6116002)(110136005)(53936002)(4326008)(33656002)(8936002)(102836004)(229853002)(316002)(86362001)(3660700001)(7696005)(186003)(99286004)(2201001)(76176011)(6506007)(26005)(2900100001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR0501MB2835; H:AM4PR0501MB2657.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: LDcJlGxgIGE1Euo4XkKiY4iRVUJT/KyuBW3Wv2sduUozW25OWiCxqIuv39vEVjcBd5qTWCGdZs4BDJgjcum3g7KKctjzBHjZsKYFcZPz5RMlFhrAKg35XxDopFJHxtB5yZFyNPsLbAmhgewUGgr4Ord5rOM+Ys8F66qxmJK9wek= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96d84a15-9ebf-4e20-6b15-08d57e1895ff X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2018 19:30:40.1621 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB2835 Subject: Re: [dpdk-dev] [PATCH v2 1/2] eal: add API to align integer to previous power of 2 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: , X-List-Received-Date: Tue, 27 Feb 2018 19:30:42 -0000 Hi Pavan From: Pavan Nikhilesh, Monday, February 26, 2018 9:10 PM > Hi Matan, >=20 > On Mon, Feb 19, 2018 at 12:09:46PM +0000, Matan Azrad wrote: > > Since you are using the same 5 lines from the rte_align32pow2() functio= n, I >> think this part can be in a separate function to do reuse. > > Also the "fill ones 32" function can be used for other purpose. > > What do you think? >=20 > I do agree that it would be cleaner to have a common function for both, b= ut > not able to decide on a appropriate function name "fill ones 32" doesn't > convey what the function truly does. If you have a cleaner name do sugges= t, i > will roll up a v3 adding the function and experimental tag. Sure. I'm suggesting next names: rte_combine32ms1b(register uint32_t x) rte_combine64ms1b(register uint64_t x) The description may be something like: combine the upper bits into the LSBs to construct a value with the same mos= t significant 1 as x but all 1's under it. I would add the register keyword for each variables in all the align functi= ons here just to hint for the compiler that it's better to save this variab= les in register and not in memory. =20 Matan. > Thanks, > Pavan >=20 > > > >