From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUdYZ-0004Ar-RG for qemu-devel@nongnu.org; Tue, 02 Aug 2016 13:32:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUdYV-0004zj-Jg for qemu-devel@nongnu.org; Tue, 02 Aug 2016 13:32:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUdYV-0004zO-CB for qemu-devel@nongnu.org; Tue, 02 Aug 2016 13:32:39 -0400 Date: Tue, 2 Aug 2016 20:32:35 +0300 From: "Michael S. Tsirkin" Message-ID: <20160802202706-mutt-send-email-mst@kernel.org> References: <1438245296-1446-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH for-2.4] Revert "vhost-user: Send VHOST_RESET_OWNER on vhost stop" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luke Gorrie Cc: qemu-devel , Marcel Apfelbaum On Tue, Aug 02, 2016 at 11:42:01AM +0200, Luke Gorrie wrote: > Hi Michael & all, > > On 4 August 2015 at 21:00, Luke Gorrie wrote: > > Hi Michael, > > Sorry I didn't see this mail sooner - > > On 30 July 2015 at 10:36, Michael S. Tsirkin wrote: > > This reverts commit 294ce717e0f212ed0763307f3eab72b4a1bdf4d0. > > vhost stop happens e.g. when guest unloads the driver, > so closing the backend connection is not the right > thing to do here. > > VHOST_RESET_OWNER should happen on vhost_dev_cleanup - it's > the counterpart of VHOST_SET_OWNER. > > Cc: Luke Gorrie > Signed-off-by: Michael S. Tsirkin > --- > > I think we need this in 2.4 to avoid introducing regressions > in the protocol. We'll fix properly in 2.5. > Luke, can you comment please? > > > Interesting. Currently we don't have a test case in Snabb Switch CI for > guests reloading drivers. We need to add that and let you know how it goes. > > > We have this test case now. Took a year to add, almost to the day, but here we > are :-). > > Specifically we have beefed up our CI for Snabb to run some tens of thousands > of end-to-end tests with VMs nightly. This includes testing a bunch of > different QEMU versions with a bunch of different Snabb (host) and DPDK (guest) > versions. It also exercises the transition where the guest first initializes a > Virtio-net device with the kernel driver and then later hands the device over > to the DPDK driver. > > The data we have now shows that this test case is only working reliably with > QEMU 2.4.1. My hypothesis is that this QEMU version is sending the > VHOST_RESET_OWNER when the kernel driver shuts down - so that vswitch knows not > to process descriptors - while the other versions are skipping this (because > the patch was not introduced yet, or because the patch was reverted). > > Here is the full thread on Github, becoming more QEMU-oriented as you scroll > down: > https://github.com/snabbco/snabb/issues/976#issuecomment-236838883 > > So, question for QEMU upstream, is there currently a supported way for the host > vswitch to detect when the vrings are invalid? How should we operate to be safe > from serving garbage DMA requests during guest driver resets and reboots? > > Cheers and sorry for the e-mail latency :-) > -Luke > > I think this is adequately answered here: http://git.qemu.org/?p=qemu.git;a=blob;f=docs/specs/vhost-user.txt;hb=HEAD#l149 HTH -- MST