From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matan Azrad Subject: Re: [PATCH v3 1/2] eal: add API to align integer to previous power of 2 Date: Wed, 4 Apr 2018 19:41:44 +0000 Message-ID: References: <20180217104934.17291-1-pbhagavatula@caviumnetworks.com> <20180404101606.5156-1-pbhagavatula@caviumnetworks.com> <20180404164207.GA21153@ltp-pvn> <20180404175156.GA5416@ltp-pvn> <20180404181557.GA30549@ltp-pvn> <20180404183559.GA2381@ltp-pvn> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: Pavan Nikhilesh , "jerin.jacob@caviumnetworks.com" , "keith.wiles@intel.com" , Thomas Monjalon Return-path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0070.outbound.protection.outlook.com [104.47.2.70]) by dpdk.org (Postfix) with ESMTP id 05DB61C24C for ; Wed, 4 Apr 2018 21:41:46 +0200 (CEST) In-Reply-To: <20180404183559.GA2381@ltp-pvn> Content-Language: en-US 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 Pavan From: Pavan Nikhilesh, Wednesday, April 4, 2018 9:36 PM > On Wed, Apr 04, 2018 at 06:23:19PM +0000, Matan Azrad wrote: > > Hi Pavan > > > > From: Pavan Nikhilesh, Wednesday, April 4, 2018 9:16 PM > > > Hi Matan, > > > > > > > > > > > Got you. > > > > Looks like you found issue here... > > > > The experimental tag probably should be in a root .h file. > > > > Probably, need a fix patch to move it for a different\new .h file. > > > > > > > > What do you think? > > > > > > > > > > Actually thats just start of the rabbit hole, if we succeed to tag a > > > inline function in rte_common.h as experimental every lib/driver > > > that uses rte_common.h (almost everything) needs to have CFLAGS set > > > to - DALLOW_EXPERIMENTAL_API. > > > > > > > Isn't it relevant only for the libs which are using the new tagged APIs= ? >=20 > Static inline functions in .h files will be added to each and every .c ex= ample > preprocessor output for rte_pci.c which includes rte_common.h: >=20 > # 231 "/home/pavan/Work/clean/dpdk/build/include/rte_common.h" > extern int RTE_BUILD_BUG_ON_detected_error; # 249 > "/home/pavan/Work/clean/dpdk/build/include/rte_common.h" > static inline uint32_t __attribute__((deprecated("Symbol is not yet part = of > stable ABI"), section(".text.experimental"))) rte_combine32ms1b(register > uint32_t x) { x |=3D x >> 1; x |=3D x >> 2; x |=3D x >> 4; x |=3D x >= > 8; x |=3D x >> 16; >=20 > return x; > } > # 271 "/home/pavan/Work/clean/dpdk/build/include/rte_common.h" > static inline uint64_t > rte_combine64ms1b(register uint64_t v) > { > v |=3D v >> 1; > v |=3D v >> 2; > v |=3D v >> 4; > v |=3D v >> 8; > v |=3D v >> 16; > v |=3D v >> 32; >=20 > return v; > } >=20 > Which causes compiler to throw error as DALLOW_EXPERIMENTAL_API is not > added to cflags. >=20 Are you sure? I added the next code and the compilation passed: static inline uint32_t __attribute__((deprecated("Symbol is not yet part of stable ABI"), \ section(".text.experimental"))) rte_combine32ms1b(register uint32_t x) { x |=3D x >> 1; x |=3D x >> 2; x |=3D x >> 4; x |=3D x >> 8; x |=3D x >> 16; return x; } Actually, the combine functions should not be experimental (already used in= the existed code). It also will prevent us to add the cflag in every lib which uses the old al= ign functions.=20 Only the new align functions should be tagged. And then, you need to add the cflag only in the places which use these func= tions. Am I missing something? > > > > > Regards, > > > Pavan.