From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m13-97.163.com (m13-97.163.com [220.181.13.97]) by dpdk.org (Postfix) with ESMTP id 04AC05934 for ; Thu, 19 Nov 2015 07:27:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Date:From:Subject:MIME-Version:Message-ID; bh=y3zMp MDqZ20m9elrGDSRM8dfb1ArEgIUdcKAT0Z2Cw0=; b=ERUyxHW1HgM4aCOULE4gH 4G+YstzH5Ws6nAQEbgjAReRM54a8slPhKFSd1kIhs39R4qGwSsclyMe7zAqN74H3 KoT9XQgJOMpPs5a70ZPZQSBhLrjf0e/DzxIR1/3PMaWPtfseSIXqUGfMyv17lT3g NCurpvSRpIHEiW6VWd83aU= Received: from huqiwei321$163.com ( [60.247.125.148, 54.215.2.217, 10.144.1.72] ) by ajax-webmail-wmsvr97 (Coremail) ; Thu, 19 Nov 2015 14:27:31 +0800 (CST) X-Originating-IP: [60.247.125.148, 54.215.2.217, 10.144.1.72] Date: Thu, 19 Nov 2015 14:27:31 +0800 (CST) From: huqiwei321 To: dev@dpdk.org X-Priority: 3 X-Mailer: Coremail Webmail Server Version SP_ntes V3.5 build 20150911(74783.7961) Copyright (c) 2002-2015 www.mailtech.cn 163com X-CM-CTRLDATA: yXaVGWZvb3Rlcl9odG09MjU2OjU2 MIME-Version: 1.0 Message-ID: <45d10849.873f.1511e6d3140.Coremail.huqiwei321@163.com> X-CM-TRANSID: YcGowAAHDurUa01WzEzEAA--.25093W X-CM-SenderInfo: 5kxtx4thltjii6rwjhhfrp/1tbiNRS3x1SIKOKvQwAAsr X-Coremail-Antispam: 1U5529EdanIXcx71UUUUU7vcSsGvfC2KfnxnUU== Content-Type: text/plain; charset=GBK Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] dpdk+libuinet 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 06:27:36 -0000 SGkgYWxsLApJIHdhbnQgdG8gcnVuIGxpYnVpbmV0IG9uIERQREssYnV0IEkgY2FuIG5vdCBnZXQg bXVjaCBpbmZvcm1hdGlvbiBvbiB0aGUgSW50ZXJuZXQuQW55IGhlbHAgb3Igc3VnZ2VzdGlvbiBp cyBncmVhdGUuCgpCZXN0IFJlZ2FyZHMsClFpd2VpIEh1Cg== >From yuanhan.liu@linux.intel.com Thu Nov 19 07:30:32 2015 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id F10785934 for ; Thu, 19 Nov 2015 07:30:31 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 18 Nov 2015 22:30:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,317,1444719600"; d="scan'208";a="603037840" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by FMSMGA003.fm.intel.com with ESMTP; 18 Nov 2015 22:30:29 -0800 Date: Thu, 19 Nov 2015 14:31:37 +0800 From: Yuanhan Liu To: Tetsuya Mukawa , "Xie, Huawei" Message-ID: <20151119063137.GJ2326@yliu-dev.sh.intel.com> References: <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> <20151119033330.GG2326@yliu-dev.sh.intel.com> <564D5AA5.80901@igel.co.jp> <20151119054536.GH2326@yliu-dev.sh.intel.com> <564D6520.1060503@igel.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <564D6520.1060503@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 06:30:32 -0000 On Thu, Nov 19, 2015 at 02:58:56PM +0900, Tetsuya Mukawa wrote: > On 2015/11/19 14:45, Yuanhan Liu wrote: > > On Thu, Nov 19, 2015 at 02:14:13PM +0900, Tetsuya Mukawa wrote: > >> On 2015/11/19 12:33, Yuanhan Liu wrote: > >>> 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? > >> No it's not true, even after connecting to virtio-net device, you can > >> change the flag. > >> It's just a hint for virtio-net driver, and it will be used while queuing. > >> (We may be able to change the flag, even while sending or receiving packets) > >> > >>> 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? > >> Actually, this patch is not a MUST. > >> > >> But still the users need callback handlers to know when virtio-net > >> device is connected or disconnected. > >> This is because the user can call rte_vhost_enable_guest_notification() > >> only while connection is established. > > What does "the user" mean? Is there a second user of vhost lib besides > > vhost PMD, that he has to interact with those connected devices? If so, > > how? > > Sorry, my English is wrong. > Not a second user. > > For example, If DPDK application has a port created by vhost PMD, then > needs to call rte_vhost_enable_guest_notification() to the port. So, you are mixing the usage of vhost PMD and vhost lib in a DPDK application? Say, DPDK application start_vhost_pmd rte_vhost_driver_pmd_callback_register rte_vhost_driver_callback_register I know little about PMD, and not quite sure it's a good combo. Huawei, comments? --yliu > DPDK application needs to know when virtio-net device is connected or > disconnected, because the function is only valid while connecting. > But without callback handler, DPDK application cannot know it. > > This is what I wanted to explain. > > Thanks, > Tetsuya > > > --yliu > >> Probably we can use link status changed callback of the PMD for this > >> purpose. > >> (The vhost PMD will notice DPDK application using link status callback) > >> > >> But I am not sure whether we need to implement link status changed > >> callback for this purpose. > >> While processing this callback handler, the users will only calls vhost > >> library APIs that ethdev API cannot map, or store some variables related > >> with vhost library. > >> If so, this callback handler itself is specific for using vhost library. > >> And it may be ok that callback itself is implemented as one of vhost > >> library APIs. > >> > >> Tetsuya > >> > >>> --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