From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tiwei Bie Subject: Re: [PATCH v1 4/5] vhost: unify message handling function signature Date: Tue, 10 Jul 2018 13:48:22 +0800 Message-ID: <20180710054821.GA10600@debian> References: <153002988259.22089.8523468795459281187.stgit@T460> <153002997115.22089.11268165694203279446.stgit@T460> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: maxime.coquelin@redhat.com, zhihong.wang@intel.com, dev@dpdk.org To: Nikolay Nikolaev Return-path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 00FFB1B064 for ; Tue, 10 Jul 2018 07:48:41 +0200 (CEST) Content-Disposition: inline In-Reply-To: <153002997115.22089.11268165694203279446.stgit@T460> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Jun 26, 2018 at 07:19:31PM +0300, Nikolay Nikolaev wrote: > Each vhost-user message handlign function will return an int result s/handlign/handling > which is described in the new enum vh_result: error, OK and reply. > All functions will now have two arguments, virtio_net double pointer > and VhostUserMsg pointer. > > Signed-off-by: Nikolay Nikolaev > --- > lib/librte_vhost/vhost_user.c | 217 ++++++++++++++++++++++++----------------- > 1 file changed, 129 insertions(+), 88 deletions(-) > > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > index d999c80ed..dd47d84c7 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -71,6 +71,16 @@ static const char *vhost_message_str[VHOST_USER_MAX] = { > [VHOST_USER_CRYPTO_CLOSE_SESS] = "VHOST_USER_CRYPTO_CLOSE_SESS", > }; > > +/* The possible results of a message handling function */ > +enum vh_result { > + /* Message handlig failed */ s/handlig/handling/ > + VH_RESULT_ERR = -1, > + /* Message handlig successful */ > + VH_RESULT_OK = 0, > + /* Message handlig successful and reply prepared */ > + VH_RESULT_REPLY = 1 Please add a comma after "1", i.e.: s/VH_RESULT_REPLY = 1/VH_RESULT_REPLY = 1,/ Thanks > +}; > + [...]