get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 41006,
    "url": "http://patchwork.dpdk.org/api/patches/41006/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/a033d2f5109529a159d85c58d7b101b5a6dadacf.1528796062.git.anatoly.burakov@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<a033d2f5109529a159d85c58d7b101b5a6dadacf.1528796062.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/a033d2f5109529a159d85c58d7b101b5a6dadacf.1528796062.git.anatoly.burakov@intel.com",
    "date": "2018-06-12T09:46:14",
    "name": "[1/3] mem: provide thread-unsafe contig walk variant",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "7347f63f4b8e308fd9466fb769656f2bf9975d6e",
    "submitter": {
        "id": 4,
        "url": "http://patchwork.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/a033d2f5109529a159d85c58d7b101b5a6dadacf.1528796062.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 92,
            "url": "http://patchwork.dpdk.org/api/series/92/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=92",
            "date": "2018-06-12T09:46:15",
            "name": "[1/3] mem: provide thread-unsafe contig walk variant",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/92/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/41006/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/41006/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 5A4EB1E56D;\n\tTue, 12 Jun 2018 11:46:24 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id CB1781E495\n\tfor <dev@dpdk.org>; Tue, 12 Jun 2018 11:46:20 +0200 (CEST)",
            "from orsmga007.jf.intel.com ([10.7.209.58])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Jun 2018 02:46:17 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga007.jf.intel.com with ESMTP; 12 Jun 2018 02:46:16 -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\tw5C9kGT3015114 for <dev@dpdk.org>; Tue, 12 Jun 2018 10:46:16 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w5C9kGWl021120\n\tfor <dev@dpdk.org>; Tue, 12 Jun 2018 10:46:16 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w5C9kGwO021116\n\tfor dev@dpdk.org; Tue, 12 Jun 2018 10:46:16 +0100"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,214,1526367600\"; d=\"scan'208\";a=\"48324903\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue, 12 Jun 2018 10:46:14 +0100",
        "Message-Id": "<a033d2f5109529a159d85c58d7b101b5a6dadacf.1528796062.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Subject": "[dpdk-dev] [PATCH 1/3] mem: provide thread-unsafe contig walk\n\tvariant",
        "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": "Sometimes, user code needs to walk memseg list while being inside\na memory-related callback. Rather than making everyone copy around\nthe same iteration code and depending on DPDK internals, provide an\nofficial way to do memseg_contig_walk() inside callbacks.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_memory.c  | 28 ++++++++++++----------\n lib/librte_eal/common/include/rte_memory.h | 18 ++++++++++++++\n lib/librte_eal/rte_eal_version.map         |  1 +\n 3 files changed, 35 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c\nindex 4f0688f9d..e3320a746 100644\n--- a/lib/librte_eal/common/eal_common_memory.c\n+++ b/lib/librte_eal/common/eal_common_memory.c\n@@ -788,14 +788,11 @@ rte_mem_lock_page(const void *virt)\n }\n \n int __rte_experimental\n-rte_memseg_contig_walk(rte_memseg_contig_walk_t func, void *arg)\n+rte_memseg_contig_walk_thread_unsafe(rte_memseg_contig_walk_t func, void *arg)\n {\n \tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n \tint i, ms_idx, ret = 0;\n \n-\t/* do not allow allocations/frees/init while we iterate */\n-\trte_rwlock_read_lock(&mcfg->memory_hotplug_lock);\n-\n \tfor (i = 0; i < RTE_MAX_MEMSEG_LISTS; i++) {\n \t\tstruct rte_memseg_list *msl = &mcfg->memsegs[i];\n \t\tconst struct rte_memseg *ms;\n@@ -820,19 +817,26 @@ rte_memseg_contig_walk(rte_memseg_contig_walk_t func, void *arg)\n \t\t\tlen = n_segs * msl->page_sz;\n \n \t\t\tret = func(msl, ms, len, arg);\n-\t\t\tif (ret < 0) {\n-\t\t\t\tret = -1;\n-\t\t\t\tgoto out;\n-\t\t\t} else if (ret > 0) {\n-\t\t\t\tret = 1;\n-\t\t\t\tgoto out;\n-\t\t\t}\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n \t\t\tms_idx = rte_fbarray_find_next_used(arr,\n \t\t\t\t\tms_idx + n_segs);\n \t\t}\n \t}\n-out:\n+\treturn 0;\n+}\n+\n+int __rte_experimental\n+rte_memseg_contig_walk(rte_memseg_contig_walk_t func, void *arg)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\tint ret = 0;\n+\n+\t/* do not allow allocations/frees/init while we iterate */\n+\trte_rwlock_read_lock(&mcfg->memory_hotplug_lock);\n+\tret = rte_memseg_contig_walk_thread_unsafe(func, arg);\n \trte_rwlock_read_unlock(&mcfg->memory_hotplug_lock);\n+\n \treturn ret;\n }\n \ndiff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h\nindex aab9f6fe5..aeba38bfa 100644\n--- a/lib/librte_eal/common/include/rte_memory.h\n+++ b/lib/librte_eal/common/include/rte_memory.h\n@@ -263,6 +263,24 @@ rte_memseg_contig_walk(rte_memseg_contig_walk_t func, void *arg);\n int __rte_experimental\n rte_memseg_list_walk(rte_memseg_list_walk_t func, void *arg);\n \n+/**\n+ * Walk each VA-contiguous area without performing any locking.\n+ *\n+ * @note This function does not perform any locking, and is only safe to call\n+ *       from within memory-related callback functions.\n+ *\n+ * @param func\n+ *   Iterator function\n+ * @param arg\n+ *   Argument passed to iterator\n+ * @return\n+ *   0 if walked over the entire list\n+ *   1 if stopped by the user\n+ *   -1 if user function reported error\n+ */\n+int __rte_experimental\n+rte_memseg_contig_walk_thread_unsafe(rte_memseg_contig_walk_t func, void *arg);\n+\n /**\n  * Dump the physical memory layout to a file.\n  *\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex f7dd0e7bc..98bfbe796 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -286,6 +286,7 @@ EXPERIMENTAL {\n \trte_mem_virt2memseg;\n \trte_mem_virt2memseg_list;\n \trte_memseg_contig_walk;\n+\trte_memseg_contig_walk_thread_unsafe;\n \trte_memseg_list_walk;\n \trte_memseg_walk;\n \trte_mp_action_register;\n",
    "prefixes": [
        "1/3"
    ]
}