get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 37014,
    "url": "https://patches.dpdk.org/api/patches/37014/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/89c78819570fc28e4240241bd513a6ef64f8a7db.1522797505.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": "<89c78819570fc28e4240241bd513a6ef64f8a7db.1522797505.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/89c78819570fc28e4240241bd513a6ef64f8a7db.1522797505.git.anatoly.burakov@intel.com",
    "date": "2018-04-03T23:21:37",
    "name": "[dpdk-dev,v3,25/68] eal: add function to walk all memsegs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "903dd99eb2400503edd2252820121bb1e675bd12",
    "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/89c78819570fc28e4240241bd513a6ef64f8a7db.1522797505.git.anatoly.burakov@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/37014/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/37014/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 69BF51BA17;\n\tWed,  4 Apr 2018 01:23:22 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 62B771B892\n\tfor <dev@dpdk.org>; Wed,  4 Apr 2018 01:22:31 +0200 (CEST)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t03 Apr 2018 16:22:29 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga001.fm.intel.com with ESMTP; 03 Apr 2018 16:22:24 -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\tw33NMPWN013113; Wed, 4 Apr 2018 00:22:25 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w33NMPmN014752;\n\tWed, 4 Apr 2018 00:22:25 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w33NMP3e014748;\n\tWed, 4 Apr 2018 00:22:25 +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,403,1517904000\"; d=\"scan'208\";a=\"43785334\"",
        "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": "Wed,  4 Apr 2018 00:21:37 +0100",
        "Message-Id": "<89c78819570fc28e4240241bd513a6ef64f8a7db.1522797505.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<cover.1522797505.git.anatoly.burakov@intel.com>",
            "<cover.1522797505.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1522797505.git.anatoly.burakov@intel.com>",
            "<cover.1520428025.git.anatoly.burakov@intel.com>\n\t<cover.1522797505.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v3 25/68] eal: add function to walk all memsegs",
        "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": "For code that might need to iterate over list of allocated\nsegments, using this API will make it more resilient to\ninternal API changes and will prevent copying the same\niteration code over and over again.\n\nAdditionally, down the line there will be locking implemented,\nso users of this API will not need to care about locking\neither.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_memory.c  | 21 +++++++++++++++++++++\n lib/librte_eal/common/include/rte_memory.h | 25 +++++++++++++++++++++++++\n lib/librte_eal/rte_eal_version.map         |  1 +\n 3 files changed, 47 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c\nindex 5b8ced4..947db1f 100644\n--- a/lib/librte_eal/common/eal_common_memory.c\n+++ b/lib/librte_eal/common/eal_common_memory.c\n@@ -218,6 +218,27 @@ rte_mem_lock_page(const void *virt)\n \treturn mlock((void *)aligned, page_size);\n }\n \n+int __rte_experimental\n+rte_memseg_walk(rte_memseg_walk_t func, void *arg)\n+{\n+\tstruct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;\n+\tint i, ret;\n+\n+\tfor (i = 0; i < RTE_MAX_MEMSEG; i++) {\n+\t\tconst struct rte_memseg *ms = &mcfg->memseg[i];\n+\n+\t\tif (ms->addr == NULL)\n+\t\t\tcontinue;\n+\n+\t\tret = func(ms, arg);\n+\t\tif (ret < 0)\n+\t\t\treturn -1;\n+\t\tif (ret > 0)\n+\t\t\treturn 1;\n+\t}\n+\treturn 0;\n+}\n+\n /* init memory subsystem */\n int\n rte_eal_memory_init(void)\ndiff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h\nindex 302f865..93eadaa 100644\n--- a/lib/librte_eal/common/include/rte_memory.h\n+++ b/lib/librte_eal/common/include/rte_memory.h\n@@ -20,6 +20,7 @@ extern \"C\" {\n #endif\n \n #include <rte_common.h>\n+#include <rte_compat.h>\n #include <rte_config.h>\n \n __extension__\n@@ -130,6 +131,30 @@ phys_addr_t rte_mem_virt2phy(const void *virt);\n rte_iova_t rte_mem_virt2iova(const void *virt);\n \n /**\n+ * Memseg walk function prototype.\n+ *\n+ * Returning 0 will continue walk\n+ * Returning 1 will stop the walk\n+ * Returning -1 will stop the walk and report error\n+ */\n+typedef int (*rte_memseg_walk_t)(const struct rte_memseg *ms, void *arg);\n+\n+/**\n+ * Walk list of all memsegs.\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_walk(rte_memseg_walk_t func, void *arg);\n+\n+/**\n  * Get the layout of the available physical memory.\n  *\n  * It can be useful for an application to have the full physical\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex 25e00de..7e9900d 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -223,6 +223,7 @@ EXPERIMENTAL {\n \trte_eal_mbuf_user_pool_ops;\n \trte_log_register_type_and_pick_level;\n \trte_malloc_dump_heaps;\n+\trte_memseg_walk;\n \trte_memzone_reserve_contig;\n \trte_memzone_reserve_aligned_contig;\n \trte_memzone_reserve_bounded_contig;\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "25/68"
    ]
}