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 A0FA2A04B5 for ; Tue, 3 Dec 2019 19:27:42 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 93FD05B3A; Tue, 3 Dec 2019 19:27:42 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 5739E1F5 for ; Tue, 3 Dec 2019 19:27:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575397660; 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=mE5FNy/qhIpw09P34b4OGGwClo7WF4tliw7LQ4SkBsY=; b=ToiQOg5yTLpuMK5HA+U8FP6fEILLMGrhKNE7bdS316AnjFt3xLFM6UjJLegbK1pGQIGLpO lmnDORxAox8MdJ+nVQUmLI7PwEMBtRc/DYIOACfopa8NH7wR7p3YRj5TWVsSe1DZWS/uXE CvvAfMXtKQ1atDfRZat8Lku7KMgay10= 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-353-JQYiZR-BMB-x39MBa1PCaQ-1; Tue, 03 Dec 2019 13:27:39 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 76FD91883521; Tue, 3 Dec 2019 18:27:38 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-10.ams2.redhat.com [10.36.117.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A1915C240; Tue, 3 Dec 2019 18:27:37 +0000 (UTC) From: Kevin Traynor To: Tiwei Bie Cc: Yinan Wang , Maxime Coquelin , dpdk stable Date: Tue, 3 Dec 2019 18:26:15 +0000 Message-Id: <20191203182714.17297-6-ktraynor@redhat.com> In-Reply-To: <20191203182714.17297-1-ktraynor@redhat.com> References: <20191203182714.17297-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: JQYiZR-BMB-x39MBa1PCaQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'vhost: forbid reallocation when running' has been queued to LTS release 18.11.6 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 18.11.6 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/10/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 rebasi= ng (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/e6d285e10987bedbd4= 3f7a2e663448ca159b1f45 Thanks. Kevin. --- >From e6d285e10987bedbd43f7a2e663448ca159b1f45 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 f0ad550c6..15688ded5 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -466,4 +466,7 @@ numa_realloc(struct virtio_net *dev, int index) =09int ret; =20 +=09if (dev->flags & VIRTIO_DEV_RUNNING) +=09=09return dev; + =09old_dev =3D dev; =09vq =3D old_vq =3D dev->virtqueue[index]; --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-03 17:29:52.170042822 +0000 +++ 0006-vhost-forbid-reallocation-when-running.patch=092019-12-03 17:29:51= .699751015 +0000 @@ -1 +1 @@ -From 37f7c1b609b67d26cbdd4c16a3ebc85e8d63e6dd Mon Sep 17 00:00:00 2001 +From e6d285e10987bedbd43f7a2e663448ca159b1f45 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 37f7c1b609b67d26cbdd4c16a3ebc85e8d63e6dd ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index f46843610..e4ae027a0 100644 +index f0ad550c6..15688ded5 100644 @@ -26 +27 @@ -@@ -411,4 +411,7 @@ numa_realloc(struct virtio_net *dev, int index) +@@ -466,4 +466,7 @@ numa_realloc(struct virtio_net *dev, int index)