get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 37723,
    "url": "https://patches.dpdk.org/api/patches/37723/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/a1337e88ca2a13fed47e49c7d2684de35dc2b32d.1523296701.git.anatoly.burakov@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<a1337e88ca2a13fed47e49c7d2684de35dc2b32d.1523296701.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/a1337e88ca2a13fed47e49c7d2684de35dc2b32d.1523296701.git.anatoly.burakov@intel.com",
    "date": "2018-04-09T18:01:00",
    "name": "[dpdk-dev,v5,57/70] eal: make use of memory hotplug for init",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8fe0a3a8f5ffe8095cc1c85519ad5aab5d9f471d",
    "submitter": {
        "id": 4,
        "url": "https://patches.dpdk.org/api/people/4/?format=api",
        "name": "Burakov, Anatoly",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/a1337e88ca2a13fed47e49c7d2684de35dc2b32d.1523296701.git.anatoly.burakov@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/37723/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/37723/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 4E3111BA7D;\n\tMon,  9 Apr 2018 20:03:33 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id BDCA41B8E9\n\tfor <dev@dpdk.org>; Mon,  9 Apr 2018 20:02:06 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t09 Apr 2018 11:02:06 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga001.jf.intel.com with ESMTP; 09 Apr 2018 11:02:02 -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\tw39I21EG031374; Mon, 9 Apr 2018 19:02:01 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w39I21ZK028461;\n\tMon, 9 Apr 2018 19:02:01 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w39I21At028454;\n\tMon, 9 Apr 2018 19:02:01 +0100"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.48,427,1517904000\"; d=\"scan'208\";a=\"46399178\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "keith.wiles@intel.com, jianfeng.tan@intel.com, andras.kovacs@ericsson.com,\n\tlaszlo.vadkeri@ericsson.com, benjamin.walker@intel.com,\n\tbruce.richardson@intel.com, thomas@monjalon.net,\n\tkonstantin.ananyev@intel.com, kuralamudhan.ramakrishnan@intel.com,\n\tlouise.m.daly@intel.com, nelio.laranjeiro@6wind.com,\n\tyskoh@mellanox.com, pepperjo@japf.ch, jerin.jacob@caviumnetworks.com, \n\themant.agrawal@nxp.com, olivier.matz@6wind.com, shreyansh.jain@nxp.com,\n\tgowrishankar.m@linux.vnet.ibm.com",
        "Date": "Mon,  9 Apr 2018 19:01:00 +0100",
        "Message-Id": "<a1337e88ca2a13fed47e49c7d2684de35dc2b32d.1523296701.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<cover.1523296700.git.anatoly.burakov@intel.com>",
            "<cover.1523296700.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1523296700.git.anatoly.burakov@intel.com>",
            "<cover.1523218215.git.anatoly.burakov@intel.com>\n\t<cover.1523296700.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v5 57/70] eal: make use of memory hotplug for init",
        "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://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://dpdk.org/ml/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 a new (non-legacy) memory init path for EAL. It uses the\nnew memory hotplug facilities.\n\nIf no -m or --socket-mem switches were specified, the new init\nwill not allocate anything, whereas if those switches were passed,\nappropriate amounts of pages would be requested, just like for\nlegacy init.\n\nAllocated pages will be physically discontiguous (or rather, they're\nnot guaranteed to be physically contiguous - they may still be so by\naccident) unless RTE_IOVA_VA mode is used.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\nTested-by: Santosh Shukla <Santosh.Shukla@caviumnetworks.com>\nTested-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n lib/librte_eal/linuxapp/eal/eal_memory.c | 62 ++++++++++++++++++++++++++++++--\n 1 file changed, 59 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c\nindex d38fb68..c51d598 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_memory.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c\n@@ -40,6 +40,7 @@\n #include <rte_string_fns.h>\n \n #include \"eal_private.h\"\n+#include \"eal_memalloc.h\"\n #include \"eal_internal_cfg.h\"\n #include \"eal_filesystem.h\"\n #include \"eal_hugepages.h\"\n@@ -1600,6 +1601,61 @@ eal_legacy_hugepage_init(void)\n \treturn -1;\n }\n \n+static int\n+eal_hugepage_init(void)\n+{\n+\tstruct hugepage_info used_hp[MAX_HUGEPAGE_SIZES];\n+\tuint64_t memory[RTE_MAX_NUMA_NODES];\n+\tint hp_sz_idx, socket_id;\n+\n+\ttest_phys_addrs_available();\n+\n+\tmemset(used_hp, 0, sizeof(used_hp));\n+\n+\tfor (hp_sz_idx = 0;\n+\t\t\thp_sz_idx < (int) internal_config.num_hugepage_sizes;\n+\t\t\thp_sz_idx++) {\n+\t\t/* also initialize used_hp hugepage sizes in used_hp */\n+\t\tstruct hugepage_info *hpi;\n+\t\thpi = &internal_config.hugepage_info[hp_sz_idx];\n+\t\tused_hp[hp_sz_idx].hugepage_sz = hpi->hugepage_sz;\n+\t}\n+\n+\t/* make a copy of socket_mem, needed for balanced allocation. */\n+\tfor (hp_sz_idx = 0; hp_sz_idx < RTE_MAX_NUMA_NODES; hp_sz_idx++)\n+\t\tmemory[hp_sz_idx] = internal_config.socket_mem[hp_sz_idx];\n+\n+\t/* calculate final number of pages */\n+\tif (calc_num_pages_per_socket(memory,\n+\t\t\tinternal_config.hugepage_info, used_hp,\n+\t\t\tinternal_config.num_hugepage_sizes) < 0)\n+\t\treturn -1;\n+\n+\tfor (hp_sz_idx = 0;\n+\t\t\thp_sz_idx < (int)internal_config.num_hugepage_sizes;\n+\t\t\thp_sz_idx++) {\n+\t\tfor (socket_id = 0; socket_id < RTE_MAX_NUMA_NODES;\n+\t\t\t\tsocket_id++) {\n+\t\t\tstruct hugepage_info *hpi = &used_hp[hp_sz_idx];\n+\t\t\tunsigned int num_pages = hpi->num_pages[socket_id];\n+\t\t\tint num_pages_alloc;\n+\n+\t\t\tif (num_pages == 0)\n+\t\t\t\tcontinue;\n+\n+\t\t\tRTE_LOG(DEBUG, EAL, \"Allocating %u pages of size %\" PRIu64 \"M on socket %i\\n\",\n+\t\t\t\tnum_pages, hpi->hugepage_sz >> 20, socket_id);\n+\n+\t\t\tnum_pages_alloc = eal_memalloc_alloc_seg_bulk(NULL,\n+\t\t\t\t\tnum_pages, hpi->hugepage_sz,\n+\t\t\t\t\tsocket_id, true);\n+\t\t\tif (num_pages_alloc < 0)\n+\t\t\t\treturn -1;\n+\t\t}\n+\t}\n+\treturn 0;\n+}\n+\n /*\n  * uses fstat to report the size of a file on disk\n  */\n@@ -1722,9 +1778,9 @@ eal_legacy_hugepage_attach(void)\n int\n rte_eal_hugepage_init(void)\n {\n-\tif (internal_config.legacy_mem)\n-\t\treturn eal_legacy_hugepage_init();\n-\treturn -1;\n+\treturn internal_config.legacy_mem ?\n+\t\t\teal_legacy_hugepage_init() :\n+\t\t\teal_hugepage_init();\n }\n \n int\n",
    "prefixes": [
        "dpdk-dev",
        "v5",
        "57/70"
    ]
}