From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <haifeng.lin@huawei.com>
Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [119.145.14.66])
 by dpdk.org (Postfix) with ESMTP id 5A8886849
 for <dev@dpdk.org>; Thu, 11 Jun 2015 02:51:11 +0200 (CEST)
Received: from 172.24.2.119 (EHLO szxeml432-hub.china.huawei.com)
 ([172.24.2.119])
 by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued)
 with ESMTP id BHM68442; Thu, 11 Jun 2015 08:51:04 +0800 (CST)
Received: from [127.0.0.1] (10.177.19.115) by szxeml432-hub.china.huawei.com
 (10.82.67.209) with Microsoft SMTP Server id 14.3.158.1; Thu, 11 Jun 2015
 08:51:00 +0800
Message-ID: <5578DB72.20406@huawei.com>
Date: Thu, 11 Jun 2015 08:50:58 +0800
From: Linhaifeng <haifeng.lin@huawei.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1;
 rv:31.0) Gecko/20100101 Thunderbird/31.1.0
MIME-Version: 1.0
To: Luke Gorrie <luke@snabb.co>, "Michael S. Tsirkin" <mst@redhat.com>
References: <1429720392-25345-1-git-send-email-huawei.xie@intel.com>	<553995DB.4000801@huawei.com>	<CAA2XHbef=TBAoAwNaAuVOAtHBqiQg2rD1-ExAYkHJ4pLsozJ3Q@mail.gmail.com>	<55768FE2.5060505@huawei.com>	<20150609084613.GA18121@redhat.com>
 <CAA2XHbfY96wCZUxewr32dfE3DYU3MGxhgOpJCac1kEFuPAAFZA@mail.gmail.com>
In-Reply-To: <CAA2XHbfY96wCZUxewr32dfE3DYU3MGxhgOpJCac1kEFuPAAFZA@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-Originating-IP: [10.177.19.115]
X-CFilter-Loop: Reflected
X-Mirapoint-Virus-RAPID-Raw: score=unknown(0),
 refid=str=0001.0A020201.5578DB78.00A9, ss=1, re=0.000, recu=0.000, reip=0.000,
 cl=1, cld=1, fgs=0, ip=0.0.0.0,
 so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32
X-Mirapoint-Loop-Id: c61f996eee8d2ada3ae1b664901a535e
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] vhost: flush used->idx update before reading
	avail->flags
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 11 Jun 2015 00:51:12 -0000



On 2015/6/10 16:30, Luke Gorrie wrote:
> On 9 June 2015 at 10:46, Michael S. Tsirkin <mst@redhat.com> 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
>