From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B96D911C5 for ; Mon, 7 Mar 2016 09:18:09 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 07 Mar 2016 00:18:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,550,1449561600"; d="scan'208";a="903619077" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by orsmga001.jf.intel.com with ESMTP; 07 Mar 2016 00:18:07 -0800 Date: Mon, 7 Mar 2016 16:20:18 +0800 From: Yuanhan Liu To: "Xie, Huawei" Message-ID: <20160307082018.GE14300@yliu-dev.sh.intel.com> References: <1449122773-25510-1-git-send-email-yuanhan.liu@linux.intel.com> <1455803352-5518-1-git-send-email-yuanhan.liu@linux.intel.com> <1455803352-5518-4-git-send-email-yuanhan.liu@linux.intel.com> <20160307063639.GB14300@yliu-dev.sh.intel.com> <20160307065130.GC14300@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "dev@dpdk.org" , Victor Kaplansky , "Michael S. Tsirkin" Subject: Re: [dpdk-dev] [PATCH v2 3/7] vhost: refactor virtio_dev_merge_rx X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Mar 2016 08:18:10 -0000 On Mon, Mar 07, 2016 at 07:16:39AM +0000, Xie, Huawei wrote: > On 3/7/2016 3:04 PM, Xie, Huawei wrote: > > On 3/7/2016 2:49 PM, Yuanhan Liu wrote: > >> On Mon, Mar 07, 2016 at 06:38:42AM +0000, Xie, Huawei wrote: > >>> On 3/7/2016 2:35 PM, Yuanhan Liu wrote: > >>>> On Mon, Mar 07, 2016 at 06:22:25AM +0000, Xie, Huawei wrote: > >>>>> On 2/18/2016 9:48 PM, Yuanhan Liu wrote: > >>>>>> + uint16_t idx = vq->avail->ring[avail_idx & (vq->size - 1)]; > >>>>>> + uint32_t vec_id = *vec_idx; > >>>>>> + uint32_t len = *allocated; > >>>>>> > >>>>> There is bug not using volatile to retrieve the avail idx. > >>>> avail_idx? This is actually from "vq->last_used_idx_res". > >>> uint16_t idx = vq->avail->ring[avail_idx & (vq->size - 1)] > >>> > >>> the idx retrieved from avail->ring. > >> Hmm.. I saw quite many similar lines of code retrieving an index from > >> avail->ring, but none of them acutally use "volatile". So, a bug? > > Others are not. This function is inline, and is in one translation unit > > with its caller. > > Oh, my fault. For the avail idx, we should take care on whether using > volatile. I will keep it as it is. If there are any issues with it, let's fix it in another patch, but not in this refactor patch. --yliu