From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH v4 1/8] lib/librte_vhost: add external backend support Date: Tue, 3 Apr 2018 15:44:40 +0200 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "jianjay.zhou@huawei.com" , "Tan, Jianfeng" To: "Zhang, Roy Fan" , "Wodkowski, PawelX" , "dev@dpdk.org" 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) In-Reply-To: <9F7182E3F746AB4EA17801C148F3C60433107799@IRSMSX101.ger.corp.intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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