From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by dpdk.org (Postfix) with ESMTP id AC59D5A35 for ; Thu, 19 Nov 2015 06:59:00 +0100 (CET) Received: by padhx2 with SMTP id hx2so69898821pad.1 for ; Wed, 18 Nov 2015 21:59:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=X4uhWEarYjLMq+X0g/hS7KkORcsEJ5k9G0HLlNhn8kc=; b=J+Rsn9yLGIgQQK+YExTdo8U7Zy3L6uMqe3Ru6l1zJRXXjWlKFBGDiHFr95w3gHhSRQ wKCi8XwbT2nT6rTfe7Za2UzKxLTq2czRlJuZ810UFY7qDx4OzkYVaC2DEKiT9FxgfK4R DPrvlsqUyYP/jHs2TTp/dYWD/sD5/DIcII31DIv9dYxzFfMYB75IE7h0VEd09cutfhLb kpIuOQrsqAiHuAdS0Qofb02N+/4tQWFlFqpxaBmn7v6TrLxdb2dT9F+qJP5+O1wu1XaE j0SltQJddodXFuycagrd1rpTc4ESWJ4GNjrGcb7P8Y9im5ThwZZa1t2ODJvsC1sdvCxM 19dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=X4uhWEarYjLMq+X0g/hS7KkORcsEJ5k9G0HLlNhn8kc=; b=m9NmWnHEcLZcbQXiwfNPOu3LOpS4chREVmw8aLM3DJbVEEUZRqmMTACiHiKnFlfCnU bKsi66YigVVXNVUQ68JFjlseKx6Mc57rEtiAkhu++gJ0IkF/sXXxWfLdr7CTC/GI+2zR Rhc9oSH2iO9N6kRM+65BDQDS0ojmvi/JVu5t88LacYE4dJ33ybVItt9LNiqTVNSDsPJu 189wTHm0LOAu9TdEWamXBHzkikaFyo5Kr0GXr4HAlzX5PWdQZISG4xY6gAaPByUVhpRx 0uG8J+L5nocDre+8faDmqbR+wuP149xrsaabMB5oQLWCBu7WmrwT1oo0K5VkHioSdtdR +yuQ== X-Gm-Message-State: ALoCoQnnQHwJs/Bzq1yrz/AmwFyNF2Kx1+Rlyb0I/tWRsoihUYu8FS8Icyw0zz0JYVhvRKfy38cR X-Received: by 10.68.161.194 with SMTP id xu2mr7984817pbb.86.1447912739960; Wed, 18 Nov 2015 21:58:59 -0800 (PST) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by smtp.googlemail.com with ESMTPSA id wq1sm7733544pbc.49.2015.11.18.21.58.58 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Nov 2015 21:58:59 -0800 (PST) To: Yuanhan Liu 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> <20151119033330.GG2326@yliu-dev.sh.intel.com> <564D5AA5.80901@igel.co.jp> <20151119054536.GH2326@yliu-dev.sh.intel.com> From: Tetsuya Mukawa X-Enigmail-Draft-Status: N1110 Message-ID: <564D6520.1060503@igel.co.jp> Date: Thu, 19 Nov 2015 14:58:56 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151119054536.GH2326@yliu-dev.sh.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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 05:59:01 -0000 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. 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