Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/45760/?format=api
http://patches.dpdk.org/api/patches/45760/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/d40afae28be9a27571e09ebe17cfd1ea46eddda2.1538398379.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": "<d40afae28be9a27571e09ebe17cfd1ea46eddda2.1538398379.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/d40afae28be9a27571e09ebe17cfd1ea46eddda2.1538398379.git.anatoly.burakov@intel.com", "date": "2018-10-01T12:56:17", "name": "[v8,09/21] malloc: add function to query socket ID of named heap", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "726a459ee3be07aee72a0ad6d48db1723fc84aad", "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/d40afae28be9a27571e09ebe17cfd1ea46eddda2.1538398379.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 1614, "url": "http://patches.dpdk.org/api/series/1614/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1614", "date": "2018-10-01T12:56:13", "name": "Support externally allocated memory in DPDK", "version": 8, "mbox": "http://patches.dpdk.org/series/1614/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/45760/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/45760/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 2B5141B150;\n\tMon, 1 Oct 2018 14:56:45 +0200 (CEST)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 343FC1B128\n\tfor <dev@dpdk.org>; Mon, 1 Oct 2018 14:56:37 +0200 (CEST)", "from orsmga007.jf.intel.com ([10.7.209.58])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t01 Oct 2018 05:56:36 -0700", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga007.jf.intel.com with ESMTP; 01 Oct 2018 05:56:32 -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\tw91CuVwp000605; Mon, 1 Oct 2018 13:56:31 +0100", "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w91CuV6L023873;\n\tMon, 1 Oct 2018 13:56:31 +0100", "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w91CuVXA023869;\n\tMon, 1 Oct 2018 13:56:31 +0100" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.54,327,1534834800\"; d=\"scan'208\";a=\"77534405\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "laszlo.madarassy@ericsson.com, laszlo.vadkerti@ericsson.com,\n\tandras.kovacs@ericsson.com, winnie.tian@ericsson.com,\n\tdaniel.andrasi@ericsson.com, janos.kobor@ericsson.com,\n\tgeza.koblo@ericsson.com, srinath.mannam@broadcom.com,\n\tscott.branden@broadcom.com, ajit.khaparde@broadcom.com,\n\tkeith.wiles@intel.com, bruce.richardson@intel.com, thomas@monjalon.net,\n\tshreyansh.jain@nxp.com, shahafs@mellanox.com,\n\tarybchenko@solarflare.com, alejandro.lucero@netronome.com", "Date": "Mon, 1 Oct 2018 13:56:17 +0100", "Message-Id": "<d40afae28be9a27571e09ebe17cfd1ea46eddda2.1538398379.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": [ "<cover.1538398379.git.anatoly.burakov@intel.com>", "<cover.1538398379.git.anatoly.burakov@intel.com>" ], "References": [ "<cover.1538398379.git.anatoly.burakov@intel.com>", "<cover.1538384304.git.anatoly.burakov@intel.com>\n\t<cover.1538398379.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [PATCH v8 09/21] malloc: add function to query socket ID\n\tof named heap", "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": "When we will be creating external heaps, they will have their own\n\"fake\" socket ID, so add a function that will map the heap name\nto its socket ID.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/include/rte_malloc.h | 14 ++++++++\n lib/librte_eal/common/rte_malloc.c | 37 ++++++++++++++++++++++\n lib/librte_eal/rte_eal_version.map | 1 +\n 3 files changed, 52 insertions(+)", "diff": "diff --git a/lib/librte_eal/common/include/rte_malloc.h b/lib/librte_eal/common/include/rte_malloc.h\nindex a9fb7e452..8870732a6 100644\n--- a/lib/librte_eal/common/include/rte_malloc.h\n+++ b/lib/librte_eal/common/include/rte_malloc.h\n@@ -263,6 +263,20 @@ int\n rte_malloc_get_socket_stats(int socket,\n \t\tstruct rte_malloc_socket_stats *socket_stats);\n \n+/**\n+ * Find socket ID corresponding to a named heap.\n+ *\n+ * @param name\n+ * Heap name to find socket ID for\n+ * @return\n+ * Socket ID in case of success (a non-negative number)\n+ * -1 in case of error, with rte_errno set to one of the following:\n+ * EINVAL - ``name`` was NULL\n+ * ENOENT - heap identified by the name ``name`` was not found\n+ */\n+int __rte_experimental\n+rte_malloc_heap_get_socket(const char *name);\n+\n /**\n * Dump statistics.\n *\ndiff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c\nindex 72632da56..b807dfe09 100644\n--- a/lib/librte_eal/common/rte_malloc.c\n+++ b/lib/librte_eal/common/rte_malloc.c\n@@ -8,6 +8,7 @@\n #include <string.h>\n #include <sys/queue.h>\n \n+#include <rte_errno.h>\n #include <rte_memcpy.h>\n #include <rte_memory.h>\n #include <rte_eal.h>\n@@ -183,6 +184,42 @@ rte_malloc_dump_heaps(FILE *f)\n \trte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);\n }\n \n+int\n+rte_malloc_heap_get_socket(const char *name)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\tstruct malloc_heap *heap = NULL;\n+\tunsigned int idx;\n+\tint ret;\n+\n+\tif (name == NULL ||\n+\t\t\tstrnlen(name, RTE_HEAP_NAME_MAX_LEN) == 0 ||\n+\t\t\tstrnlen(name, RTE_HEAP_NAME_MAX_LEN) ==\n+\t\t\t\tRTE_HEAP_NAME_MAX_LEN) {\n+\t\trte_errno = EINVAL;\n+\t\treturn -1;\n+\t}\n+\trte_rwlock_read_lock(&mcfg->memory_hotplug_lock);\n+\tfor (idx = 0; idx < RTE_MAX_HEAPS; idx++) {\n+\t\tstruct malloc_heap *tmp = &mcfg->malloc_heaps[idx];\n+\n+\t\tif (!strncmp(name, tmp->name, RTE_HEAP_NAME_MAX_LEN)) {\n+\t\t\theap = tmp;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\tif (heap != NULL) {\n+\t\tret = heap->socket_id;\n+\t} else {\n+\t\trte_errno = ENOENT;\n+\t\tret = -1;\n+\t}\n+\trte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);\n+\n+\treturn ret;\n+}\n+\n /*\n * Print stats on memory type. If type is NULL, info on all types is printed\n */\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex 73282bbb0..d8f9665b8 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -318,6 +318,7 @@ EXPERIMENTAL {\n \trte_fbarray_set_used;\n \trte_log_register_type_and_pick_level;\n \trte_malloc_dump_heaps;\n+\trte_malloc_heap_get_socket;\n \trte_mem_alloc_validator_register;\n \trte_mem_alloc_validator_unregister;\n \trte_mem_event_callback_register;\n", "prefixes": [ "v8", "09/21" ] }{ "id": 45760, "url": "