From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 7EC562716 for ; Fri, 15 May 2015 17:23:42 +0200 (CEST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 6AD0BC1F19; Fri, 15 May 2015 15:23:41 +0000 (UTC) Received: from redhat.com (ovpn-116-87.ams2.redhat.com [10.36.116.87]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t4FFNaVL027652; Fri, 15 May 2015 11:23:38 -0400 Date: Fri, 15 May 2015 17:23:35 +0200 From: "Michael S. Tsirkin" To: Nikita Kalyazin Message-ID: <20150515172230-mutt-send-email-mst@redhat.com> References: <1429720392-25345-1-git-send-email-huawei.xie@intel.com> <1430305884-9139-1-git-send-email-huawei.xie@intel.com> <1907109.z7RyHoHxuq@xps13> <20150515134333.GA5857@kalyazin.rnd.samsung.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150515134333.GA5857@kalyazin.rnd.samsung.ru> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] 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: Fri, 15 May 2015 15:23:42 -0000 On Fri, May 15, 2015 at 04:43:33PM +0300, Nikita Kalyazin wrote: > Hi, > > > Maybe I missed a part of the discussion, but is there any special purpose for using rte_mb (both read and write fence) here rather than rte_wmb (write fence only)? The fence is between write of used->idx and read of avail->flags, so rte_wmb won't do anything useful. > -- > > Best regards, > > Nikita Kalyazin, > n.kalyazin@samsung.com > > Software Engineer > CE OS Group > Samsung R&D Institute Russia > Tel: +7 (495) 797-25-00 #3816 > Tel: +7 (495) 797-25-03 > Office #1501, 12-1, Dvintsev str., > Moscow, 127018, Russia > > On Wed, May 13, 2015 at 12:46:30PM +0200, Thomas Monjalon wrote: > > 2015-04-29 19:11, Huawei Xie: > > > update of used->idx and read of avail->flags could be reordered. > > > memory fence should be used to ensure the order, otherwise guest could see a stale used->idx value after it toggles the interrupt suppression flag. > > > After guest sets the interrupt suppression flag, it will check if there is more buffer to process through used->idx. If it sees a stale value, it will exit the processing while host willn't send interrupt to guest. > > > > > > Signed-off-by: Huawei Xie > > > > Applied with following title, thanks > > vhost: fix virtio freeze due to missed interrupt > >