From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by dpdk.org (Postfix) with ESMTP id 9C6109A87 for ; Mon, 18 May 2015 08:18:53 +0200 (CEST) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NOJ006BW87GI240@mailout3.w1.samsung.com> for dev@dpdk.org; Mon, 18 May 2015 07:18:52 +0100 (BST) X-AuditID: cbfec7f4-f79c56d0000012ee-30-5559844bb0a8 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 5A.C1.04846.B4489555; Mon, 18 May 2015 07:18:51 +0100 (BST) Received: from localhost ([106.109.131.58]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NOJ009XQ87FF530@eusync4.samsung.com>; Mon, 18 May 2015 07:18:51 +0100 (BST) Date: Mon, 18 May 2015 09:18:41 +0300 From: Nikita Kalyazin To: "Michael S. Tsirkin" Message-id: <20150518061841.GB5857@kalyazin.rnd.samsung.ru> 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> <20150515172230-mutt-send-email-mst@redhat.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-disposition: inline In-reply-to: <20150515172230-mutt-send-email-mst@redhat.com> X-Priority: 3 User-Agent: Mutt/1.5.23 (2014-03-12) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrELMWRmVeSWpSXmKPExsVy+t/xa7reLZGhBj+fWVq8+7SdyaJ95lkm i/+/XrFafNk0nc2BxeNi/x1Gj18LlrJ6LN7zksnj/b6rbAEsUVw2Kak5mWWpRfp2CVwZHY1b mQp6+Sp2r/rN3MD4j6uLkZNDQsBE4tu2NWwQtpjEhXvrgWwuDiGBpYwSs9c/YoRwvjJKzHrY zAxSxSKgKtG7dSVQFQcHm4CexOnTwSBhEQFNiae3XjOB2MwCSRIPN/4Fs4UF4iTePN4E1sor YC2xrucP2DIhgb+MEhtXcUPEBSV+TL7HAjKSWUBdYsqUXIgx0hKP/s5gB7E5BWwkZqy4wgRx J6/EjPanLCC2qICKxJUJb9knMArOQjJpFsKkWUgmLWBkXsUomlqaXFCclJ5rqFecmFtcmpeu l5yfu4kREtJfdjAuPmZ1iFGAg1GJh5cjIjJUiDWxrLgy9xCjBAezkgjv03qgEG9KYmVValF+ fFFpTmrxIUZpDhYlcd65u96HCAmkJ5akZqemFqQWwWSZODilGhg7XPm3PDysc0IjpPa1yben ZzS5Em+y/wpb+fTe5aPPrU55+XP6u2qfPMZc+3z+rJNv4ri3iZU4Rmey/KuoeZs0Uyvxam1f rKLP4o8aLTptQRd33XRnvdhsxb+r9O+EkObL0lbMuxe9T30Xd3VW1rVjX2asXOP0fspuyY+m Xg//Z4uqrC8p3+6mxFKckWioxVxUnAgAOLVIhGUCAAA= 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: Mon, 18 May 2015 06:18:53 -0000 Ah, sorry. I looked at it without the context. Thanks. -- 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 Fri, May 15, 2015 at 05:23:35PM +0200, Michael S. Tsirkin wrote: > 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 > > >