DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] memzone: fix memzone size on reserving biggest memzone
@ 2018-05-03 16:00 Anatoly Burakov
  2018-05-10 15:47 ` Ananyev, Konstantin
  0 siblings, 1 reply; 3+ messages in thread
From: Anatoly Burakov @ 2018-05-03 16:00 UTC (permalink / raw)
  To: dev; +Cc: stable

Size of malloc heap elements include overhead, which sould not
be counted as part of memzone.

Fixes: fafcc11985a2 ("mem: rework memzone to be allocated by malloc")
Cc: stable@dpdk.org

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

diff --git a/lib/librte_eal/common/eal_common_memzone.c b/lib/librte_eal/common/eal_common_memzone.c
index bce3321..0595b3a 100644
--- a/lib/librte_eal/common/eal_common_memzone.c
+++ b/lib/librte_eal/common/eal_common_memzone.c
@@ -213,7 +213,8 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
 	snprintf(mz->name, sizeof(mz->name), "%s", name);
 	mz->iova = rte_malloc_virt2iova(mz_addr);
 	mz->addr = mz_addr;
-	mz->len = (requested_len == 0 ? elem->size : requested_len);
+	mz->len = (requested_len == 0 ?
+			(elem->size - MALLOC_ELEM_OVERHEAD) : requested_len);
 	mz->hugepage_sz = elem->msl->page_sz;
 	mz->socket_id = elem->msl->socket_id;
 	mz->flags = 0;
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-14  0:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-03 16:00 [dpdk-dev] [PATCH] memzone: fix memzone size on reserving biggest memzone Anatoly Burakov
2018-05-10 15:47 ` Ananyev, Konstantin
2018-05-14  0:04   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

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).