From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E47EFA0C4C for ; Mon, 12 Jul 2021 15:12:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DAE4A4119D; Mon, 12 Jul 2021 15:12:54 +0200 (CEST) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mails.dpdk.org (Postfix) with ESMTP id 3B7654069D for ; Mon, 12 Jul 2021 15:12:53 +0200 (CEST) Received: by mail-wr1-f46.google.com with SMTP id d2so25614160wrn.0 for ; Mon, 12 Jul 2021 06:12:53 -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=qXHx9cLO7UzaZVf+nqMXGZjG7CIjMu49eVOrndmdLbQ=; b=feJp7TN4cyfJ8OpG1+P3MWB8bfI4EYf5Rbs5nvNcYLAz/bkuMd/gUw+bjMMjz84Llz kekjBfnn17t8VeAA7v1MuSjB1vm2eYXAL6+cXgIn5myLMa0CPvkB2LfbU8COmRhMzFlg Q2MNfGcdenm4WPm8tiCdBdtstKyecT/hg/b09w2ILpooC5rm88XVvCVZJOHOa31Rq4nC cHEOStJrXvhOc0CmpziRtm0Lz4JfwSwJWHZvjunfAztl5bgTtsQJTOvAR3Z3qWcY6Shh DZ/dWU7z+JyTJAYLbzd+GJnFbQb5I0oMa6n6JSsY1MLp2YwWGHhgNd4epccmnXSJJyi+ BKlg== 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=qXHx9cLO7UzaZVf+nqMXGZjG7CIjMu49eVOrndmdLbQ=; b=nz8Zo58EGvPAMi2lcOCDAekUzZXfYw9FWs5OfNQb/fib23Z2isecrERJlCJk9ibVvW 7vtRfjKuuUifewgzLi/GLqGBrBBWT5KEKvo0vVgfDLaiQCaDvGcibxCjtrgZVi5YXPkB vkxm/VADjBS79ogCkjLcBbRvJzxMksMrCa0Tw0rJwNfN+kzdY+YVDl47HBZcXrFKC+iy CWvdJRKaJ+YDZJKEPb8B48qeAaTaclu18E0H2EhUu/GVzbmk/Z8P+sKuM3c3rdecNmrV lpZ1uSu7SVdwJypuOm0ehH6tOwYKHvJ0oGIIp231sMed2gu93v3+5Meak4ckXfmFLBhQ Mqow== X-Gm-Message-State: AOAM532VwaUCn3aJPviklINxUwMW8c+3HpAPosbL/0nlG06RiNRKU8AK AFiMjpX/sLh0sW+kLe1X3zg= X-Google-Smtp-Source: ABdhPJz6a2Phla3M9nBGlHMBVOMFa1Bvu9XQfjC9mW69ntklIHnPAebIAYzjiXnuJMXoPf5bMZPlZg== X-Received: by 2002:a5d:680e:: with SMTP id w14mr59137307wru.58.1626095573058; Mon, 12 Jul 2021 06:12:53 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id y11sm16688057wmi.33.2021.07.12.06.12.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:12:52 -0700 (PDT) From: luca.boccassi@gmail.com To: Maxime Coquelin Cc: Chenbo Xia , dpdk stable Date: Mon, 12 Jul 2021 14:04:49 +0100 Message-Id: <20210712130551.2462159-54-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: fix NUMA reallocation with multi-queue' has been queued to stable release 20.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 20.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 07/14/21. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/aa1a815db57c92b6de275df1237463da5bc44fab Thanks. Luca Boccassi --- >From aa1a815db57c92b6de275df1237463da5bc44fab Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Tue, 29 Jun 2021 18:11:30 +0200 Subject: [PATCH] vhost: fix NUMA reallocation with multi-queue [ upstream commit 6305dfeff4c4644f1091a5e270cdbf989f48e15e ] Since the Vhost-user device initialization has been reworked, enabling the application to start using the device as soon as the first queue pair is ready, NUMA reallocation no more happened on queue pairs other than the first one since numa_realloc() was returning early if the device was running. This patch fixes this issue by reallocating the device metadata only if the device is running. For the virtqueues, a vring state change notification is sent to notify the application of its disablement. Since the callback is supposed to be blocking, it is safe to reallocate it afterwards. Fixes: d0fcc38f5fa4 ("vhost: improve device readiness notifications") Signed-off-by: Maxime Coquelin Reviewed-by: Chenbo Xia --- lib/librte_vhost/vhost_user.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index fcb78ad4ea..61ed221395 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -489,12 +489,16 @@ numa_realloc(struct virtio_net *dev, int index) struct batch_copy_elem *new_batch_copy_elems; int ret; - if (dev->flags & VIRTIO_DEV_RUNNING) - return dev; - old_dev = dev; vq = old_vq = dev->virtqueue[index]; + /* + * If VQ is ready, it is too late to reallocate, it certainly already + * happened anyway on VHOST_USER_SET_VRING_ADRR. + */ + if (vq->ready) + return dev; + ret = get_mempolicy(&newnode, NULL, 0, old_vq->desc, MPOL_F_NODE | MPOL_F_ADDR); @@ -549,6 +553,9 @@ numa_realloc(struct virtio_net *dev, int index) rte_free(old_vq); } + if (dev->flags & VIRTIO_DEV_RUNNING) + goto out; + /* check if we need to reallocate dev */ ret = get_mempolicy(&oldnode, NULL, 0, old_dev, MPOL_F_NODE | MPOL_F_ADDR); -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:39.472468789 +0100 +++ 0054-vhost-fix-NUMA-reallocation-with-multi-queue.patch 2021-07-12 13:41:36.442121611 +0100 @@ -1 +1 @@ -From 6305dfeff4c4644f1091a5e270cdbf989f48e15e Mon Sep 17 00:00:00 2001 +From aa1a815db57c92b6de275df1237463da5bc44fab Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6305dfeff4c4644f1091a5e270cdbf989f48e15e ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ - lib/vhost/vhost_user.c | 13 ++++++++++--- + lib/librte_vhost/vhost_user.c | 13 ++++++++++--- @@ -27,5 +28,5 @@ -diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c -index 82adf80fe5..51b96a0716 100644 ---- a/lib/vhost/vhost_user.c -+++ b/lib/vhost/vhost_user.c -@@ -488,12 +488,16 @@ numa_realloc(struct virtio_net *dev, int index) +diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c +index fcb78ad4ea..61ed221395 100644 +--- a/lib/librte_vhost/vhost_user.c ++++ b/lib/librte_vhost/vhost_user.c +@@ -489,12 +489,16 @@ numa_realloc(struct virtio_net *dev, int index) @@ -51 +52 @@ -@@ -558,6 +562,9 @@ numa_realloc(struct virtio_net *dev, int index) +@@ -549,6 +553,9 @@ numa_realloc(struct virtio_net *dev, int index)