Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/48854/?format=api
http://patches.dpdk.org/api/patches/48854/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/245b643cbfb5f3a0f96e44603339e20278b34e76.1544788410.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": "<245b643cbfb5f3a0f96e44603339e20278b34e76.1544788410.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/245b643cbfb5f3a0f96e44603339e20278b34e76.1544788410.git.anatoly.burakov@intel.com", "date": "2018-12-14T11:54:01", "name": "malloc: make alignment requirements more stringent", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "b87499deda6f6bd10b9bd940dc41cdcfce1e56e8", "submitter": { "id": 4, "url": "http://patches.dpdk.org/api/people/4/?format=api", "name": "Anatoly Burakov", "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/245b643cbfb5f3a0f96e44603339e20278b34e76.1544788410.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 2779, "url": "http://patches.dpdk.org/api/series/2779/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2779", "date": "2018-12-14T11:54:01", "name": "malloc: make alignment requirements more stringent", "version": 1, "mbox": "http://patches.dpdk.org/series/2779/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/48854/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/48854/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 80CC11B9DD;\n\tFri, 14 Dec 2018 12:54:06 +0100 (CET)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id 5C50E1B9BB;\n\tFri, 14 Dec 2018 12:54:05 +0100 (CET)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t14 Dec 2018 03:54:04 -0800", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga004.jf.intel.com with ESMTP; 14 Dec 2018 03:54:02 -0800", "from sivswdev05.ir.intel.com (sivswdev05.ir.intel.com\n\t[10.243.17.64])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\twBEBs2Or005606; Fri, 14 Dec 2018 11:54:02 GMT", "from sivswdev05.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev05.ir.intel.com with ESMTP id wBEBs2Oo008778;\n\tFri, 14 Dec 2018 11:54:02 GMT", "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id wBEBs1bM008774;\n\tFri, 14 Dec 2018 11:54:02 GMT" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.56,352,1539673200\"; d=\"scan'208\";a=\"259461168\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "yskoh@mellanox.com, shahafs@mellanox.com, stable@dpdk.org", "Date": "Fri, 14 Dec 2018 11:54:01 +0000", "Message-Id": "<245b643cbfb5f3a0f96e44603339e20278b34e76.1544788410.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "Subject": "[dpdk-dev] [PATCH] malloc: make alignment requirements more\n\tstringent", "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": "The external heaps API already implicitly expects start address\nof the external memory area to be page-aligned, but it is not\nenforced or documented. Fix this by implementing additional\nparameter checks at memory add call, and document the page\nalignment requirement explicitly.\n\nFixes: 7d75c31014f7 (\"malloc: allow adding memory to named heaps\")\nCc: stable@dpdk.org\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\nSuggested-by: Yongseok Koh <yskoh@mellanox.com>\n---\n lib/librte_eal/common/include/rte_malloc.h | 4 ++--\n lib/librte_eal/common/rte_malloc.c | 8 +++-----\n 2 files changed, 5 insertions(+), 7 deletions(-)", "diff": "diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h\nindex 7249e6aae..a5290b074 100644\n--- a/lib/librte_eal/common/include/rte_malloc.h\n+++ b/lib/librte_eal/common/include/rte_malloc.h\n@@ -282,9 +282,9 @@ rte_malloc_get_socket_stats(int socket,\n * @param heap_name\n * Name of the heap to add memory chunk to\n * @param va_addr\n- * Start of virtual area to add to the heap\n+ * Start of virtual area to add to the heap. Must be aligned by ``page_sz``.\n * @param len\n- * Length of virtual area to add to the heap\n+ * Length of virtual area to add to the heap. Must be aligned by ``page_sz``.\n * @param iova_addrs\n * Array of page IOVA addresses corresponding to each page in this memory\n * area. Can be NULL, in which case page IOVA addresses will be set to\ndiff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c\nindex 0da5ad5e8..46abbfcf6 100644\n--- a/lib/librte_eal/common/rte_malloc.c\n+++ b/lib/librte_eal/common/rte_malloc.c\n@@ -345,6 +345,9 @@ rte_malloc_heap_memory_add(const char *heap_name, void *va_addr, size_t len,\n \n \tif (heap_name == NULL || va_addr == NULL ||\n \t\t\tpage_sz == 0 || !rte_is_power_of_2(page_sz) ||\n+\t\t\tRTE_ALIGN(len, page_sz) != len ||\n+\t\t\t!rte_is_aligned(va_addr, page_sz) ||\n+\t\t\t((len / page_sz) != n_pages && iova_addrs != NULL) ||\n \t\t\tstrnlen(heap_name, RTE_HEAP_NAME_MAX_LEN) == 0 ||\n \t\t\tstrnlen(heap_name, RTE_HEAP_NAME_MAX_LEN) ==\n \t\t\t\tRTE_HEAP_NAME_MAX_LEN) {\n@@ -367,11 +370,6 @@ rte_malloc_heap_memory_add(const char *heap_name, void *va_addr, size_t len,\n \t\tgoto unlock;\n \t}\n \tn = len / page_sz;\n-\tif (n != n_pages && iova_addrs != NULL) {\n-\t\trte_errno = EINVAL;\n-\t\tret = -1;\n-\t\tgoto unlock;\n-\t}\n \n \trte_spinlock_lock(&heap->lock);\n \tret = malloc_heap_add_external_memory(heap, va_addr, iova_addrs, n,\n", "prefixes": [] }{ "id": 48854, "url": "