From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8DAECA0597; Sat, 18 Apr 2020 00:00:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B33601EBFB; Fri, 17 Apr 2020 23:58:25 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 40AC51EB9B for ; Fri, 17 Apr 2020 23:58:10 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200417215810euoutp0119d5a0a6daff7c010ef73c8e4f20b29c~Guj0OUaNq0379003790euoutp01G for ; Fri, 17 Apr 2020 21:58:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200417215810euoutp0119d5a0a6daff7c010ef73c8e4f20b29c~Guj0OUaNq0379003790euoutp01G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1587160690; bh=9b/o6/TtpQqAlP2eFUc508ovP7LCFdbpnpiPGXx0k1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=By2VQuJUbf5DqCPeGk+bA/gYNU/0fFycbnsCB0tGU9LCXEuCGxuCCVON31FyuvwmS axrohWdeX6G0F3VXRpxIe/eE3nT9+08Tg2/nFGk37xcVQI5JD5H88rnNMJaU4vPuzJ WNwcw4BCykZdD3+3+ffiMvJ5HW6XxttNlWyYo0tk= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200417215809eucas1p2365904f4284051fdca1a0bda523beff7~Guj0ETh1E2665826658eucas1p2L; Fri, 17 Apr 2020 21:58:09 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id D2.C4.60679.1762A9E5; Fri, 17 Apr 2020 22:58:09 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200417215809eucas1p1d826c921a9880007af4ee4282dda5d32~Gujz1s9gJ2647326473eucas1p1F; Fri, 17 Apr 2020 21:58:09 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200417215809eusmtrp13b88e966fd71ea3d695333624bada7fc~Gujzxk-ul0397603976eusmtrp1w; Fri, 17 Apr 2020 21:58:09 +0000 (GMT) X-AuditID: cbfec7f4-0cbff7000001ed07-85-5e9a2671491b Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 81.62.07950.1762A9E5; Fri, 17 Apr 2020 22:58:09 +0100 (BST) Received: from localhost.localdomain (unknown [106.210.88.70]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200417215809eusmtip2e2b84f927036f69f3c8743179a95fbe8~GujzPlpwK0325203252eusmtip2z; Fri, 17 Apr 2020 21:58:08 +0000 (GMT) From: Lukasz Wojciechowski To: Anatoly Burakov , Thomas Monjalon , John McNamara , Marko Kovacevic Cc: dev@dpdk.org Date: Fri, 17 Apr 2020 23:57:38 +0200 Message-Id: <20200417215739.23180-17-l.wojciechow@partner.samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200417215739.23180-1-l.wojciechow@partner.samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBIsWRmVeSWpSXmKPExsWy7djPc7qFarPiDE79N7V4dG8xs8W7T9uZ LM7P28pqcX5jL6vFpwcnWBxYPX4tWMrqsXjPSyaPYzensQcwR3HZpKTmZJalFunbJXBlnLx4 ibngqULFlNsaDYx/pLoYOTkkBEwkft76yNLFyMUhJLCCUWJK1zs2kISQwBdGibauPIjEZ0aJ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SvgJvF7 di87xAZ5idUbDoDFOYHiS19+ZwSxhQRcJR4+PMU+gZFvASPDKkaR1NLi3PTcYiO94sTc4tK8 dL3k/NxNjMBg3Hbs55YdjF3vgg8xCnAwKvHwGvTMjBNiTSwrrsw9xCjBwawkwnvQDSjEm5JY WZValB9fVJqTWnyI0RToqInMUqLJ+cBIySuJNzQ1NLewNDQ3Njc2s1AS5+0QOBgjJJCeWJKa nZpakFoE08fEwSnVwLh805z38olGnRfDtMI8JtZEbQj1sfg3pfq7qKD1kbYrG9kv3+Bk3qFy oyrK4M7MP9Xzcz23v6mrD+zRL1lxr9xKuGzxa9cviedb71hmL1zC3Tf1VJde4MnlVf92H87l yJTdEnh1yU+2u4XcrIpf+x/fuxpnxx1jGeXHu4az3P+bapBZ7y2PT0osxRmJhlrMRcWJAO0y buNcAgAA X-CMS-MailID: 20200417215809eucas1p1d826c921a9880007af4ee4282dda5d32 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200417215809eucas1p1d826c921a9880007af4ee4282dda5d32 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200417215809eucas1p1d826c921a9880007af4ee4282dda5d32 References: <20200417215739.23180-1-l.wojciechow@partner.samsung.com> Subject: [dpdk-dev] [PATCH v1 16/17] eal: replace library debug flag with global one X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use global debug flag RTE_DEBUG instead of RTE_MALLOC_DEBUG. The old define is completely removed from source code and config. Tests and documentation were also updated. Signed-off-by: Lukasz Wojciechowski --- app/test/test_malloc.c | 4 ++-- config/common_base | 1 - doc/guides/prog_guide/env_abstraction_layer.rst | 5 +++-- lib/librte_eal/common/malloc_elem.c | 2 +- lib/librte_eal/common/malloc_elem.h | 4 ++-- lib/librte_eal/common/rte_malloc.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c index 232d3186d..61b89d0c1 100644 --- a/app/test/test_malloc.c +++ b/app/test/test_malloc.c @@ -641,7 +641,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_MALLOC_DEBUG +#ifdef RTE_DEBUG int retval; char *over_write_vals = NULL; #endif @@ -663,7 +663,7 @@ test_rte_malloc_validate(void) if (allocated_size < request_size) err_return(); -#ifdef RTE_MALLOC_DEBUG +#ifdef RTE_DEBUG /****** change the header to be bad */ char save_buf[64]; diff --git a/config/common_base b/config/common_base index 1f7be1219..ae6db0adb 100644 --- a/config/common_base +++ b/config/common_base @@ -107,7 +107,6 @@ CONFIG_RTE_EAL_IGB_UIO=n CONFIG_RTE_EAL_VFIO=n CONFIG_RTE_MAX_VFIO_GROUPS=64 CONFIG_RTE_MAX_VFIO_CONTAINERS=64 -CONFIG_RTE_MALLOC_DEBUG=n CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES=n CONFIG_RTE_USE_LIBBSD=n # Use WFE instructions to implement the rte_wait_for_equal_xxx APIs, diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst index 48a2fec06..a8d2ef1a3 100644 --- a/doc/guides/prog_guide/env_abstraction_layer.rst +++ b/doc/guides/prog_guide/env_abstraction_layer.rst @@ -714,8 +714,9 @@ manual for more information. Cookies ~~~~~~~ -When CONFIG_RTE_MALLOC_DEBUG is enabled, the allocated memory contains -overwrite protection fields to help identify buffer overflows. +When RTE_DEBUG is enabled (e.g. by enabling "debug" option in meson setup, +the allocated memory contains overwrite protection fields to help identify +buffer overflows. Alignment and NUMA Constraints ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c index 885d00424..662adb6b9 100644 --- a/lib/librte_eal/common/malloc_elem.c +++ b/lib/librte_eal/common/malloc_elem.c @@ -28,7 +28,7 @@ * to catch buggy programs. Otherwise, freed memory is set to zero * to avoid having to zero in zmalloc */ -#ifdef RTE_MALLOC_DEBUG +#ifdef RTE_DEBUG #define MALLOC_POISON 0x6b #else #define MALLOC_POISON 0 diff --git a/lib/librte_eal/common/malloc_elem.h b/lib/librte_eal/common/malloc_elem.h index a1e5f7f02..e5286415e 100644 --- a/lib/librte_eal/common/malloc_elem.h +++ b/lib/librte_eal/common/malloc_elem.h @@ -32,13 +32,13 @@ struct malloc_elem { size_t size; struct malloc_elem *orig_elem; size_t orig_size; -#ifdef RTE_MALLOC_DEBUG +#ifdef RTE_DEBUG uint64_t header_cookie; /* Cookie marking start of data */ /* trailer cookie at start + size */ #endif } __rte_cache_aligned; -#ifndef RTE_MALLOC_DEBUG +#ifndef RTE_DEBUG static const unsigned MALLOC_ELEM_TRAILER_LEN = 0; /* dummy function - just check if pointer is non-null */ diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c index d6026a2b1..912bfeb9b 100644 --- a/lib/librte_eal/common/rte_malloc.c +++ b/lib/librte_eal/common/rte_malloc.c @@ -78,7 +78,7 @@ rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket) { void *ptr = rte_malloc_socket(type, size, align, socket); -#ifdef RTE_MALLOC_DEBUG +#ifdef RTE_DEBUG /* * If DEBUG is enabled, then freed memory is marked with poison * value and set to zero on allocation. -- 2.17.1