From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 31AFC2B9C for ; Fri, 30 Dec 2016 04:13:17 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 29 Dec 2016 19:13:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,428,1477983600"; d="scan'208";a="1077516696" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 29 Dec 2016 19:13:15 -0800 Date: Fri, 30 Dec 2016 11:15:01 +0800 From: Yuanhan Liu To: "Charles (Chas) Williams" Cc: dev@dpdk.org, mtetsuyah@gmail.com Message-ID: <20161230031501.GE21789@yliu-dev.sh.intel.com> References: <1482959452-18486-1-git-send-email-ciwillia@brocade.com> <1482959452-18486-2-git-send-email-ciwillia@brocade.com> <20161229085238.GD21789@yliu-dev.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 2/2] vhost: start vhost servers once X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 03:13:18 -0000 On Thu, Dec 29, 2016 at 10:58:11AM -0500, Charles (Chas) Williams wrote: > On 12/29/2016 03:52 AM, Yuanhan Liu wrote: > >On Wed, Dec 28, 2016 at 04:10:52PM -0500, Charles (Chas) Williams wrote: > >>Start a vhost server once during devinit instead of during device start > >>and stop. Some vhost clients, QEMU, don't re-attaching to sockets when > >>the vhost server is stopped and later started. Preserve existing behavior > >>for vhost clients. > > > >I didn't quite get the idea what you are going to fix. > > The issue I am trying to fix is QEMU interaction when DPDK's vhost is > acting as a server to QEMU vhost clients. If you create a vhost server > device, it doesn't create the actual datagram socket until you call > .dev_start(). If you call .dev_stop() is also deletes those sockets. > For QEMU, this is a problem since QEMU doesn't know how to re-attach to > datagram sockets that have gone away. Thanks! And I'd appreciate it if you could have written the commit log this way firstly. > .dev_start()/.dev_stop() seems to roughly means link up and link down > so I understand why you might want to add/remove the datagram sockets. > However, in practice, this doesn't seem to make much sense for a DPDK > vhost server. Agree. > This doesn't seem like the right way to indicate link > status to vhost clients. > > It seems like it would just be easier to do this for both clients and > servers, but I don't know why it was done this way originally so I > choose to keep the client behavior. I don't think there are any differences between DPDK acting as client or server. To me, the right logic seems to be (for both DPDK as server and client). For register, - register the vhost socket at probe stage (either at rte_pmd_vhost_probe or at eth_dev_vhost_create). - start the vhost session right after the register when we haven't started it before. For unregister, - invoke rte_vhost_driver_unregister() at rte_pmd_vhost_remove(). For dev_start/stop, - set allow_queuing to 1/0 for start/stop, respectively. --yliu