From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9AB651094 for ; Mon, 16 Jan 2017 12:01:32 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP; 16 Jan 2017 03:01:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,238,1477983600"; d="scan'208";a="809406380" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.61]) by FMSMGA003.fm.intel.com with SMTP; 16 Jan 2017 03:01:29 -0800 Received: by (sSMTP sendmail emulation); Mon, 16 Jan 2017 11:01:28 +0000 Date: Mon, 16 Jan 2017 11:01:28 +0000 From: Bruce Richardson To: Jerin Jacob Cc: Thomas Monjalon , dev@dpdk.org, konstantin.ananyev@intel.com, jianbo.liu@linaro.org, viktorin@rehivetech.com, santosh.shukla@caviumnetworks.com Message-ID: <20170116110127.GA15056@bricha3-MOBL3.ger.corp.intel.com> References: <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484212646-10338-12-git-send-email-jerin.jacob@caviumnetworks.com> <2622450.7mMCSCBjjk@xps13> <20170116032640.GA6271@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170116032640.GA6271@localhost.localdomain> Organization: Intel Research and =?iso-8859-1?Q?De=ACvel?= =?iso-8859-1?Q?opment?= Ireland Ltd. User-Agent: Mutt/1.7.1 (2016-10-04) Subject: Re: [dpdk-dev] [PATCH v3 11/29] eal: generic implementation for I/O device read/write access 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: Mon, 16 Jan 2017 11:01:33 -0000 On Mon, Jan 16, 2017 at 08:56:41AM +0530, Jerin Jacob wrote: > On Sun, Jan 15, 2017 at 10:29:42PM +0100, Thomas Monjalon wrote: > > 2017-01-12 14:47, Jerin Jacob: > > > +#define rte_read8_relaxed(addr) \ > > > + ({ uint8_t __v = *(const volatile uint8_t *)addr; __v; }) > > > > Why do you prefer a macro over an inline function? > > In this case, I thought of avoiding any compiler behavior changes when > adding the new EAL APIs. Earlier, drivers were using direct pointer > dereference in code, I thought of using the macro to just substitute that to avoid > any performance regression due to this change for easy patchset acceptance. > > IMO, One line macros are OK and for this specific case Linux also uses > readl/writel as macros. > > Having said that, If you think it needs to be changed to "static inline", I > am fine with that. Let me know. > My preference too is to go with static inline functions over macros whenever possible. /Bruce > > It won't provide the same "debuggability".