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 63F77A04F3 for ; Thu, 19 Dec 2019 15:36:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 582E6330; Thu, 19 Dec 2019 15:36:11 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 5B2651BF72 for ; Thu, 19 Dec 2019 15:36:09 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id y17so6231091wrh.5 for ; Thu, 19 Dec 2019 06:36:09 -0800 (PST) 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=OWdGXIdj/UYp8qK37wSZm9AUcAoZDLgqIWjcfT1TCD4=; b=g3kokFuHzz3v/iZR8vkK8bCQvcCpQRBIUlWBF6yUzsGgz8APKZcdYFsyqIAYnHaAfp HVqPSQBvKfTM1oRKnTfMsI7zE/zU6vh+zisOwUTb/JK4/CAZ0B7Inva53UFEVUTH89Lu pXUgwWZi2c9Hd77Qx8Zl90J/IHVB0dxaHNRRGfY8XW6aCRPy23tJTe3LuDBaDrpskh+o w022KUkmXjIuZaawz/3TieU91UJh4olDw8MZuCgm/Tjmn2AEFkg6MOsNwHFLyn28O4Jc nj3yVzILnrivAjmAyGWAFeVLe1S9cPLw6Y8+1JVqQvWKy9eQc1skcGtg9dqbFGhD7bXT PvPA== 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=OWdGXIdj/UYp8qK37wSZm9AUcAoZDLgqIWjcfT1TCD4=; b=Rt9rZp2t3lEgMbd6ZGafZTe+QWYDVO6r708OLBxt3qk0U9v/heSvmz9VpuwVfDEz9y u5HZUf79ds56PmiATeLhgJqsshsPimeno6aVKqzpVOPxVcJN1ng9Dr0iiNtcI+st0I38 W1P8KEBMaVSBp5KXz9h8r4c5gihCg4EwNkrENJsAu1VJzEz8OL9r2le47GVOVtCVW3ZJ vhL7Wd7Bwf+2UWoJkAeQhfF1GY35qQNljNd/8FW9wzdEAE3JwT2gBsq0upH6EROFyxPo KOGL6s5F+d/wAiABCBCMEycRY1tBXhpysRmVjlSK5cLXYv6Wu6o3AmnhJAc+N201d827 LZMw== X-Gm-Message-State: APjAAAXX0Iabux4milqH3yLEk1AeznivVZAMTNzTMJrrRrQ5MM35Yo7U y4MAWHftTcvcTha0ada10k0= X-Google-Smtp-Source: APXvYqxUgQY1mmnfPxiHk2Oa+fgYyIVm6O//aTk6DuSH8XKFb76k8ISdt2Wy+kU0erVXcJMaCmeSiw== X-Received: by 2002:adf:f78e:: with SMTP id q14mr9810027wrp.186.1576766169104; Thu, 19 Dec 2019 06:36:09 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id j2sm6437321wmk.23.2019.12.19.06.36.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:36:08 -0800 (PST) From: luca.boccassi@gmail.com To: Tiwei Bie Cc: Yinan Wang , Maxime Coquelin , dpdk stable Date: Thu, 19 Dec 2019 14:32:57 +0000 Message-Id: <20191219143447.21506-30-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: forbid reallocation when running' has been queued to LTS release 17.11.10 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 LTS release 17.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/21/19. 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 9671137d3bf86b84318be2680014e8c74c0590ba Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Mon, 19 Aug 2019 19:34:55 +0800 Subject: [PATCH] vhost: forbid reallocation when running [ upstream commit 37f7c1b609b67d26cbdd4c16a3ebc85e8d63e6dd ] When the device has been started, don't do the reallocation anymore. Otherwise the pointers used in application threads can be invalidated without proper protection. Instead of introducing a global lock to protect the change of device pointers which will hurt the performance, let's just do the reallocation during setup. Fixes: af295ad4698c ("vhost: realloc device and queues to same numa node as vring desc") Reported-by: Yinan Wang Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost_user.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 221217c3f4..2440f14846 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -341,6 +341,9 @@ numa_realloc(struct virtio_net *dev, int index) struct vhost_virtqueue *old_vq, *vq; int ret; + if (dev->flags & VIRTIO_DEV_RUNNING) + return dev; + old_dev = dev; vq = old_vq = dev->virtqueue[index]; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:27.547411977 +0000 +++ 0030-vhost-forbid-reallocation-when-running.patch 2019-12-19 14:32:25.761291004 +0000 @@ -1,8 +1,10 @@ -From 37f7c1b609b67d26cbdd4c16a3ebc85e8d63e6dd Mon Sep 17 00:00:00 2001 +From 9671137d3bf86b84318be2680014e8c74c0590ba Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Mon, 19 Aug 2019 19:34:55 +0800 Subject: [PATCH] vhost: forbid reallocation when running +[ upstream commit 37f7c1b609b67d26cbdd4c16a3ebc85e8d63e6dd ] + When the device has been started, don't do the reallocation anymore. Otherwise the pointers used in application threads can be invalidated without proper protection. Instead of introducing a global lock to @@ -10,7 +12,6 @@ let's just do the reallocation during setup. Fixes: af295ad4698c ("vhost: realloc device and queues to same numa node as vring desc") -Cc: stable@dpdk.org Reported-by: Yinan Wang Signed-off-by: Tiwei Bie @@ -20,11 +21,11 @@ 1 file changed, 3 insertions(+) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c -index f468436103..e4ae027a05 100644 +index 221217c3f4..2440f14846 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c -@@ -410,6 +410,9 @@ numa_realloc(struct virtio_net *dev, int index) - struct batch_copy_elem *new_batch_copy_elems; +@@ -341,6 +341,9 @@ numa_realloc(struct virtio_net *dev, int index) + struct vhost_virtqueue *old_vq, *vq; int ret; + if (dev->flags & VIRTIO_DEV_RUNNING)