Show a patch.

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

{
    "id": 44236,
    "url": "http://patches.dpdk.org/api/patches/44236/",
    "web_url": "http://patches.dpdk.org/patch/44236/",
    "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": "<d01fd953ac32ce18599a0511035c8d1af25b6d65.1536064999.git.anatoly.burakov@intel.com>",
    "date": "2018-09-04T13:11:43",
    "name": "[08/16] malloc: add name to malloc heaps",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c6d83fbdf3dc0c8c62256b8a11fb197371771b92",
    "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/44236/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/44236/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44236/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 3A38158CB;\n\tTue,  4 Sep 2018 15:13:29 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id DA39B29CB\n\tfor <dev@dpdk.org>; Tue,  4 Sep 2018 15:13:26 +0200 (CEST)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t04 Sep 2018 06:11:55 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga008.fm.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\tw84DBrw0023369; 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 w84DBreL024603;\n\tTue, 4 Sep 2018 14:11:53 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w84DBr7U024596;\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": "<d01fd953ac32ce18599a0511035c8d1af25b6d65.1536064999.git.anatoly.burakov@intel.com>",
        "X-IronPort-AV": "E=Sophos;i=\"5.53,329,1531810800\"; d=\"scan'208\";a=\"68266056\"",
        "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:43 +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 08/16] malloc: add name to malloc heaps"
    },
    "content": "We will need to refer to external heaps in some way. While we use\nheap ID's internally, for external API use it has to be something\nmore user-friendly. So, we will be using a string to uniquely\nidentify a heap.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/include/rte_malloc_heap.h |  2 ++\n lib/librte_eal/common/malloc_heap.c             | 15 ++++++++++++++-\n lib/librte_eal/common/rte_malloc.c              |  1 +\n 3 files changed, 17 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_eal/common/include/rte_malloc_heap.h b/lib/librte_eal/common/include/rte_malloc_heap.h\nindex e7ac32d42..1c08ef3e0 100644\n--- a/lib/librte_eal/common/include/rte_malloc_heap.h\n+++ b/lib/librte_eal/common/include/rte_malloc_heap.h\n@@ -12,6 +12,7 @@\n \n /* Number of free lists per heap, grouped by size. */\n #define RTE_HEAP_NUM_FREELISTS  13\n+#define RTE_HEAP_NAME_MAX_LEN 32\n \n /* dummy definition, for pointers */\n struct malloc_elem;\n@@ -28,6 +29,7 @@ struct malloc_heap {\n \tunsigned alloc_count;\n \tsize_t total_size;\n \tunsigned int socket_id;\n+\tchar name[RTE_HEAP_NAME_MAX_LEN];\n } __rte_cache_aligned;\n \n #endif /* _RTE_MALLOC_HEAP_H_ */\ndiff --git a/lib/librte_eal/common/malloc_heap.c b/lib/librte_eal/common/malloc_heap.c\nindex 0a868f61d..813961f0c 100644\n--- a/lib/librte_eal/common/malloc_heap.c\n+++ b/lib/librte_eal/common/malloc_heap.c\n@@ -127,7 +127,6 @@ malloc_add_seg(const struct rte_memseg_list *msl,\n \tmalloc_heap_add_memory(heap, found_msl, ms->addr, len);\n \n \theap->total_size += len;\n-\theap->socket_id = msl->socket_id;\n \n \tRTE_LOG(DEBUG, EAL, \"Added %zuM to heap on socket %i\\n\", len >> 20,\n \t\t\tmsl->socket_id);\n@@ -1011,6 +1010,20 @@ int\n rte_eal_malloc_heap_init(void)\n {\n \tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\tunsigned int i;\n+\n+\t/* assign names to default DPDK heaps */\n+\tfor (i = 0; i < rte_socket_count(); i++) {\n+\t\tstruct malloc_heap *heap = &mcfg->malloc_heaps[i];\n+\t\tchar heap_name[RTE_HEAP_NAME_MAX_LEN];\n+\t\tint socket_id = rte_socket_id_by_idx(i);\n+\n+\t\tsnprintf(heap_name, sizeof(heap_name) - 1,\n+\t\t\t\t\"socket_%i\", socket_id);\n+\t\tstrlcpy(heap->name, heap_name, RTE_HEAP_NAME_MAX_LEN);\n+\t\theap->socket_id = socket_id;\n+\t}\n+\n \n \tif (register_mp_requests()) {\n \t\tRTE_LOG(ERR, EAL, \"Couldn't register malloc multiprocess actions\\n\");\ndiff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c\nindex 458c44ba6..0515d47f3 100644\n--- a/lib/librte_eal/common/rte_malloc.c\n+++ b/lib/librte_eal/common/rte_malloc.c\n@@ -202,6 +202,7 @@ rte_malloc_dump_stats(FILE *f, __rte_unused const char *type)\n \t\tmalloc_heap_get_stats(heap, &sock_stats);\n \n \t\tfprintf(f, \"Heap id:%u\\n\", heap_id);\n+\t\tfprintf(f, \"\\tHeap name:%s\\n\", heap->name);\n \t\tfprintf(f, \"\\tHeap_size:%zu,\\n\", sock_stats.heap_totalsz_bytes);\n \t\tfprintf(f, \"\\tFree_size:%zu,\\n\", sock_stats.heap_freesz_bytes);\n \t\tfprintf(f, \"\\tAlloc_size:%zu,\\n\", sock_stats.heap_allocsz_bytes);\n",
    "prefixes": [
        "08/16"
    ]
}