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 39C06A0487 for ; Thu, 4 Jul 2019 22:21:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 24B702BE5; Thu, 4 Jul 2019 22:21:00 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id EB10C2BE3 for ; Thu, 4 Jul 2019 22:20:58 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6DF4321E6A; Thu, 4 Jul 2019 16:20:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 04 Jul 2019 16:20:58 -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=mesmtp; bh=jzQ3Taq5vNHTRsrSlSH88yHuzq0uU75M5PHgebCZthc=; b=FxHRU4Gr/jJU PsK1njq9xY2DQKMuCwtnaNUNV04d42ZCYobmTvpsRSjtTNHKtfUocFuLQqOFNjCQ XBlsn+xeDnqG+VYeZa/hMohu9yh0rLkjpEdBAUW8D3WPx90Hgq7D1fWWxcDeyKTf gf73JJM53+Z2wsDI9EcIPGkxVn8BsXI= 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=jzQ3Taq5vNHTRsrSlSH88yHuzq0uU75M5PHgebCZt hc=; b=KYCbvHDVu0TYSdZB3Jz0A32Fx6m+H5vvI2k1q7lCFdZ4WwlikKWnFWFwq 1qVUwqeE7vbVYAJmBN2gnd+iyJ3sUO9mC7hZaDcY4zpCdNvF7HdqyeQ2GKHzhEPR Goch5R5p9F9rnuuvIxjoWoxnNhVWQ+3fzw6nG0YdH42kNnXDK/s4SH8If9f41wR4 8kmJsKQJy2sesnCBcLVNFWvDS2LGxCK4p8X1tTG/lBxEwB/EspF5iMXNlSuXrmRq VhC/3LhvnMxSpkLcILVPXQkJ8HWfsK2e/XdEKpvAWnVn5p3h0uJQxtMPJkDzj0HH qqzSlrmdVUoYnALAhARqZmU6D4nVg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrfedvgdduheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecukf hppeejjedrudefgedrvddtfedrudekgeenucfrrghrrghmpehmrghilhhfrhhomhepthhh ohhmrghssehmohhnjhgrlhhonhdrnhgvthenucevlhhushhtvghrufhiiigvpedt 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 97E24380074; Thu, 4 Jul 2019 16:20:56 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Bruce Richardson , david.marchand@redhat.com, David Christensen , Jerin Jacob , Gavin Hu Date: Thu, 04 Jul 2019 22:20:55 +0200 Message-ID: <62492340.4kEa2brbSF@xps> In-Reply-To: <20190701204137.GB393@bricha3-MOBL.ger.corp.intel.com> References: <20190529154132.49955-1-bruce.richardson@intel.com> <2785804.vqP48ztxbI@xps> <20190701204137.GB393@bricha3-MOBL.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 4/4] net: replace ifdefs with runtime branches 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" 01/07/2019 22:41, Bruce Richardson: > On Mon, Jul 01, 2019 at 09:30:02PM +0200, Thomas Monjalon wrote: > > 29/05/2019 17:41, Bruce Richardson: > > > Use the flag checking functions and a couple of empty stubs to remove the > > > ifdefs from the middle of the C code, and replace them with more readable > > > regular if statements. Other ifdefs at the top of the file are kept, but > > > are not mixed with C code, so there is a clean separation. > > > > > > Signed-off-by: Bruce Richardson > > > --- > > > lib/librte_net/rte_net_crc.c | 38 ++++++++++++++++++++++++------------ > > > 1 file changed, 25 insertions(+), 13 deletions(-) > > > > The result is more lines of code :) > > > > > --- a/lib/librte_net/rte_net_crc.c > > > +++ b/lib/librte_net/rte_net_crc.c > > > @@ -18,8 +18,17 @@ > > > > > > #ifdef X86_64_SSE42_PCLMULQDQ > > > #include > > > -#elif defined ARM64_NEON_PMULL > > > +#else > > > +/* define stubs for the SSE functions to avoid compiler errors */ > > > +#define handlers_sse42 handlers_scalar > > > +#define rte_net_crc_sse42_init() do { } while(0) > > > +#endif > > > + > > > +#ifdef ARM64_NEON_PMULL > > > #include > > > +#else > > > +#define handlers_neon handlers_scalar > > > +#define rte_net_crc_neon_init() do { } while(0) > > > #endif > > > > Looking at the need for stubs, I don't see the benefit. > > > Yes, one needs stubs, but those are placed in a single place, and the main > C-code itself is free of ifdefs running through it. I'd view this as a good > thing in limiting the scope of any ifdef-ery, since it annoys me looking at > #ifdefs in the middle of functions (since it messes up the indentation flow > of the code if nothing else!). > > If you don't see this as a big benefit, then there is not a lot else to > commend this set for you, sadly. It just seemed a nice improvement to me - > irrespective of net lines of code. Any other opinion?