From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 0ACF9376D for ; Fri, 16 Dec 2016 03:11:00 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP; 15 Dec 2016 18:10:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,355,1477983600"; d="scan'208";a="42922337" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga005.jf.intel.com with ESMTP; 15 Dec 2016 18:10:57 -0800 Date: Fri, 16 Dec 2016 10:12:56 +0800 From: Yuanhan Liu To: Santosh Shukla Cc: Jerin Jacob , dev@dpdk.org, konstantin.ananyev@intel.com, thomas.monjalon@6wind.com, bruce.richardson@intel.com, jianbo.liu@linaro.org, viktorin@rehivetech.com, Huawei Xie Message-ID: <20161216021256.GM18991@yliu-dev.sh.intel.com> References: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> <1481680558-4003-27-git-send-email-jerin.jacob@caviumnetworks.com> <20161214030223.GH18991@yliu-dev.sh.intel.com> <20161215054533.GA10211@santosh-Latitude-E5530-non-vPro> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161215054533.GA10211@santosh-Latitude-E5530-non-vPro> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 26/28] net/virtio: use eal I/O device memory read/write API 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: Fri, 16 Dec 2016 02:11:01 -0000 On Wed, Dec 14, 2016 at 09:45:34PM -0800, Santosh Shukla wrote: > On Wed, Dec 14, 2016 at 11:02:23AM +0800, Yuanhan Liu wrote: > > On Wed, Dec 14, 2016 at 07:25:56AM +0530, Jerin Jacob wrote: > > > * Following macros are derived from linux/pci_regs.h, however, > > > * we can't simply include that header here, as there is no such > > > @@ -320,37 +322,37 @@ static const struct virtio_pci_ops legacy_ops = { > > > static inline uint8_t > > > io_read8(uint8_t *addr) > > > { > > > - return *(volatile uint8_t *)addr; > > > + return rte_readb(addr); > > > } > > > > Oh, one more comments: why not replacing io_read8 with rte_readb(), > > and do similar for others? Then we don't have to define those wrappers. > > > > I think you can also do something similar for other patches? > > Make sense for the virtio-pci case where API name io_read/write as good as > rte_read/write. Yes, and I think there are few others like this in your example. > However, IMO for other drivers for example ADF_CSR_RD/WR > improves code readability compared to plain rte_read/write. Sure, for such case, we should not replace the macro. --yliu