From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0D8DCA0471 for ; Thu, 15 Aug 2019 15:43:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 370881BEC8; Thu, 15 Aug 2019 15:43:54 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 037F91BEC7 for ; Thu, 15 Aug 2019 15:43:51 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 06:43:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,389,1559545200"; d="scan'208";a="184622052" Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.71]) by FMSMGA003.fm.intel.com with ESMTP; 15 Aug 2019 06:43:49 -0700 Date: Thu, 15 Aug 2019 21:41:42 +0800 From: Tiwei Bie To: He Peng Cc: dev@dpdk.org, =?utf-8?B?IkNIRU5DSE9ORzEgW+mZiOWGsl0i?= , =?utf-8?B?IllFWElBT0ZFTkcxIFvlj7blsI/ls7BdIg==?= Message-ID: <20190815134142.GA26845@___> References: <64da2070-08b6-4e8c-9873-246f98d79ed3@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <64da2070-08b6-4e8c-9873-246f98d79ed3@me.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] =?utf-8?b?wqAgKnJ0ZV92aG9zdF9yeF9xdWV1ZV9jb3VudCogc2hv?= =?utf-8?q?uld__be_protected_by_vq-=3Eaccess=5Flock?= X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Aug 15, 2019 at 09:14:52AM +0000, He Peng wrote: > Hi, > > > Would you please provide  a list of impacted APIs, thus we can check if our code has further issues. b.t.w, we are now using dpdk 18.11. I'm looking into this issue. The API of the builtin backend is supposed to be protected like enqueue/dequeue. So e.g. rte_vhost_enable_guest_notification should also be protected. I'll keep you in the CC list of the fix patch. Thanks, Tiwei > > > Thanks. > > 2019年8月14日 下午11:09,Tiwei Bie 写道: > > > On Wed, Aug 14, 2019 at 03:31:09AM +0000, He Peng wrote: > > Hi, > > > We found that *rte_vhost_rx_queue_count* is not protected by vq->access_lock, > and the access to vq->avail->idx is not thread-safe, since at the same time, the vq->avail  might be  > > > set by *vring_invalidate* when some vhost-user messages arrived, such as VRING_SET_ADDRESS, > VRING_SET_MEM_TABLE, etc. > > You are right. And other similar APIs also need to be protected. > Thanks for reporting this! > > Thanks, > Tiwei > > > > > > > > Thanks.  > > > > > > >