From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id A49D2A04A3
	for <public@inbox.dpdk.org>; Fri,  5 Jun 2020 20:25:59 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 9831E1D510;
	Fri,  5 Jun 2020 20:25:59 +0200 (CEST)
Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com
 [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 851C61D510
 for <stable@dpdk.org>; Fri,  5 Jun 2020 20:25:58 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1591381558;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=RML810aaFt3FeqAH4ea3xdYWs4c3uiad/bt3QltJEaw=;
 b=RUd5TolWBkVLCzuhgDhnuBaNgvYx1iaqsvwYN1mZB+YXjN8X1lffMftypJsbnlP2GgLcuC
 V9GSGP1QxYXQy7JmVyjnW/9+fBhT+LNnOTMkpBjw1eEb6s2VZDEKdNkj3UKLzY+3DPLpjL
 5AuBHKVk2ohC4PCaGfxt07cMhNbIygg=
Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com
 [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id
 us-mta-156-KiNoBhhOM86wdf2X6hXR6A-1; Fri, 05 Jun 2020 14:25:55 -0400
X-MC-Unique: KiNoBhhOM86wdf2X6hXR6A-1
Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com
 [10.5.11.12])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4C425876F5E;
 Fri,  5 Jun 2020 18:25:54 +0000 (UTC)
Received: from rh.redhat.com (unknown [10.33.36.130])
 by smtp.corp.redhat.com (Postfix) with ESMTP id 20C6E610F2;
 Fri,  5 Jun 2020 18:25:48 +0000 (UTC)
From: Kevin Traynor <ktraynor@redhat.com>
To: Roland Qi <roland.qi@ucloud.cn>
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>, dpdk stable <stable@dpdk.org>
Date: Fri,  5 Jun 2020 19:24:08 +0100
Message-Id: <20200605182525.22483-11-ktraynor@redhat.com>
In-Reply-To: <20200605182525.22483-1-ktraynor@redhat.com>
References: <20200605182525.22483-1-ktraynor@redhat.com>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit
Subject: [dpdk-stable] patch 'vhost: fix peer close check' has been queued
	to LTS release 18.11.9
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>

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@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@ucloud.cn>
Reviewed-by: Maxime Coquelin <maxime.coquelin@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@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,