get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 35730,
    "url": "http://patches.dpdk.org/api/patches/35730/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/ed78c352e05e38b66ac3c5f0a00f31ec5d978fa7.1520428025.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": "<ed78c352e05e38b66ac3c5f0a00f31ec5d978fa7.1520428025.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/ed78c352e05e38b66ac3c5f0a00f31ec5d978fa7.1520428025.git.anatoly.burakov@intel.com",
    "date": "2018-03-07T16:56:46",
    "name": "[dpdk-dev,v2,18/41] test: fix malloc autotest to support memory hotplug",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "bc7f27810f5e7b038c61f4f178fdf38cf06b8d5c",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/ed78c352e05e38b66ac3c5f0a00f31ec5d978fa7.1520428025.git.anatoly.burakov@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/35730/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/35730/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 DDE55AA94;\n\tWed,  7 Mar 2018 17:57:28 +0100 (CET)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 8AD2B5F54\n\tfor <dev@dpdk.org>; Wed,  7 Mar 2018 17:57:16 +0100 (CET)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t07 Mar 2018 08:57:16 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga006.jf.intel.com with ESMTP; 07 Mar 2018 08:57:12 -0800",
            "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\tw27GvCkF032398; Wed, 7 Mar 2018 16:57:12 GMT",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w27GvCHS006742;\n\tWed, 7 Mar 2018 16:57:12 GMT",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w27GvCv6006738;\n\tWed, 7 Mar 2018 16:57:12 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.47,436,1515484800\"; d=\"scan'208\";a=\"23713547\"",
        "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",
        "Date": "Wed,  7 Mar 2018 16:56:46 +0000",
        "Message-Id": "<ed78c352e05e38b66ac3c5f0a00f31ec5d978fa7.1520428025.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<cover.1520428025.git.anatoly.burakov@intel.com>",
            "<cover.1520428025.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1520428025.git.anatoly.burakov@intel.com>",
            "<cover.1520083504.git.anatoly.burakov@intel.com>\n\t<cover.1520428025.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 18/41] test: fix malloc autotest to support\n\tmemory hotplug",
        "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": "The test was expecting memory already being allocated on all sockets,\nand thus was failing because calling rte_malloc could trigger memory\nhotplug event and allocate memory where there was none before.\n\nFix it to instead report availability of memory on specific sockets\nby attempting to allocate a page and see if that succeeds. Technically,\nthis can still cause failure as memory might not be available at the\ntime of check, but become available by the time the test is run, but\nthis is a corner case not worth considering.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n test/test/test_malloc.c | 52 +++++++++++++++++++++++++++++++++++++++++--------\n 1 file changed, 44 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/test/test/test_malloc.c b/test/test/test_malloc.c\nindex 8484fb6..2aaf1b8 100644\n--- a/test/test/test_malloc.c\n+++ b/test/test/test_malloc.c\n@@ -22,6 +22,8 @@\n #include <rte_random.h>\n #include <rte_string_fns.h>\n \n+#include \"../../lib/librte_eal/common/eal_memalloc.h\"\n+\n #include \"test.h\"\n \n #define N 10000\n@@ -708,22 +710,56 @@ test_malloc_bad_params(void)\n \n /* Check if memory is avilable on a specific socket */\n static int\n-is_mem_on_socket(int32_t socket)\n+is_mem_on_socket(unsigned int socket)\n {\n+\tstruct rte_malloc_socket_stats stats;\n \tconst struct rte_mem_config *mcfg =\n \t\t\trte_eal_get_configuration()->mem_config;\n-\tunsigned i;\n+\tuint64_t prev_pgsz;\n+\tunsigned int i;\n+\n+\t/* we cannot know if there's memory on a specific socket, since it might\n+\t * be available, but not yet allocated. so, in addition to checking\n+\t * already mapped memory, we will attempt to allocate a page from that\n+\t * socket and see if it works.\n+\t */\n+\tif (socket >= rte_num_sockets())\n+\t\treturn 0;\n \n+\trte_malloc_get_socket_stats(socket, &stats);\n+\n+\t/* if heap has memory allocated, stop */\n+\tif (stats.heap_totalsz_bytes > 0)\n+\t\treturn 1;\n+\n+\t/* to allocate a page, we will have to know its size, so go through all\n+\t * supported page sizes and try with each one.\n+\t */\n+\tprev_pgsz = 0;\n \tfor (i = 0; i < RTE_MAX_MEMSEG_LISTS; i++) {\n-\t\tconst struct rte_memseg_list *msl =\n-\t\t\t\t&mcfg->memsegs[i];\n-\t\tconst struct rte_fbarray *arr = &msl->memseg_arr;\n+\t\tconst struct rte_memseg_list *msl = &mcfg->memsegs[i];\n+\t\tuint64_t page_sz;\n \n-\t\tif (msl->socket_id != socket)\n+\t\t/* skip unused memseg lists */\n+\t\tif (msl->memseg_arr.len == 0)\n \t\t\tcontinue;\n+\t\tpage_sz = msl->hugepage_sz;\n \n-\t\tif (arr->count)\n-\t\t\treturn 1;\n+\t\t/* skip page sizes we've tried already */\n+\t\tif (prev_pgsz == page_sz)\n+\t\t\tcontinue;\n+\n+\t\tprev_pgsz = page_sz;\n+\n+\t\tstruct rte_memseg *ms = eal_memalloc_alloc_page(page_sz,\n+\t\t\t\tsocket);\n+\n+\t\tif (ms == NULL)\n+\t\t\tcontinue;\n+\n+\t\teal_memalloc_free_page(ms);\n+\n+\t\treturn 1;\n \t}\n \treturn 0;\n }\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "18/41"
    ]
}