DPDK patches and discussions
 help / color / mirror / Atom feed
From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org
Cc: reshma.pattan@intel.com, anatoly.burakov@intel.com
Subject: [dpdk-dev] [PATCH v3 1/3] mem: fix 32-bit memory upper limit for non-legacy mode
Date: Tue, 24 Apr 2018 11:19:22 +0100	[thread overview]
Message-ID: <c8375f94e07e2ed99090eaefb4f4c4bb657c5206.1524564892.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <c8375f94e07e2ed99090eaefb4f4c4bb657c5206.1524237907.git.anatoly.burakov@intel.com>

32-bit mode has an upper limit on amount of VA space it can preallocate,
but the original implementation used the wrong constant, resulting in
failure to initialize due to integer overflow. Fix it by using the
correct constant.

Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
Cc: anatoly.burakov@intel.com

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/eal_common_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
index 24a9ed5..c0d4673 100644
--- a/lib/librte_eal/common/eal_common_memory.c
+++ b/lib/librte_eal/common/eal_common_memory.c
@@ -249,7 +249,7 @@ memseg_primary_init_32(void)
 	else
 		total_requested_mem = internal_config.memory;
 
-	max_mem = (uint64_t) RTE_MAX_MEM_MB_PER_TYPE << 20;
+	max_mem = (uint64_t)RTE_MAX_MEM_MB << 20;
 	if (total_requested_mem > max_mem) {
 		RTE_LOG(ERR, EAL, "Invalid parameters: 32-bit process can at most use %uM of memory\n",
 				(unsigned int)(max_mem >> 20));
-- 
2.7.4

  reply	other threads:[~2018-04-24 10:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20 14:41 [dpdk-dev] [PATCH " Anatoly Burakov
2018-04-20 14:41 ` [dpdk-dev] [PATCH 2/3] mem: improve memory preallocation on 32-bit Anatoly Burakov
2018-04-20 14:41 ` [dpdk-dev] [PATCH 3/3] mem: improve autodetection of hugepage counts " Anatoly Burakov
2018-04-20 15:12   ` Burakov, Anatoly
2018-04-20 15:25 ` [dpdk-dev] [PATCH v2 1/3] mem: fix 32-bit memory upper limit for non-legacy mode Anatoly Burakov
2018-04-24 10:19   ` Anatoly Burakov [this message]
2018-04-25 13:26     ` [dpdk-dev] [PATCH v3 " Pattan, Reshma
2018-04-24 10:19   ` [dpdk-dev] [PATCH v3 2/3] mem: improve memory preallocation on 32-bit Anatoly Burakov
2018-04-25 13:27     ` Pattan, Reshma
2018-04-24 10:19   ` [dpdk-dev] [PATCH v3 3/3] mem: improve autodetection of hugepage counts " Anatoly Burakov
2018-04-25 13:28     ` Pattan, Reshma
2018-04-27 21:47       ` Thomas Monjalon
2018-04-20 15:25 ` [dpdk-dev] [PATCH v2 2/3] mem: improve memory preallocation " Anatoly Burakov
2018-04-20 15:25 ` [dpdk-dev] [PATCH v2 3/3] mem: improve autodetection of hugepage counts " Anatoly Burakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8375f94e07e2ed99090eaefb4f4c4bb657c5206.1524564892.git.anatoly.burakov@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=reshma.pattan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).