DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] lib/rte_vhost: fix message handling
@ 2018-10-16 12:27 Fan Zhang
  2018-10-16 12:31 ` Maxime Coquelin
  0 siblings, 1 reply; 3+ messages in thread
From: Fan Zhang @ 2018-10-16 12:27 UTC (permalink / raw)
  To: dev; +Cc: maxime.coquelin, nicknickolaev

This patch fixes the bugs introduced by the message handling rework
patch. Previously some "get" message handlers did not have correct
return and one if statement was wrong.

Fixes: 2f270595c05d ("vhost: rework message handling as a callback array")
Cc: nicknickolaev@gmail.com

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
 lib/librte_vhost/vhost_user.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index 7ef3fb4a4..ac2912990 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -1161,7 +1161,7 @@ vhost_user_get_vring_base(struct virtio_net **pdev,
 
 	msg->size = sizeof(msg->payload.state);
 
-	return VH_RESULT_OK;
+	return VH_RESULT_REPLY;
 }
 
 /*
@@ -1218,7 +1218,7 @@ vhost_user_get_protocol_features(struct virtio_net **pdev,
 	msg->payload.u64 = protocol_features;
 	msg->size = sizeof(msg->payload.u64);
 
-	return VH_RESULT_OK;
+	return VH_RESULT_REPLY;
 }
 
 static int
@@ -1803,7 +1803,7 @@ vhost_user_msg_handler(int vid, int fd)
 		msg.payload.u64 = !!ret;
 		msg.size = sizeof(msg.payload.u64);
 		send_vhost_reply(fd, &msg);
-	} else if (ret) {
+	} else if (ret < 0) {
 		RTE_LOG(ERR, VHOST_CONFIG,
 			"vhost message handling failed.\n");
 		return -1;
-- 
2.13.6

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] lib/rte_vhost: fix message handling
  2018-10-16 12:27 [dpdk-dev] [PATCH] lib/rte_vhost: fix message handling Fan Zhang
@ 2018-10-16 12:31 ` Maxime Coquelin
  2018-10-16 12:53   ` Zhang, Roy Fan
  0 siblings, 1 reply; 3+ messages in thread
From: Maxime Coquelin @ 2018-10-16 12:31 UTC (permalink / raw)
  To: Fan Zhang, dev; +Cc: nicknickolaev

Hi Fan,

On 10/16/2018 02:27 PM, Fan Zhang wrote:
> This patch fixes the bugs introduced by the message handling rework
> patch. Previously some "get" message handlers did not have correct
> return and one if statement was wrong.
> 
> Fixes: 2f270595c05d ("vhost: rework message handling as a callback array")
> Cc: nicknickolaev@gmail.com
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> ---
>   lib/librte_vhost/vhost_user.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 

Could you please have a try with latest next-virtio/master branch?
I fixed the issues in my postcopy live-migration series, and all
should be OK now.

Note that I also changed vhost-crypto's post handler callback so that
it returns enum vh_result type.

Regards,
Maxime

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] lib/rte_vhost: fix message handling
  2018-10-16 12:31 ` Maxime Coquelin
@ 2018-10-16 12:53   ` Zhang, Roy Fan
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Roy Fan @ 2018-10-16 12:53 UTC (permalink / raw)
  To: Maxime Coquelin, dev; +Cc: nicknickolaev

Hi Maxime,

Oh, sorry I didn't pull the virtio sub-tree to check.

Thanks a lot!

Regards,
Fan

> -----Original Message-----
> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
> Sent: Tuesday, October 16, 2018 1:31 PM
> To: Zhang, Roy Fan <roy.fan.zhang@intel.com>; dev@dpdk.org
> Cc: nicknickolaev@gmail.com
> Subject: Re: [PATCH] lib/rte_vhost: fix message handling
> 
> Hi Fan,
> 
> On 10/16/2018 02:27 PM, Fan Zhang wrote:
> > This patch fixes the bugs introduced by the message handling rework
> > patch. Previously some "get" message handlers did not have correct
> > return and one if statement was wrong.
> >
> > Fixes: 2f270595c05d ("vhost: rework message handling as a callback
> > array")
> > Cc: nicknickolaev@gmail.com
> >
> > Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> > ---
> >   lib/librte_vhost/vhost_user.c | 6 +++---
> >   1 file changed, 3 insertions(+), 3 deletions(-)
> >
> 
> Could you please have a try with latest next-virtio/master branch?
> I fixed the issues in my postcopy live-migration series, and all should be OK
> now.
> 
> Note that I also changed vhost-crypto's post handler callback so that it
> returns enum vh_result type.
> 
> Regards,
> Maxime

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-16 12:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-16 12:27 [dpdk-dev] [PATCH] lib/rte_vhost: fix message handling Fan Zhang
2018-10-16 12:31 ` Maxime Coquelin
2018-10-16 12:53   ` Zhang, Roy Fan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).