From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linhaifeng Subject: Re: [PATCH] vhost: flush used->idx update before reading avail->flags Date: Thu, 11 Jun 2015 08:50:58 +0800 Message-ID: <5578DB72.20406@huawei.com> References: <1429720392-25345-1-git-send-email-huawei.xie@intel.com> <553995DB.4000801@huawei.com> <55768FE2.5060505@huawei.com> <20150609084613.GA18121@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" To: Luke Gorrie , "Michael S. Tsirkin" Return-path: Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [119.145.14.66]) by dpdk.org (Postfix) with ESMTP id 5A8886849 for ; Thu, 11 Jun 2015 02:51:11 +0200 (CEST) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 2015/6/10 16:30, Luke Gorrie wrote: > On 9 June 2015 at 10:46, Michael S. Tsirkin wrote: > >> By the way, similarly, host side must re-check avail idx after writing >> used flags. I don't see where snabbswitch does it - is that a bug >> in snabbswitch? > > > Good question. > > Snabb Switch does not use interrupts from the guest. We always set > VRING_F_NO_NOTIFY to tell the guest that it need not interrupt us. Then we > run in poll mode and in practice check the avail ring for new descriptors > every 20us or so. Yes, host not need guest to notify when in poll mode but host also need to notify guest who use virtio_net when vring is full or emtpy.If host loss this notification guest would stop working. > > So the argument for not needing this check in both Snabb Switch and DPDK is > that we are running poll mode and don't notice whether interrupts are being > sent or not. > > Is that a solid argument or do I misunderstand what the race condition is? > > Cheers, > -Luke >