From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v4 7/8] virtio: add 1.0 support Date: Tue, 19 Jan 2016 09:36:59 +0800 Message-ID: <20160119013659.GF19531@yliu-dev.sh.intel.com> References: <1452581944-24838-1-git-send-email-yuanhan.liu@linux.intel.com> <1452832571-6156-1-git-send-email-yuanhan.liu@linux.intel.com> <1452832571-6156-8-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "dev@dpdk.org" To: "Xie, Huawei" Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 804468D94 for ; Tue, 19 Jan 2016 02:35:13 +0100 (CET) Content-Disposition: inline In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Jan 18, 2016 at 05:07:51PM +0000, Xie, Huawei wrote: > .On 1/15/2016 12:34 PM, Yuanhan Liu wrote: > > Modern (v1.0) virtio pci device defines several pci capabilities. > > Each cap has a configure structure corresponding to it, and the > > cap.bar and cap.offset fields tell us where to find it. > > > [snip] > > + > > +static inline void > > +io_write64_twopart(uint64_t val, uint32_t *lo, uint32_t *hi) > > +{ > > + io_write32((uint32_t)val, lo); > > + io_write32(val >> 32, hi); > > Firstly your second iowrite32 doesn't do the conversion. Because it's not necessary. The first one is for retrieving the low 32 bits. > The conversion is duplicated. What do you mean by "duplicated". --yliu