From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 8F30C1B72F for ; Tue, 3 Apr 2018 15:44:44 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2E0C7B4AD; Tue, 3 Apr 2018 13:44:43 +0000 (UTC) Received: from [10.36.112.46] (ovpn-112-46.ams2.redhat.com [10.36.112.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB3AE7C27; Tue, 3 Apr 2018 13:44:42 +0000 (UTC) To: "Zhang, Roy Fan" , "Wodkowski, PawelX" , "dev@dpdk.org" Cc: "jianjay.zhou@huawei.com" , "Tan, Jianfeng" References: <20180326095114.11605-1-roy.fan.zhang@intel.com> <1522327975-28769-1-git-send-email-roy.fan.zhang@intel.com> <1522327975-28769-2-git-send-email-roy.fan.zhang@intel.com> <9F7182E3F746AB4EA17801C148F3C60433107799@IRSMSX101.ger.corp.intel.com> From: Maxime Coquelin Message-ID: Date: Tue, 3 Apr 2018 15:44:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <9F7182E3F746AB4EA17801C148F3C60433107799@IRSMSX101.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 03 Apr 2018 13:44:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 03 Apr 2018 13:44:43 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH v4 1/8] lib/librte_vhost: add external backend support 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: Tue, 03 Apr 2018 13:44:44 -0000 Hi Pawel, Fan, On 04/01/2018 09:53 PM, Zhang, Roy Fan wrote: > Hi Pawel, > >> -----Original Message----- >> From: Wodkowski, PawelX >> Sent: Thursday, March 29, 2018 2:48 PM >> To: Zhang, Roy Fan ; dev@dpdk.org >> Cc: maxime.coquelin@redhat.com; jianjay.zhou@huawei.com; Tan, Jianfeng >> >> Subject: RE: [dpdk-dev] [PATCH v4 1/8] lib/librte_vhost: add external >> backend support >> >>> -----Original Message----- >>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Fan Zhang >>> Sent: Thursday, March 29, 2018 2:53 PM >>> To: dev@dpdk.org >>> Cc: maxime.coquelin@redhat.com; jianjay.zhou@huawei.com; Tan, >> Jianfeng >>> >>> Subject: [dpdk-dev] [PATCH v4 1/8] lib/librte_vhost: add external >>> backend support >>> >>> This patch adds external backend support to vhost library. The patch >>> provides new APIs for the external backend to register pre and post >>> vhost-user message handlers. >>> >>> Signed-off-by: Fan Zhang >>> --- >>> lib/librte_vhost/rte_vhost.h | 64 >>> +++++++++++++++++++++++++++++++++- >>> lib/librte_vhost/rte_vhost_version.map | 6 ++++ >>> lib/librte_vhost/vhost.c | 17 ++++++++- >>> lib/librte_vhost/vhost.h | 8 +++-- >>> lib/librte_vhost/vhost_user.c | 33 +++++++++++++++++- >>> 5 files changed, 123 insertions(+), 5 deletions(-) >>> >>> diff --git a/lib/librte_vhost/rte_vhost.h >>> b/lib/librte_vhost/rte_vhost.h index d332069..b902c44 100644 >>> --- a/lib/librte_vhost/rte_vhost.h >>> +++ b/lib/librte_vhost/rte_vhost.h >>> @@ -1,5 +1,5 @@ > >>> + * @param require_reply >>> + * If the handler requires sending a reply, this varaible shall be >>> +written 1, >>> + * otherwise 0. >>> + * @return >>> + * 0 on success, -1 on failure >>> + */ >>> +typedef int (*rte_vhost_msg_post_handle)(int vid, void *msg, >>> + uint32_t *require_reply); >>> + >> >> What mean 'Message pointer' Is this const for us? Is this payload? Making >> msg 'void *' is not a way to go here. Those pre and post handlers need to see >> exactly the same structures like vhost_user.c file. Otherwise we can get into >> troubles when ABI changes. > > It is the pointer to the vhost_user message. It cannot be const as the backend > may change the payload. > >> >> Also you can easily merge pre and post handlers into one handler with one >> Parameter describing what phase of message processing we are now. >> > > No I don't think so. To do so it will be quite unclear in the future as we are > using one function to do two totally different things. Time is running out for v18.05 integration deadline (April 6th), and we haven't reached a consensus. Except this API point, I think vhost-crypto is at the right level. Since vhost-crypto lives in librte_vhost, I propose Fan cooks an intermediate solution that does not need API change. Doing this, we postpone the API change to v18.08, so we have time to discuss what the right API should be. Once agreed, vhost-crypto moves to the new API. Pawel, Jianfeng, Fan, is it fine for you? Thanks, Maxime