From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [58.251.152.64]) by dpdk.org (Postfix) with ESMTP id A52085A53 for ; Tue, 9 Jun 2015 09:04:30 +0200 (CEST) Received: from 172.24.2.119 (EHLO szxeml434-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CPG38278; Tue, 09 Jun 2015 15:04:21 +0800 (CST) Received: from [127.0.0.1] (10.177.19.115) by szxeml434-hub.china.huawei.com (10.82.67.225) with Microsoft SMTP Server id 14.3.158.1; Tue, 9 Jun 2015 15:04:12 +0800 Message-ID: <55768FE2.5060505@huawei.com> Date: Tue, 9 Jun 2015 15:04:02 +0800 From: Linhaifeng 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 References: <1429720392-25345-1-git-send-email-huawei.xie@intel.com> <553995DB.4000801@huawei.com> In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.115] X-CFilter-Loop: Reflected Cc: "dev@dpdk.org" , "Michael S. Tsirkin" 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2015 07:04:32 -0000 On 2015/4/24 15:27, Luke Gorrie wrote: > On 24 April 2015 at 03:01, Linhaifeng wrote: > >> If not add memory fence what would happen? Packets loss or interrupt >> loss?How to test it ? >> > > You should be able to test it like this: > > 1. Boot two Linux kernel (e.g. 3.13) guests. > 2. Connect them via vhost switch. > 3. Run continuous traffic between them (e.g. iperf). > > I would expect that within a reasonable timeframe (< 1 hour) one of the > guests' network interfaces will hang indefinitely due to a missed interrupt. > > You won't be able to reproduce this using DPDK guests because they are not > using the same interrupt suppression method. > > This is a serious real-world problem. I wouldn't deploy the vhost > implementation without this fix. > > Cheers, > -Luke > I think this patch can't resole this problem. On the other hand we still would miss interrupt. After add rte_mb() function the we want the case is : 1.write used->idx. ring is full or empty. 2.virtio_net open interrupt. 3.read avail->flags. but this case(miss interrupt) would happen too: 1.write used->idx. ring is full or empty. 2.read avail->flags. 3.virtio_net open interrupt.