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 C2F29A0C4C 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 BA5FB40685; Mon, 12 Jul 2021 15:12:54 +0200 (CEST) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mails.dpdk.org (Postfix) with ESMTP id 3741F406B4 for ; Mon, 12 Jul 2021 15:12:52 +0200 (CEST) Received: by mail-wm1-f43.google.com with SMTP id k32so8174841wms.4 for ; Mon, 12 Jul 2021 06:12:52 -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=oilJ3ZJ+FqgYZj83NERUVWcHvLh3sK8ZRuhZTYGVF9E=; b=V4nLqwLA4MZG+23wrw1Clyv1GXbCSJdA+fZp8raBVkjhcmj0dyD+k3OB4RonPxFhyu R0eJgEK2Yype2ldSX6/em8bKsqdMab/M+PsNC7lTJrFP4q5DgymIZ+56JHyzvBfKZBqv 9CVDgD/zUpsQr+aKy5GOF1qxEY1mg3ND5brboDw/0Qf97Gs00dw8afGIoZDtcDrfdYKn VZXgOZFil23LcNw6gxvi5FHRjvXLLzO7Ez2O1WZ8/N1Eo6DA1ezkjFqu93xsCdYWbFmC 6ffpUeupn8KBbfG72Rv3XFj1DRpANK421/S/ICE6EHkeg/FnKBLmosELmcXLZiyBtSU2 ljaw== 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=oilJ3ZJ+FqgYZj83NERUVWcHvLh3sK8ZRuhZTYGVF9E=; b=OvklOyBHesPYM09BSgKZq9LhPrPtCyvFsFTBmdBYQb7i3TiGmbTGESbKGh80xE8tNu eueEs6OQbqIPQpwDPiKuvTgFd+LucEDA04Gz30eYH+e0EIjEh+79VmXgz+LRJOGPdo0W yfWuQ3zdzv5PIfvaUhY+WNyFc7i1P1Mv5KbN5hujXMwtiGZYKGQ0BQA878eICw30e8BD Q+rMufyFGXFw/dNviSWFeuY7ZNg5tecB00z6zDnJbhEW1C103lQuu2h0NRfv/vv8LC3Q YC2hXEDizUY8DrlloztFnizql4348ZATEHAz+T/Hp0AB0MuvujkQzL1Lnk+qtKOnd0wV mn2w== X-Gm-Message-State: AOAM532G+Z8R94L6BqxocFhZaB7bfOmDSJtZbc4Q7JsY15VQ7YneixEh zn3NzjEMf5DQeSrSU0xlFew= X-Google-Smtp-Source: ABdhPJw3CZwze5OhuOYgq2dR4WNwEH5Or63sS2m7k25jEdQIerD1NTj6QUvFtxuRx1pT5w/dyaEzaQ== X-Received: by 2002:a1c:7515:: with SMTP id o21mr14686371wmc.65.1626095572043; Mon, 12 Jul 2021 06:12:52 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id f5sm15540050wrg.67.2021.07.12.06.12.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:12:51 -0700 (PDT) From: luca.boccassi@gmail.com To: Maxime Coquelin Cc: Chenbo Xia , dpdk stable Date: Mon, 12 Jul 2021 14:04:48 +0100 Message-Id: <20210712130551.2462159-53-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 missing guest pages table NUMA realloc' 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/62c6d22fb03a331a89ffae89484e8036b05d8b0e Thanks. Luca Boccassi --- >From 62c6d22fb03a331a89ffae89484e8036b05d8b0e Mon Sep 17 00:00:00 2001 From: Maxime Coquelin Date: Tue, 29 Jun 2021 18:11:28 +0200 Subject: [PATCH] vhost: fix missing guest pages table NUMA realloc [ upstream commit 57589cdfd784e6704ded490d80038584d6ade9df ] When the guest allocates virtqueues on a different NUMA node than the one the Vhost metadata are allocated, both the Vhost device struct and the virtqueues struct are reallocated. However, reallocating the guest pages table was missing, which likely causes at least one cross-NUMA accesses for every burst of packets. This patch reallocates this table on the same NUMA node as the other metadata. Fixes: e246896178e6 ("vhost: get guest/host physical address mappings") Signed-off-by: Maxime Coquelin Reviewed-by: Chenbo Xia --- lib/librte_vhost/vhost_user.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index bef269298b..fcb78ad4ea 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -559,7 +559,8 @@ numa_realloc(struct virtio_net *dev, int index) } if (oldnode != newnode) { struct rte_vhost_memory *old_mem; - ssize_t mem_size; + struct guest_page *old_gp; + ssize_t mem_size, gp_size; VHOST_LOG_CONFIG(INFO, "reallocate dev from %d to %d node\n", @@ -584,6 +585,17 @@ numa_realloc(struct virtio_net *dev, int index) memcpy(dev->mem, old_mem, mem_size); rte_free(old_mem); + + gp_size = dev->max_guest_pages * sizeof(*dev->guest_pages); + old_gp = dev->guest_pages; + dev->guest_pages = rte_malloc_socket(NULL, gp_size, RTE_CACHE_LINE_SIZE, newnode); + if (!dev->guest_pages) { + dev->guest_pages = old_gp; + goto out; + } + + memcpy(dev->guest_pages, old_gp, gp_size); + rte_free(old_gp); } out: -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:39.424165831 +0100 +++ 0053-vhost-fix-missing-guest-pages-table-NUMA-realloc.patch 2021-07-12 13:41:36.438121527 +0100 @@ -1 +1 @@ -From 57589cdfd784e6704ded490d80038584d6ade9df Mon Sep 17 00:00:00 2001 +From 62c6d22fb03a331a89ffae89484e8036b05d8b0e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 57589cdfd784e6704ded490d80038584d6ade9df ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ - lib/vhost/vhost_user.c | 14 +++++++++++++- + lib/librte_vhost/vhost_user.c | 14 +++++++++++++- @@ -26,5 +27,5 @@ -diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c -index b5a84f3dcd..5fb055ea2e 100644 ---- a/lib/vhost/vhost_user.c -+++ b/lib/vhost/vhost_user.c -@@ -558,7 +558,8 @@ 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 bef269298b..fcb78ad4ea 100644 +--- a/lib/librte_vhost/vhost_user.c ++++ b/lib/librte_vhost/vhost_user.c +@@ -559,7 +559,8 @@ numa_realloc(struct virtio_net *dev, int index) @@ -40 +41 @@ -@@ -583,6 +584,17 @@ numa_realloc(struct virtio_net *dev, int index) +@@ -584,6 +585,17 @@ numa_realloc(struct virtio_net *dev, int index)