From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <yuanhan.liu@linux.intel.com>
Received: from mga04.intel.com (mga04.intel.com [192.55.52.120])
 by dpdk.org (Postfix) with ESMTP id 1F0C18D8F
 for <dev@dpdk.org>; Tue, 19 Jan 2016 06:52:08 +0100 (CET)
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by fmsmga104.fm.intel.com with ESMTP; 18 Jan 2016 21:52:09 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.22,316,1449561600"; d="scan'208";a="893426628"
Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49])
 by orsmga002.jf.intel.com with ESMTP; 18 Jan 2016 21:52:06 -0800
Date: Tue, 19 Jan 2016 13:54:16 +0800
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: "Xie, Huawei" <huawei.xie@intel.com>
Message-ID: <20160119055416.GH19531@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>
 <C37D651A908B024F974696C65296B57B4C5A0EAF@SHSMSX101.ccr.corp.intel.com>
 <20160119013659.GF19531@yliu-dev.sh.intel.com>
 <C37D651A908B024F974696C65296B57B4C5A237E@SHSMSX101.ccr.corp.intel.com>
 <20160119024603.GG19531@yliu-dev.sh.intel.com>
 <C37D651A908B024F974696C65296B57B4C5A26E6@SHSMSX101.ccr.corp.intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <C37D651A908B024F974696C65296B57B4C5A26E6@SHSMSX101.ccr.corp.intel.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v4 7/8] virtio: add 1.0 support
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Jan 2016 05:52:09 -0000

On Tue, Jan 19, 2016 at 02:48:39AM +0000, Xie, Huawei wrote:
> On 1/19/2016 10:44 AM, Yuanhan Liu wrote:
> > On Tue, Jan 19, 2016 at 01:51:30AM +0000, Xie, Huawei wrote:
> >> On 1/19/2016 9:34 AM, Yuanhan Liu wrote:
> >>> 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.
> >> I don't mean the shift operation, but the conversion from 64bit to 32bit.
> >> Same applied to below.
> > It's more than a casting here: it's same as "val & (1<<32 - 1)", as
> > stated above, to retrieve the low 32 bits.
> >
> > I know it still could work without it, but, hey, what's wrong to make
> > it explicit?
> 
> Say x = val, y = val >> 32, both with (uint32_t) or both not. Be
> consistent and simple.


fine.

	--yliu