Show a patch.

GET /api/patches/44232/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 44232,
    "url": "http://patches.dpdk.org/api/patches/44232/",
    "web_url": "http://patches.dpdk.org/patch/44232/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<7ceac61e5bd25dbb68c0afc79f0c53f39d465d87.1536064999.git.anatoly.burakov@intel.com>",
    "date": "2018-09-04T13:11:44",
    "name": "[09/16] malloc: add function to query socket ID of named heap",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "bf37b4f5333ecc833e095732487c8fcad884c2c5",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/",
        "name": "Burakov, Anatoly",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/patch/44232/mbox/",
    "series": [
        {
            "id": 1170,
            "url": "http://patches.dpdk.org/api/series/1170/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1170",
            "date": "2018-09-04T13:11:35",
            "name": "Support externally allocated memory in DPDK",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/1170/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44232/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44232/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "X-ExtLoop1": "1",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8C14D5B32;\n\tTue,  4 Sep 2018 15:12:14 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 0D7A84CB3\n\tfor <dev@dpdk.org>; Tue,  4 Sep 2018 15:12:09 +0200 (CEST)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t04 Sep 2018 06:12:09 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga006.jf.intel.com with ESMTP; 04 Sep 2018 06:11:54 -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\tw84DBr2Y023372; Tue, 4 Sep 2018 14:11:53 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w84DBr8h024625;\n\tTue, 4 Sep 2018 14:11:53 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w84DBrTc024619;\n\tTue, 4 Sep 2018 14:11:53 +0100"
        ],
        "References": [
            "<cover.1536064999.git.anatoly.burakov@intel.com>",
            "<cover.1536064999.git.anatoly.burakov@intel.com>"
        ],
        "X-Amp-File-Uploaded": "False",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<7ceac61e5bd25dbb68c0afc79f0c53f39d465d87.1536064999.git.anatoly.burakov@intel.com>",
        "X-IronPort-AV": "E=Sophos;i=\"5.53,329,1531810800\"; d=\"scan'208\";a=\"71483334\"",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Precedence": "list",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "In-Reply-To": [
            "<cover.1536064999.git.anatoly.burakov@intel.com>",
            "<cover.1536064999.git.anatoly.burakov@intel.com>"
        ],
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "To": "dev@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Date": "Tue,  4 Sep 2018 14:11:44 +0100",
        "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\tsrinath.mannam@broadcom.com, scott.branden@broadcom.com,\n\tajit.khaparde@broadcom.com, keith.wiles@intel.com,\n\tbruce.richardson@intel.com, thomas@monjalon.net",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH 09/16] malloc: add function to query socket ID of\n\tnamed heap"
    },
    "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 0515d47f3..b789333b3 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, heap->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 344a43d32..6fd729b8b 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -311,6 +311,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": [
        "09/16"
    ]
}