Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/42501/?format=api
http://patches.dpdk.org/api/patches/42501/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/ddb96c1f49704ac54225801cd41440d5ae6e9614.1530881548.git.anatoly.burakov@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<ddb96c1f49704ac54225801cd41440d5ae6e9614.1530881548.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/ddb96c1f49704ac54225801cd41440d5ae6e9614.1530881548.git.anatoly.burakov@intel.com", "date": "2018-07-06T13:17:27", "name": "[RFC,06/11] malloc: enable allocating from named heaps", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c493716a9821d3a492a601d74e75166d92f971f6", "submitter": { "id": 4, "url": "http://patches.dpdk.org/api/people/4/?format=api", "name": "Burakov, Anatoly", "email": "anatoly.burakov@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/ddb96c1f49704ac54225801cd41440d5ae6e9614.1530881548.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 453, "url": "http://patches.dpdk.org/api/series/453/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=453", "date": "2018-07-06T13:17:21", "name": "Support externally allocated memory in DPDK", "version": 1, "mbox": "http://patches.dpdk.org/series/453/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/42501/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/42501/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 351501BEE4;\n\tFri, 6 Jul 2018 15:17:45 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 3EBA21BE4F\n\tfor <dev@dpdk.org>; Fri, 6 Jul 2018 15:17:37 +0200 (CEST)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t06 Jul 2018 06:17:35 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga005.fm.intel.com with ESMTP; 06 Jul 2018 06:17:34 -0700", "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tw66DHXRX027485; Fri, 6 Jul 2018 14:17:34 +0100", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w66DHXwq003790;\n\tFri, 6 Jul 2018 14:17:33 +0100", "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w66DHXes003786;\n\tFri, 6 Jul 2018 14:17:33 +0100" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.51,316,1526367600\"; d=\"scan'208\";a=\"243136087\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "srinath.mannam@broadcom.com, scott.branden@broadcom.com,\n\tajit.khaparde@broadcom.com", "Date": "Fri, 6 Jul 2018 14:17:27 +0100", "Message-Id": "<ddb96c1f49704ac54225801cd41440d5ae6e9614.1530881548.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": [ "<cover.1530881548.git.anatoly.burakov@intel.com>", "<cover.1530881548.git.anatoly.burakov@intel.com>" ], "References": [ "<cover.1530881548.git.anatoly.burakov@intel.com>", "<cover.1530881548.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [RFC 06/11] malloc: enable allocating from named heaps", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add new malloc API to allocate memory from heap referenced to by\nspecified name.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/include/rte_malloc.h | 25 ++++++++++++++++++++++\n lib/librte_eal/common/malloc_heap.c | 2 +-\n lib/librte_eal/common/malloc_heap.h | 6 ++++++\n lib/librte_eal/common/rte_malloc.c | 11 ++++++++++\n lib/librte_eal/rte_eal_version.map | 1 +\n 5 files changed, 44 insertions(+), 1 deletion(-)", "diff": "diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h\nindex 7cbcd3184..f1bcd9b65 100644\n--- a/lib/librte_eal/common/include/rte_malloc.h\n+++ b/lib/librte_eal/common/include/rte_malloc.h\n@@ -213,6 +213,31 @@ rte_zmalloc_socket(const char *type, size_t size, unsigned align, int socket);\n void *\n rte_calloc_socket(const char *type, size_t num, size_t size, unsigned align, int socket);\n \n+/**\n+ * This function allocates memory from a specified named heap.\n+ *\n+ * @param name\n+ * Name of the heap to allocate from.\n+ * @param type\n+ * A string identifying the type of allocated objects (useful for debug\n+ * purposes, such as identifying the cause of a memory leak). Can be NULL.\n+ * @param size\n+ * Size (in bytes) to be allocated.\n+ * @param align\n+ * If 0, the return is a pointer that is suitably aligned for any kind of\n+ * variable (in the same manner as malloc()).\n+ * Otherwise, the return is a pointer that is a multiple of *align*. In\n+ * this case, it must be a power of two. (Minimum alignment is the\n+ * cacheline size, i.e. 64-bytes)\n+ * @return\n+ * - NULL on error. Not enough memory, or invalid arguments (size is 0,\n+ * align is not a power of two).\n+ * - Otherwise, the pointer to the allocated object.\n+ */\n+__rte_experimental void *\n+rte_malloc_from_heap(const char *heap_name, const char *type, size_t size,\n+\t\tunsigned int align);\n+\n /**\n * Frees the memory space pointed to by the provided pointer.\n *\ndiff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c\nindex 8437d33b3..a33acc252 100644\n--- a/lib/librte_eal/common/malloc_heap.c\n+++ b/lib/librte_eal/common/malloc_heap.c\n@@ -494,7 +494,7 @@ alloc_more_mem_on_socket(struct malloc_heap *heap, size_t size, int socket,\n }\n \n /* this will try lower page sizes first */\n-static void *\n+void *\n malloc_heap_alloc_on_heap_id(const char *type, size_t size,\n \t\tunsigned int heap_id, unsigned int flags, size_t align,\n \t\tsize_t bound, bool contig)\ndiff --git a/lib/librte_eal/common/malloc_heap.h b/lib/librte_eal/common/malloc_heap.h\nindex 4f3137260..a7e408c99 100644\n--- a/lib/librte_eal/common/malloc_heap.h\n+++ b/lib/librte_eal/common/malloc_heap.h\n@@ -29,6 +29,12 @@ void *\n malloc_heap_alloc(const char *type, size_t size, int socket, unsigned int flags,\n \t\tsize_t align, size_t bound, bool contig);\n \n+/* allocate from specified heap id */\n+void *\n+malloc_heap_alloc_on_heap_id(const char *type, size_t size,\n+\t\tunsigned int heap_id, unsigned int flags, size_t align,\n+\t\tsize_t bound, bool contig);\n+\n int\n malloc_heap_find_named_heap_idx(const char *name);\n \ndiff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c\nindex 2508abdb1..215876a59 100644\n--- a/lib/librte_eal/common/rte_malloc.c\n+++ b/lib/librte_eal/common/rte_malloc.c\n@@ -55,6 +55,17 @@ rte_malloc_socket(const char *type, size_t size, unsigned int align,\n \t\t\talign == 0 ? 1 : align, 0, false);\n }\n \n+void *\n+rte_malloc_from_heap(const char *heap_name, const char *type, size_t size,\n+\t\tunsigned int align)\n+{\n+\tint heap_idx = malloc_heap_find_named_heap_idx(heap_name);\n+\tif (heap_idx < 0)\n+\t\treturn NULL;\n+\treturn malloc_heap_alloc_on_heap_id(type, size, heap_idx, 0,\n+\t\t\talign == 0 ? 1 : align, 0, false);\n+}\n+\n /*\n * Allocate memory on default heap.\n */\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex 786df1e39..716a7585d 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -278,6 +278,7 @@ EXPERIMENTAL {\n \trte_fbarray_set_used;\n \trte_log_register_type_and_pick_level;\n \trte_malloc_dump_heaps;\n+\trte_malloc_from_heap;\n \trte_malloc_get_stats_from_heap;\n \trte_mem_alloc_validator_register;\n \trte_mem_alloc_validator_unregister;\n", "prefixes": [ "RFC", "06/11" ] }{ "id": 42501, "url": "