get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 46130,
    "url": "http://patches.dpdk.org/api/patches/46130/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1538743527-8285-3-git-send-email-alejandro.lucero@netronome.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": "<1538743527-8285-3-git-send-email-alejandro.lucero@netronome.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1538743527-8285-3-git-send-email-alejandro.lucero@netronome.com",
    "date": "2018-10-05T12:45:23",
    "name": "[v3,2/6] mem: use address hint for mapping hugepages",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c35a004f19897037e4fbdf248b4a33312e70427b",
    "submitter": {
        "id": 270,
        "url": "http://patches.dpdk.org/api/people/270/?format=api",
        "name": "Alejandro Lucero",
        "email": "alejandro.lucero@netronome.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1538743527-8285-3-git-send-email-alejandro.lucero@netronome.com/mbox/",
    "series": [
        {
            "id": 1717,
            "url": "http://patches.dpdk.org/api/series/1717/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1717",
            "date": "2018-10-05T12:45:21",
            "name": "use IOVAs check based on DMA mask",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/1717/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/46130/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/46130/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 7DCA94C96;\n\tFri,  5 Oct 2018 14:46:56 +0200 (CEST)",
            "from netronome.com (host-79-78-33-110.static.as9105.net\n\t[79.78.33.110]) by dpdk.org (Postfix) with ESMTP id D04B52C36\n\tfor <dev@dpdk.org>; Fri,  5 Oct 2018 14:46:50 +0200 (CEST)",
            "from netronome.com (localhost [127.0.0.1])\n\tby netronome.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id\n\tw95CjUhB008374 for <dev@dpdk.org>; Fri, 5 Oct 2018 13:45:30 +0100",
            "(from alucero@localhost)\n\tby netronome.com (8.14.4/8.14.4/Submit) id w95CjU4j008373\n\tfor dev@dpdk.org; Fri, 5 Oct 2018 13:45:30 +0100"
        ],
        "From": "Alejandro Lucero <alejandro.lucero@netronome.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri,  5 Oct 2018 13:45:23 +0100",
        "Message-Id": "<1538743527-8285-3-git-send-email-alejandro.lucero@netronome.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1538743527-8285-1-git-send-email-alejandro.lucero@netronome.com>",
        "References": "<1538743527-8285-1-git-send-email-alejandro.lucero@netronome.com>",
        "Subject": "[dpdk-dev] [PATCH v3 2/6] mem: use address hint for mapping\n\thugepages",
        "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://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Linux kernel uses a really high address as starting address for\nserving mmaps calls. If there exist addressing limitations and\nIOVA mode is VA, this starting address is likely too high for\nthose devices. However, it is possible to use a lower address in\nthe process virtual address space as with 64 bits there is a lot\nof available space.\n\nThis patch adds an address hint as starting address for 64 bits\nsystems and increments the hint for next invocations. If the mmap\ncall does not use the hint address, repeat the mmap call using\nthe hint address incremented by page size.\n\nSigned-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>\nReviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n lib/librte_eal/common/eal_common_memory.c | 34 ++++++++++++++++++++++++++++++-\n 1 file changed, 33 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c\nindex c482f0d..853c44c 100644\n--- a/lib/librte_eal/common/eal_common_memory.c\n+++ b/lib/librte_eal/common/eal_common_memory.c\n@@ -37,6 +37,23 @@\n static void *next_baseaddr;\n static uint64_t system_page_sz;\n \n+#ifdef RTE_ARCH_64\n+/*\n+ * Linux kernel uses a really high address as starting address for serving\n+ * mmaps calls. If there exists addressing limitations and IOVA mode is VA,\n+ * this starting address is likely too high for those devices. However, it\n+ * is possible to use a lower address in the process virtual address space\n+ * as with 64 bits there is a lot of available space.\n+ *\n+ * Current known limitations are 39 or 40 bits. Setting the starting address\n+ * at 4GB implies there are 508GB or 1020GB for mapping the available\n+ * hugepages. This is likely enough for most systems, although a device with\n+ * addressing limitations should call rte_eal_check_dma_mask for ensuring all\n+ * memory is within supported range.\n+ */\n+static uint64_t baseaddr = 0x100000000;\n+#endif\n+\n void *\n eal_get_virtual_area(void *requested_addr, size_t *size,\n \t\tsize_t page_sz, int flags, int mmap_flags)\n@@ -60,6 +77,11 @@\n \t\t\trte_eal_process_type() == RTE_PROC_PRIMARY)\n \t\tnext_baseaddr = (void *) internal_config.base_virtaddr;\n \n+#ifdef RTE_ARCH_64\n+\tif (next_baseaddr == NULL && internal_config.base_virtaddr == 0 &&\n+\t\t\trte_eal_process_type() == RTE_PROC_PRIMARY)\n+\t\tnext_baseaddr = (void *) baseaddr;\n+#endif\n \tif (requested_addr == NULL && next_baseaddr != NULL) {\n \t\trequested_addr = next_baseaddr;\n \t\trequested_addr = RTE_PTR_ALIGN(requested_addr, page_sz);\n@@ -91,7 +113,17 @@\n \t\t\t\tmmap_flags, -1, 0);\n \t\tif (mapped_addr == MAP_FAILED && allow_shrink)\n \t\t\t*size -= page_sz;\n-\t} while (allow_shrink && mapped_addr == MAP_FAILED && *size > 0);\n+\n+\t\tif (mapped_addr != MAP_FAILED && addr_is_hint &&\n+\t\t    mapped_addr != requested_addr) {\n+\t\t\t/* hint was not used. Try with another offset */\n+\t\t\tmunmap(mapped_addr, map_sz);\n+\t\t\tmapped_addr = MAP_FAILED;\n+\t\t\tnext_baseaddr = RTE_PTR_ADD(next_baseaddr, page_sz);\n+\t\t\trequested_addr = next_baseaddr;\n+\t\t}\n+\t} while ((allow_shrink || addr_is_hint) &&\n+\t\t mapped_addr == MAP_FAILED && *size > 0);\n \n \t/* align resulting address - if map failed, we will ignore the value\n \t * anyway, so no need to add additional checks.\n",
    "prefixes": [
        "v3",
        "2/6"
    ]
}