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 753FA2931 for ; Mon, 7 Mar 2016 08:16:42 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 06 Mar 2016 23:16:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,550,1449561600"; d="scan'208";a="665031505" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by FMSMGA003.fm.intel.com with ESMTP; 06 Mar 2016 23:16:41 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 6 Mar 2016 23:16:41 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 6 Mar 2016 23:16:41 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.132]) with mapi id 14.03.0248.002; Mon, 7 Mar 2016 15:16:39 +0800 From: "Xie, Huawei" To: Yuanhan Liu Thread-Topic: [dpdk-dev] [PATCH v2 3/7] vhost: refactor virtio_dev_merge_rx Thread-Index: AdF4ObcZEr+Wg2beQUS0XzDMVdLF8A== Date: Mon, 7 Mar 2016 07:16:39 +0000 Message-ID: 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> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 07:16:42 -0000 On 3/7/2016 3:04 PM, Xie, Huawei wrote:=0A= > On 3/7/2016 2:49 PM, Yuanhan Liu wrote:=0A= >> On Mon, Mar 07, 2016 at 06:38:42AM +0000, Xie, Huawei wrote:=0A= >>> On 3/7/2016 2:35 PM, Yuanhan Liu wrote:=0A= >>>> On Mon, Mar 07, 2016 at 06:22:25AM +0000, Xie, Huawei wrote:=0A= >>>>> On 2/18/2016 9:48 PM, Yuanhan Liu wrote:=0A= >>>>>> + uint16_t idx =3D vq->avail->ring[avail_idx & (vq->size - 1)];=0A= >>>>>> + uint32_t vec_id =3D *vec_idx;=0A= >>>>>> + uint32_t len =3D *allocated;=0A= >>>>>> =0A= >>>>> There is bug not using volatile to retrieve the avail idx.=0A= >>>> avail_idx? This is actually from "vq->last_used_idx_res". =0A= >>> uint16_t idx =3D vq->avail->ring[avail_idx & (vq->size - 1)]=0A= >>>=0A= >>> the idx retrieved from avail->ring. =0A= >> Hmm.. I saw quite many similar lines of code retrieving an index from=0A= >> avail->ring, but none of them acutally use "volatile". So, a bug?=0A= > Others are not. This function is inline, and is in one translation unit= =0A= > with its caller.=0A= =0A= Oh, my fault. For the avail idx, we should take care on whether using=0A= volatile.=0A= =0A= >> --yliu=0A= >>=0A= >=0A= =0A=