From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id E6DB21B4C0 for ; Thu, 29 Nov 2018 14:24:35 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5528B750DF; Thu, 29 Nov 2018 13:24:35 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-230.ams2.redhat.com [10.36.117.230]) by smtp.corp.redhat.com (Postfix) with ESMTP id B77FF1019626; Thu, 29 Nov 2018 13:24:33 +0000 (UTC) From: Kevin Traynor To: Anatoly Burakov Cc: David Hunt , dpdk stable Date: Thu, 29 Nov 2018 13:21:25 +0000 Message-Id: <20181129132128.7609-85-ktraynor@redhat.com> In-Reply-To: <20181129132128.7609-1-ktraynor@redhat.com> References: <20181129132128.7609-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 29 Nov 2018 13:24:35 +0000 (UTC) Subject: [dpdk-stable] patch 'mem: fix division by zero in no-NUMA mode' has been queued to stable release 18.08.1 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: , X-List-Received-Date: Thu, 29 Nov 2018 13:24:36 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 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/08/18. 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. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From d8415f93d6971646c60ac3103a768ed971d0d121 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Mon, 26 Nov 2018 10:57:03 +0000 Subject: [PATCH] mem: fix division by zero in no-NUMA mode [ upstream commit e45088b1e1972280427528cc055dfdfdec0ed1c3 ] When RTE_EAL_NUMA_AWARE_HUGEPAGES is set to "n", not all memtypes will be valid, because we skip some due to not supporting other NUMA nodes, leading to a division by zero error down the line because the necessary memtype fields weren't populated. Fix it by limiting number of memtypes to number of memtypes we have actually created. Fixes: 1dd342d0fdc4 ("mem: improve segment list preallocation") Signed-off-by: Anatoly Burakov Tested-by: David Hunt --- lib/librte_eal/linuxapp/eal/eal_memory.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c index f442dd5ec..069c766ab 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c @@ -2178,4 +2178,6 @@ memseg_primary_init(void) } } + /* number of memtypes could have been lower due to no NUMA support */ + n_memtypes = cur_type; /* set up limits for types */ -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 13:11:37.131714763 +0000 +++ 0084-mem-fix-division-by-zero-in-no-NUMA-mode.patch 2018-11-29 13:11:35.000000000 +0000 @@ -1,8 +1,10 @@ -From e45088b1e1972280427528cc055dfdfdec0ed1c3 Mon Sep 17 00:00:00 2001 +From d8415f93d6971646c60ac3103a768ed971d0d121 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Mon, 26 Nov 2018 10:57:03 +0000 Subject: [PATCH] mem: fix division by zero in no-NUMA mode +[ upstream commit e45088b1e1972280427528cc055dfdfdec0ed1c3 ] + When RTE_EAL_NUMA_AWARE_HUGEPAGES is set to "n", not all memtypes will be valid, because we skip some due to not supporting other NUMA nodes, leading to a division by zero error down the line @@ -12,7 +14,6 @@ have actually created. Fixes: 1dd342d0fdc4 ("mem: improve segment list preallocation") -Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov Tested-by: David Hunt @@ -21,10 +22,10 @@ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c -index 6f94621d4..32feb415d 100644 +index f442dd5ec..069c766ab 100644 --- a/lib/librte_eal/linuxapp/eal/eal_memory.c +++ b/lib/librte_eal/linuxapp/eal/eal_memory.c -@@ -2231,4 +2231,6 @@ memseg_primary_init(void) +@@ -2178,4 +2178,6 @@ memseg_primary_init(void) } } + /* number of memtypes could have been lower due to no NUMA support */