From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F115A0093 for ; Tue, 19 May 2020 15:13:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 150C51D8D1; Tue, 19 May 2020 15:13:23 +0200 (CEST) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id EA14F1D702 for ; Tue, 19 May 2020 15:13:21 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id k13so13773795wrx.3 for ; Tue, 19 May 2020 06:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qD1nLhUT3CM6zez+aB8BDeVc1T7BspARg7599bphK1g=; b=DF8G2V3lARCcAfRP8DB9HlSjzt1ORRKoCcto5xfHFXa8Cl9sEbTSWTnkS5xwqjMKp0 zV7StzbXppcj1Eq+h2TsCRdFW6h+g0o4WJf3YeGeukmiSXvB2Q5+Hsf40wa20NXG2IGQ 7PHyhKs8OMoMvoennY7QZCP6XmjbaXmbG7v85uQn0cV+6AyNWeHHqHCp9si2qC2RdfIC a3z4G2fxBAuaxB0aS5undP0+pwGSkbBtux6DcWCbXEW0oXJUM8boBx953dzfwdFoyWNK ZhJj6udOpecHfChvdfupNvJ86VxjRy9xv/PK5V7SNPNM7iHH8u5FzwYSxBvGjp4pZi1a Vdqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qD1nLhUT3CM6zez+aB8BDeVc1T7BspARg7599bphK1g=; b=WLeokerzU0l3wtJopBlXsOU24IWy73Dchw+xjOoY1x5l0IXBcdKcBz7WDpZXWmKlpV Dv0o2ArR3Nm3q8gDlnmStXai/wgB+bo9Vpj/LV3qMP8IxLsNthakSr6Dlkq58FquWZI6 UtVCYR5BqNDBl36L5hFWNvGAYDhJVgQRT7N+qrDCRp6vyyyQuP5Dc9TmHsBBXZ/xQTIA w/hNlsjUimeWvT4H5vyzy1G6q5JzTvW2wlGf26hY0UoFaJvRZPsZMqNvKbYPqUsxDPVF 5NG91nLvTHfGUANNdEknbbC+9xO5VCj27uPmuV+ibtJPilTYa1T5S31TEniGAEBM895+ oizw== X-Gm-Message-State: AOAM5321lZyYOwVa/6KZV3aMM9p2BTkdbTb3CZpx7IsHfJjoF7xgesfh 4O9c19HuG50XZXzw6KabGRayhQ4DrbkEke76 X-Google-Smtp-Source: ABdhPJy0/Z/uri2fe5fhJTec8U5gFFaQPW8EGlBFCY5FjUS/TAq2ZOl25zmmt2k1lhJC2zYJ4dRPew== X-Received: by 2002:a5d:6085:: with SMTP id w5mr25594985wrt.322.1589894001690; Tue, 19 May 2020 06:13:21 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id z132sm4238698wmc.29.2020.05.19.06.13.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:13:21 -0700 (PDT) From: luca.boccassi@gmail.com To: Roland Qi Cc: Maxime Coquelin , dpdk stable Date: Tue, 19 May 2020 14:04:36 +0100 Message-Id: <20200519130549.112823-141-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: fix peer close check' has been queued to stable release 19.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/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. Thanks. Luca Boccassi --- >From 5099fb8d5986ab25e7e30940f4b46797bc5bec9c Mon Sep 17 00:00:00 2001 From: Roland Qi 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 Reviewed-by: Maxime Coquelin --- 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 8954f7930e..31080be2bd 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -2828,11 +2828,19 @@ static int process_slave_message_reply(struct virtio_net *dev, if ((msg->flags & VHOST_USER_NEED_REPLY) == 0) 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(ERR, 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, "Received unexpected msg type (%u), expected %u\n", -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:50.176037364 +0100 +++ 0141-vhost-fix-peer-close-check.patch 2020-05-19 14:04:44.456652723 +0100 @@ -1,8 +1,10 @@ -From 41f32b052c78898d20d04913a7e205970b96309a Mon Sep 17 00:00:00 2001 +From 5099fb8d5986ab25e7e30940f4b46797bc5bec9c Mon Sep 17 00:00:00 2001 From: Roland Qi 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. @@ -11,7 +13,6 @@ scenario and report the correct error message. Fixes: a277c7159876 ("vhost: refactor code structure") -Cc: stable@dpdk.org Signed-off-by: Roland Qi Reviewed-by: Maxime Coquelin @@ -20,10 +21,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 bd1be01040..971ccdb01c 100644 +index 8954f7930e..31080be2bd 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c -@@ -2812,11 +2812,19 @@ static int process_slave_message_reply(struct virtio_net *dev, +@@ -2828,11 +2828,19 @@ static int process_slave_message_reply(struct virtio_net *dev, if ((msg->flags & VHOST_USER_NEED_REPLY) == 0) return 0; @@ -31,10 +32,10 @@ + ret = read_vhost_message(dev->slave_req_fd, &msg_reply); + if (ret <= 0) { + if (ret < 0) -+ VHOST_LOG_CONFIG(ERR, ++ RTE_LOG(ERR, VHOST_CONFIG, + "vhost read slave message reply failed\n"); + else -+ VHOST_LOG_CONFIG(INFO, ++ RTE_LOG(INFO, VHOST_CONFIG, + "vhost peer closed\n"); ret = -1; goto out; @@ -42,7 +43,7 @@ + ret = 0; if (msg_reply.request.slave != msg->request.slave) { - VHOST_LOG_CONFIG(ERR, + RTE_LOG(ERR, VHOST_CONFIG, "Received unexpected msg type (%u), expected %u\n", -- 2.20.1