From: Xueming Li <xuemingl@mellanox.com>
To: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Cc: dev@dpdk.org, Xueming Li <xuemingl@mellanox.com>
Subject: [dpdk-dev] [PATCH v2 1/2] eal/malloc: fix RTE malloc debug macro
Date: Fri, 8 Sep 2017 22:50:54 +0800 [thread overview]
Message-ID: <20170908145055.50280-1-xuemingl@mellanox.com> (raw)
In-Reply-To: <20170823022926.169272-1-xuemingl@mellanox.com>
This patch replaces broken macro RTE_LIBRTE_MALLOC_DEBUG with
RTE_MALLOC_DEBUG.
Fixes: af75078fece3 ("first public release")
Cc: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
lib/librte_eal/common/malloc_elem.h | 4 ++--
test/test/test_malloc.c | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/lib/librte_eal/common/malloc_elem.h b/lib/librte_eal/common/malloc_elem.h
index f04b2d1e4..ce39129d9 100644
--- a/lib/librte_eal/common/malloc_elem.h
+++ b/lib/librte_eal/common/malloc_elem.h
@@ -53,13 +53,13 @@ struct malloc_elem {
volatile enum elem_state state;
uint32_t pad;
size_t size;
-#ifdef RTE_LIBRTE_MALLOC_DEBUG
+#ifdef RTE_MALLOC_DEBUG
uint64_t header_cookie; /* Cookie marking start of data */
/* trailer cookie at start + size */
#endif
} __rte_cache_aligned;
-#ifndef RTE_LIBRTE_MALLOC_DEBUG
+#ifndef RTE_MALLOC_DEBUG
static const unsigned MALLOC_ELEM_TRAILER_LEN = 0;
/* dummy function - just check if pointer is non-null */
diff --git a/test/test/test_malloc.c b/test/test/test_malloc.c
index 013fd4407..5558acda4 100644
--- a/test/test/test_malloc.c
+++ b/test/test/test_malloc.c
@@ -108,7 +108,7 @@ test_align_overlap_per_lcore(__attribute__((unused)) void *arg)
}
for(j = 0; j < 1000 ; j++) {
if( *(char *)p1 != 0) {
- printf("rte_zmalloc didn't zero"
+ printf("rte_zmalloc didn't zero "
"the allocated memory\n");
ret = -1;
}
@@ -180,7 +180,7 @@ test_reordered_free_per_lcore(__attribute__((unused)) void *arg)
}
for(j = 0; j < 1000 ; j++) {
if( *(char *)p1 != 0) {
- printf("rte_zmalloc didn't zero"
+ printf("rte_zmalloc didn't zero "
"the allocated memory\n");
ret = -1;
}
@@ -293,7 +293,7 @@ test_multi_alloc_statistics(void)
struct rte_malloc_socket_stats pre_stats, post_stats ,first_stats, second_stats;
size_t size = 2048;
int align = 1024;
-#ifndef RTE_LIBRTE_MALLOC_DEBUG
+#ifndef RTE_MALLOC_DEBUG
int trailer_size = 0;
#else
int trailer_size = RTE_CACHE_LINE_SIZE;
@@ -623,7 +623,7 @@ test_rte_malloc_validate(void)
const size_t request_size = 1024;
size_t allocated_size;
char *data_ptr = rte_malloc(NULL, request_size, RTE_CACHE_LINE_SIZE);
-#ifdef RTE_LIBRTE_MALLOC_DEBUG
+#ifdef RTE_MALLOC_DEBUG
int retval;
char *over_write_vals = NULL;
#endif
@@ -645,7 +645,7 @@ test_rte_malloc_validate(void)
if (allocated_size < request_size)
err_return();
-#ifdef RTE_LIBRTE_MALLOC_DEBUG
+#ifdef RTE_MALLOC_DEBUG
/****** change the header to be bad */
char save_buf[64];
--
2.13.3
next prev parent reply other threads:[~2017-09-08 14:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-23 2:29 [dpdk-dev] [PATCH] eal/malloc: fix malloc cookie check Xueming Li
2017-08-23 13:50 ` Sergio Gonzalez Monroy
2017-09-08 14:50 ` Xueming Li [this message]
2017-09-08 14:50 ` [dpdk-dev] [PATCH v2 2/2] eal/malloc: fix RTE malloc element free Xueming Li
2017-09-08 16:03 ` [dpdk-dev] [PATCH v2 1/2] eal/malloc: fix RTE malloc debug macro Stephen Hemminger
2017-09-09 7:33 ` Xueming(Steven) Li
2017-09-09 7:33 ` [dpdk-dev] [PATCH v3 " Xueming Li
2017-09-09 7:33 ` [dpdk-dev] [PATCH v3 2/2] eal/malloc: fix RTE malloc element free Xueming Li
2017-09-13 12:06 ` Sergio Gonzalez Monroy
2017-10-09 20:56 ` Thomas Monjalon
2017-09-13 12:06 ` [dpdk-dev] [PATCH v3 1/2] eal/malloc: fix RTE malloc debug macro Sergio Gonzalez Monroy
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=20170908145055.50280-1-xuemingl@mellanox.com \
--to=xuemingl@mellanox.com \
--cc=dev@dpdk.org \
--cc=sergio.gonzalez.monroy@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).