get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 32459,
    "url": "https://patches.dpdk.org/api/patches/32459/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/23b3239ed0ad52d78d2c3a1fdb8dd19be69ecd51.1513681966.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": "<23b3239ed0ad52d78d2c3a1fdb8dd19be69ecd51.1513681966.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/23b3239ed0ad52d78d2c3a1fdb8dd19be69ecd51.1513681966.git.anatoly.burakov@intel.com",
    "date": "2017-12-19T11:14:42",
    "name": "[dpdk-dev,RFC,v2,15/23] eal: add API to check if memory is physically contiguous",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9ec080aa59a446a2f6db5836a48bfd773adc0bb0",
    "submitter": {
        "id": 4,
        "url": "https://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/23b3239ed0ad52d78d2c3a1fdb8dd19be69ecd51.1513681966.git.anatoly.burakov@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/32459/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/32459/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 1D61C1B1B1;\n\tTue, 19 Dec 2017 12:15:12 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id E226B1B022\n\tfor <dev@dpdk.org>; Tue, 19 Dec 2017 12:14:55 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Dec 2017 03:14:55 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga002.jf.intel.com with ESMTP; 19 Dec 2017 03:14:53 -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\tvBJBEq4n003132; Tue, 19 Dec 2017 11:14:52 GMT",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id vBJBEqO8010288;\n\tTue, 19 Dec 2017 11:14:52 GMT",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id vBJBEq8o010283;\n\tTue, 19 Dec 2017 11:14:52 GMT"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.45,426,1508828400\"; d=\"scan'208\";a=\"19495274\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "andras.kovacs@ericsson.com, laszlo.vadkeri@ericsson.com,\n\tkeith.wiles@intel.com, benjamin.walker@intel.com,\n\tbruce.richardson@intel.com, thomas@monjalon.net",
        "Date": "Tue, 19 Dec 2017 11:14:42 +0000",
        "Message-Id": "<23b3239ed0ad52d78d2c3a1fdb8dd19be69ecd51.1513681966.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<cover.1513681966.git.anatoly.burakov@intel.com>",
            "<cover.1513681966.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1513681966.git.anatoly.burakov@intel.com>",
            "<cover.1513681966.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [RFC v2 15/23] eal: add API to check if memory is\n\tphysically contiguous",
        "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": "This will be helpful down the line when we implement support for\nallocating physically contiguous memory. We can no longer guarantee\nphysically contiguous memory unless we're in IOVA_AS_VA mode, but\nwe can certainly try and see if we succeed. In addition, this would\nbe useful for e.g. PMD's who may allocate chunks that are smaller\nthan the pagesize, but they must not cross the page boundary, in\nwhich case we will be able to accommodate that request.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_memalloc.c | 79 +++++++++++++++++++++++++++++\n lib/librte_eal/common/eal_memalloc.h        |  5 ++\n lib/librte_eal/linuxapp/eal/Makefile        |  1 +\n 3 files changed, 85 insertions(+)\n create mode 100755 lib/librte_eal/common/eal_common_memalloc.c",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_memalloc.c b/lib/librte_eal/common/eal_common_memalloc.c\nnew file mode 100755\nindex 0000000..395753a\n--- /dev/null\n+++ b/lib/librte_eal/common/eal_common_memalloc.c\n@@ -0,0 +1,79 @@\n+/*-\n+ *   BSD LICENSE\n+ *\n+ *   Copyright(c) 2017 Intel Corporation. All rights reserved.\n+ *\n+ *   Redistribution and use in source and binary forms, with or without\n+ *   modification, are permitted provided that the following conditions\n+ *   are met:\n+ *\n+ *     * Redistributions of source code must retain the above copyright\n+ *       notice, this list of conditions and the following disclaimer.\n+ *     * Redistributions in binary form must reproduce the above copyright\n+ *       notice, this list of conditions and the following disclaimer in\n+ *       the documentation and/or other materials provided with the\n+ *       distribution.\n+ *     * Neither the name of Intel Corporation nor the names of its\n+ *       contributors may be used to endorse or promote products derived\n+ *       from this software without specific prior written permission.\n+ *\n+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ *   \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <rte_lcore.h>\n+#include <rte_fbarray.h>\n+#include <rte_memzone.h>\n+#include <rte_memory.h>\n+#include <rte_eal_memconfig.h>\n+\n+#include \"eal_private.h\"\n+#include \"eal_internal_cfg.h\"\n+#include \"eal_memalloc.h\"\n+\n+// TODO: secondary\n+// TODO: 32-bit\n+\n+bool\n+eal_memalloc_is_contig(const struct rte_memseg_list *msl, void *start,\n+\t\tsize_t len) {\n+\tconst struct rte_memseg *ms;\n+\tuint64_t page_sz;\n+\tvoid *end;\n+\tint start_page, end_page, cur_page;\n+\trte_iova_t expected;\n+\n+\t/* for legacy memory, it's always contiguous */\n+\tif (internal_config.legacy_mem)\n+\t\treturn true;\n+\n+\t/* figure out how many pages we need to fit in current data */\n+\tpage_sz = msl->hugepage_sz;\n+\tend = RTE_PTR_ADD(start, len);\n+\n+\tstart_page = RTE_PTR_DIFF(start, msl->base_va) / page_sz;\n+\tend_page = RTE_PTR_DIFF(end, msl->base_va) / page_sz;\n+\n+\t/* now, look for contiguous memory */\n+\tms = rte_fbarray_get(&msl->memseg_arr, start_page);\n+\texpected = ms->iova + page_sz;\n+\n+\tfor (cur_page = start_page + 1; cur_page < end_page;\n+\t\t\tcur_page++, expected += page_sz) {\n+\t\tms = rte_fbarray_get(&msl->memseg_arr, cur_page);\n+\n+\t\tif (ms->iova != expected)\n+\t\t\treturn false;\n+\t}\n+\n+\treturn true;\n+}\ndiff --git a/lib/librte_eal/common/eal_memalloc.h b/lib/librte_eal/common/eal_memalloc.h\nindex 47e4367..04f9b72 100755\n--- a/lib/librte_eal/common/eal_memalloc.h\n+++ b/lib/librte_eal/common/eal_memalloc.h\n@@ -36,6 +36,7 @@\n #include <stdbool.h>\n \n #include <rte_memory.h>\n+#include <rte_eal_memconfig.h>\n \n struct rte_memseg *\n eal_memalloc_alloc_page(uint64_t size, int socket);\n@@ -47,4 +48,8 @@ eal_memalloc_alloc_page_bulk(struct rte_memseg **ms, int n, uint64_t size,\n int\n eal_memalloc_free_page(struct rte_memseg *ms);\n \n+bool\n+eal_memalloc_is_contig(const struct rte_memseg_list *msl, void *start,\n+\t\tsize_t len);\n+\n #endif // EAL_MEMALLOC_H\ndiff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile\nindex 88f10e9..c1fc557 100644\n--- a/lib/librte_eal/linuxapp/eal/Makefile\n+++ b/lib/librte_eal/linuxapp/eal/Makefile\n@@ -75,6 +75,7 @@ SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_timer.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_memzone.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_log.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_launch.c\n+SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_memalloc.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_memory.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_tailqs.c\n SRCS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += eal_common_errno.c\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "v2",
        "15/23"
    ]
}