From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id D25D02E83 for ; Thu, 19 Nov 2015 04:32:25 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 18 Nov 2015 19:32:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,316,1444719600"; d="scan'208";a="823691142" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by orsmga001.jf.intel.com with ESMTP; 18 Nov 2015 19:32:23 -0800 Date: Thu, 19 Nov 2015 11:33:30 +0800 From: Yuanhan Liu To: Tetsuya Mukawa Message-ID: <20151119033330.GG2326@yliu-dev.sh.intel.com> References: <1447046221-20811-3-git-send-email-mukawa@igel.co.jp> <1447392031-24970-1-git-send-email-mukawa@igel.co.jp> <1447392031-24970-2-git-send-email-mukawa@igel.co.jp> <20151117132933.GV2326@yliu-dev.sh.intel.com> <564D2E06.7060608@igel.co.jp> <20151119021850.GF2326@yliu-dev.sh.intel.com> <564D3E62.4080901@igel.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <564D3E62.4080901@igel.co.jp> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: dev@dpdk.org, ann.zhuangyanying@huawei.com Subject: Re: [dpdk-dev] [PATCH v4 1/2] vhost: Add callback and private data for vhost PMD 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: Thu, 19 Nov 2015 03:32:26 -0000 On Thu, Nov 19, 2015 at 12:13:38PM +0900, Tetsuya Mukawa wrote: > On 2015/11/19 11:18, Yuanhan Liu wrote: > > On Thu, Nov 19, 2015 at 11:03:50AM +0900, Tetsuya Mukawa wrote: > >> On 2015/11/17 22:29, Yuanhan Liu wrote: > >>> On Fri, Nov 13, 2015 at 02:20:30PM +0900, Tetsuya Mukawa wrote: > >>>> These variables are needed to be able to manage one of virtio devices > >>>> using both vhost library APIs and vhost PMD. > >>>> For example, if vhost PMD uses current callback handler and private data > >>>> provided by vhost library, A DPDK application that links vhost library > >>>> cannot use some of vhost library APIs. > >>> Can you be more specific about this? > >>> > >>> --yliu > >> How about like below? > >> > >> commit log: > >> Currently, when virtio device is created and destroyed, vhost library > >> will call one of callback handlers. > >> The vhost PMD need to use this pair of callback handlers to know which > >> virtio devices are connected actually. > >> Because we can register only one pair of callbacks to vhost library, if > >> the PMD use it, DPDK applications > >> cannot have a way to know the events. > > Will (and why) the two co-exist at same time? > > Yes it is. Sure, I will describe below in commit log. > > Because we cannot map some of vhost library APIs to ethdev APIs, in some > cases, we still > need to use vhost library APIs for a port created by the vhost PMD. One > of example is > rte_vhost_enable_guest_notification(). I don't get it why it has something to do with a standalone PMD callback. And if you don't call rte_vhost_enable_guest_notification() inside vhost PMD, where else can you call that? I mean, you can't start vhost-pmd and vhost-swithc in the mean time, right? And, pmd callback and the old notify callback will not exist at same time in one case, right? If so, why is that needed? BTW, if it's a MUST, would you provide a specific example? --yliu > > Thanks, > Tetsuya > > > > > > --yliu > > > >> This may break legacy DPDK > >> applications that uses vhost library. > >> To prevent it, this patch adds one more pair of callbacks to vhost > >> library especially for the vhost PMD. > >> With the patch, legacy applications can use the vhost PMD even if they > >> need additional specific handling > >> for virtio device creation and destruction. > >> For example, legacy application can call > >> rte_vhost_enable_guest_notification() in callbacks to change setting. > >> > >> Tetsuya