[dpdk-stable] patch 'vhost: fix peer close check' has been queued to LTS release 18.11.9

Kevin Traynor ktraynor at redhat.com
Fri Jun 5 20:24:08 CEST 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/10/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/7e26c8c450fb5906ab1e1cf039cd0fd2d750869a

Thanks.

Kevin.

---
>From 7e26c8c450fb5906ab1e1cf039cd0fd2d750869a Mon Sep 17 00:00:00 2001
From: Roland Qi <roland.qi at ucloud.cn>
Date: Tue, 21 Apr 2020 16:59:39 +0800
Subject: [PATCH] vhost: fix peer close check

[ upstream commit 41f32b052c78898d20d04913a7e205970b96309a ]

In process_slave_message_reply(), there is a
possibility that receiving a peer close
message instead of a real message response.

This patch targeting to handle the peer close
scenario and report the correct error message.

Fixes: a277c7159876 ("vhost: refactor code structure")

Signed-off-by: Roland Qi <roland.qi at ucloud.cn>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 lib/librte_vhost/vhost_user.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index e4f72ba876..4ed75104b9 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -2330,9 +2330,17 @@ static int process_slave_message_reply(struct virtio_net *dev,
 		return 0;
 
-	if (read_vhost_message(dev->slave_req_fd, &msg_reply) < 0) {
+	ret = read_vhost_message(dev->slave_req_fd, &msg_reply);
+	if (ret <= 0) {
+		if (ret < 0)
+			RTE_LOG(INFO, VHOST_CONFIG,
+				"vhost read slave message reply failed\n");
+		else
+			RTE_LOG(INFO, VHOST_CONFIG,
+				"vhost peer closed\n");
 		ret = -1;
 		goto out;
 	}
 
+	ret = 0;
 	if (msg_reply.request.slave != msg->request.slave) {
 		RTE_LOG(ERR, VHOST_CONFIG,
-- 
2.21.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-06-05 19:20:51.552948687 +0100
+++ 0011-vhost-fix-peer-close-check.patch	2020-06-05 19:20:50.723042790 +0100
@@ -1 +1 @@
-From 41f32b052c78898d20d04913a7e205970b96309a Mon Sep 17 00:00:00 2001
+From 7e26c8c450fb5906ab1e1cf039cd0fd2d750869a Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 41f32b052c78898d20d04913a7e205970b96309a ]
+
@@ -14 +15,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index bd1be01040..971ccdb01c 100644
+index e4f72ba876..4ed75104b9 100644
@@ -26 +27 @@
-@@ -2813,9 +2813,17 @@ static int process_slave_message_reply(struct virtio_net *dev,
+@@ -2330,9 +2330,17 @@ static int process_slave_message_reply(struct virtio_net *dev,
@@ -33 +34 @@
-+			VHOST_LOG_CONFIG(ERR,
++			RTE_LOG(INFO, VHOST_CONFIG,
@@ -36 +37 @@
-+			VHOST_LOG_CONFIG(INFO,
++			RTE_LOG(INFO, VHOST_CONFIG,
@@ -44 +45 @@
- 		VHOST_LOG_CONFIG(ERR,
+ 		RTE_LOG(ERR, VHOST_CONFIG,



More information about the stable mailing list