From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 7A2B52C1A for ; Mon, 7 Mar 2016 07:49:22 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 06 Mar 2016 22:49:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,550,1449561600"; d="scan'208";a="61143897" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by fmsmga004.fm.intel.com with ESMTP; 06 Mar 2016 22:49:21 -0800 Date: Mon, 7 Mar 2016 14:51:30 +0800 From: Yuanhan Liu To: "Xie, Huawei" Message-ID: <20160307065130.GC14300@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> 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: "Michael S. Tsirkin" , "dev@dpdk.org" , Victor Kaplansky 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 06:49:22 -0000 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? --yliu