From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 19745200 for ; Tue, 2 Oct 2018 10:59:05 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 56E5A3084217; Tue, 2 Oct 2018 08:59:04 +0000 (UTC) Received: from [10.36.112.50] (ovpn-112-50.ams2.redhat.com [10.36.112.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E794560A9B; Tue, 2 Oct 2018 08:59:02 +0000 (UTC) To: Nikolay Nikolaev , anatoly.burakov@intel.com, tiwei.bie@intel.com, zhihong.wang@intel.com Cc: dev@dpdk.org References: <153782013094.27450.17651924330876922486.stgit@T460> <153782024547.27450.17763956133344046123.stgit@T460> From: Maxime Coquelin Message-ID: Date: Tue, 2 Oct 2018 10:59:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <153782024547.27450.17763956133344046123.stgit@T460> 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.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 02 Oct 2018 08:59:04 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v6 4/5] vhost: unify message handling function signature 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, 02 Oct 2018 08:59:05 -0000 On 09/24/2018 10:17 PM, Nikolay Nikolaev wrote: > Each vhost-user message handling function will return an int result > 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 | 211 ++++++++++++++++++++++++----------------- > 1 file changed, 125 insertions(+), 86 deletions(-) > > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > index 77905dda0..e1b705fa7 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 handling failed */ > + VH_RESULT_ERR = -1, > + /* Message handling successful */ > + VH_RESULT_OK = 0, > + /* Message handling successful and reply prepared */ > + VH_RESULT_REPLY = 1, > +}; > + > -vhost_user_get_vring_base(struct virtio_net *dev, > +vhost_user_get_vring_base(struct virtio_net **pdev, > struct VhostUserMsg *msg) > { > + struct virtio_net *dev = *pdev; > struct vhost_virtqueue *vq = dev->virtqueue[msg->payload.state.index]; > > /* We have to stop the queue (virtio) if it is running. */ > @@ -1135,7 +1161,7 @@ vhost_user_get_vring_base(struct virtio_net *dev, > > msg->size = sizeof(msg->payload.state); > > - return 0; > + return VH_RESULT_OK; > } VH_RESULT_REPLY here. > -static void > -vhost_user_get_protocol_features(struct virtio_net *dev, > +static int > +vhost_user_get_protocol_features(struct virtio_net **pdev, > struct VhostUserMsg *msg) > { > + struct virtio_net *dev = *pdev; > uint64_t features, protocol_features; > > rte_vhost_driver_get_features(dev->ifname, &features); > @@ -1189,40 +1217,46 @@ vhost_user_get_protocol_features(struct virtio_net *dev, > > msg->payload.u64 = protocol_features; > msg->size = sizeof(msg->payload.u64); > + > + return VH_RESULT_OK; > } Ditto. I have the patches to fix these, it will be posted as preliminary part of my postcopy series. Please, next time, test your series before posting. Thanks, Maxime