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 CD433108D for ; Fri, 31 Mar 2017 11:12:00 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D8AECC0C0567; Fri, 31 Mar 2017 09:11:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D8AECC0C0567 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=maxime.coquelin@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D8AECC0C0567 Received: from [10.36.112.26] (ovpn-112-26.ams2.redhat.com [10.36.112.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD18A18E36; Fri, 31 Mar 2017 09:11:58 +0000 (UTC) To: Yuanhan Liu , dev@dpdk.org References: <1490253059-28112-1-git-send-email-yuanhan.liu@linux.intel.com> <1490705142-893-1-git-send-email-yuanhan.liu@linux.intel.com> <1490705142-893-19-git-send-email-yuanhan.liu@linux.intel.com> Cc: Harris James R , Liu Changpeng From: Maxime Coquelin Message-ID: <6add4933-ba7c-7c89-c146-a86f79266f6d@redhat.com> Date: Fri, 31 Mar 2017 11:11:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1490705142-893-19-git-send-email-yuanhan.liu@linux.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 31 Mar 2017 09:12:00 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v3 18/22] vhost: introduce API to start a specific driver 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, 31 Mar 2017 09:12:01 -0000 On 03/28/2017 02:45 PM, Yuanhan Liu wrote: > We used to use rte_vhost_driver_session_start() to trigger the vhost-user > session. It takes no argument, thus it's a global trigger. And it could > be problematic. > > The issue is, currently, rte_vhost_driver_register(path, flags) actually > tries to put it into the session loop (by fdset_add). However, it needs > a set of APIs to set a vhost-user driver properly: > * rte_vhost_driver_register(path, flags); > * rte_vhost_driver_set_features(path, features); > * rte_vhost_driver_callback_register(path, vhost_device_ops); > > If a new vhost-user driver is registered after the trigger (think OVS-DPDK > that could add a port dynamically from cmdline), the current code will > effectively starts the session for the new driver just after the first > API rte_vhost_driver_register() is invoked, leaving later calls taking > no effect at all. > > To handle the case properly, this patch introduce a new API, > rte_vhost_driver_start(path), to trigger a specific vhost-user driver. > To do that, the rte_vhost_driver_register(path, flags) is simplified > to create the socket only and let rte_vhost_driver_start(path) to > actually put it into the session loop. > > Meanwhile, the rte_vhost_driver_session_start is removed: we could hide > the session thread internally (create the thread if it has not been > created). This would also simplify the application. > > NOTE: the API order in prog guide is slightly adjusted for showing the > correct invoke order. > > Signed-off-by: Yuanhan Liu > --- > > v3: - fix broken reconnect > --- > doc/guides/prog_guide/vhost_lib.rst | 24 +++++----- > doc/guides/rel_notes/release_17_05.rst | 8 ++++ > drivers/net/vhost/rte_eth_vhost.c | 50 ++------------------ > examples/tep_termination/main.c | 8 +++- > examples/vhost/main.c | 9 +++- > lib/librte_vhost/fd_man.c | 9 ++-- > lib/librte_vhost/fd_man.h | 2 +- > lib/librte_vhost/rte_vhost_version.map | 2 +- > lib/librte_vhost/rte_virtio_net.h | 15 +++++- > lib/librte_vhost/socket.c | 84 ++++++++++++++++++++-------------- > 10 files changed, 108 insertions(+), 103 deletions(-) > Reviewed-by: Maxime Coquelin Thanks, Maxime