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 E180C2C51 for ; Mon, 7 Mar 2016 08:03:40 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 06 Mar 2016 23:03:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,550,1449561600"; d="scan'208";a="918342202" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga001.fm.intel.com with ESMTP; 06 Mar 2016 23:03:12 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 6 Mar 2016 23:03:12 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 6 Mar 2016 23:03:11 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.136]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.18]) with mapi id 14.03.0248.002; Mon, 7 Mar 2016 15:03:10 +0800 From: "Xie, Huawei" To: Yuanhan Liu Thread-Topic: [PATCH v2 3/7] vhost: refactor virtio_dev_merge_rx Thread-Index: AdF4ObcZEr+Wg2beQUS0XzDMVdLF8A== Date: Mon, 7 Mar 2016 07:03:09 +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: "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 07:03:41 -0000 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= =0A= Others are not. This function is inline, and is in one translation unit=0A= with its caller.=0A= =0A= >=0A= > --yliu=0A= >=0A= =0A=