get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 65657,
    "url": "http://patches.dpdk.org/api/patches/65657/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/5ebcce5b7df8fa0620b3d0fd6bf67a0668b942ac.1581073866.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": "<5ebcce5b7df8fa0620b3d0fd6bf67a0668b942ac.1581073866.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/5ebcce5b7df8fa0620b3d0fd6bf67a0668b942ac.1581073866.git.anatoly.burakov@intel.com",
    "date": "2020-02-07T11:11:14",
    "name": "[v3] eal/mem: preallocate VA space in no-huge mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "aee89054c97f4c4cfe480b07d7937f7b456d444b",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/5ebcce5b7df8fa0620b3d0fd6bf67a0668b942ac.1581073866.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 8461,
            "url": "http://patches.dpdk.org/api/series/8461/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8461",
            "date": "2020-02-07T11:11:14",
            "name": "[v3] eal/mem: preallocate VA space in no-huge mode",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/8461/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/65657/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/65657/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 56B87A0542;\n\tFri,  7 Feb 2020 12:11:16 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 724941C0BC;\n\tFri,  7 Feb 2020 12:11:15 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by dpdk.org (Postfix) with ESMTP id 7D33D1C06A;\n Fri,  7 Feb 2020 12:11:13 +0100 (CET)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 07 Feb 2020 03:11:12 -0800",
            "from silpixa00399498.ir.intel.com (HELO\n silpixa00399498.ger.corp.intel.com) ([10.237.223.151])\n by orsmga004.jf.intel.com with ESMTP; 07 Feb 2020 03:11:11 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.70,413,1574150400\"; d=\"scan'208\";a=\"379366160\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "stable@dpdk.org",
        "Date": "Fri,  7 Feb 2020 11:11:14 +0000",
        "Message-Id": "\n <5ebcce5b7df8fa0620b3d0fd6bf67a0668b942ac.1581073866.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "\n <99d72c1b91e3fce36713b529ab47e8aa3fd78454.1579885526.git.anatoly.burakov@intel.com>",
        "References": "\n <99d72c1b91e3fce36713b529ab47e8aa3fd78454.1579885526.git.anatoly.burakov@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3] eal/mem: preallocate VA space in no-huge mode",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "When --no-huge mode is used, the memory is currently allocated with\nmmap(NULL, ...). This is fine in most cases, but can fail in cases\nwhere DPDK is run on a machine with an IOMMU that is of more limited\naddress width than that of a VA, because we're not specifying the\naddress hint for mmap() call.\n\nFix it by preallocating VA space before mapping it.\n\nCc: stable@dpdk.org\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n\nNotes:\n    v3:\n    - Fix mmap flags used in place of offset\n    - Fix using internal_config.memory in place of mem_sz\n    - Add additional address sanity check\n    \n    v2:\n    - Add unmap on unsuccessful mmap\n    \n    I couldn't figure out which specific commit has introduced\n    the issue, so there's no fix tag. The most likely candidate\n    is one that introduced the DMA mask thing in the first place\n    but i'm not sure.\n\n lib/librte_eal/linux/eal/eal_memory.c | 24 ++++++++++++++++++++----\n 1 file changed, 20 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linux/eal/eal_memory.c b/lib/librte_eal/linux/eal/eal_memory.c\nindex 5604c2a7c0..7a9c97ff88 100644\n--- a/lib/librte_eal/linux/eal/eal_memory.c\n+++ b/lib/librte_eal/linux/eal/eal_memory.c\n@@ -1340,6 +1340,8 @@ eal_legacy_hugepage_init(void)\n \n \t/* hugetlbfs can be disabled */\n \tif (internal_config.no_hugetlbfs) {\n+\t\tvoid *prealloc_addr;\n+\t\tsize_t mem_sz;\n \t\tstruct rte_memseg_list *msl;\n \t\tint n_segs, cur_seg, fd, flags;\n #ifdef MEMFD_SUPPORTED\n@@ -1395,17 +1397,31 @@ eal_legacy_hugepage_init(void)\n \t\t\t}\n \t\t}\n #endif\n-\t\taddr = mmap(NULL, internal_config.memory, PROT_READ | PROT_WRITE,\n-\t\t\t\tflags, fd, 0);\n-\t\tif (addr == MAP_FAILED) {\n+\t\t/* preallocate address space for the memory, so that it can be\n+\t\t * fit into the DMA mask.\n+\t\t */\n+\t\tmem_sz = internal_config.memory;\n+\t\tprealloc_addr = eal_get_virtual_area(\n+\t\t\t\tNULL, &mem_sz, page_sz, 0, 0);\n+\t\tif (prealloc_addr == NULL) {\n+\t\t\tRTE_LOG(ERR, EAL,\n+\t\t\t\t\t\"%s: reserving memory area failed: \"\n+\t\t\t\t\t\"%s\\n\",\n+\t\t\t\t\t__func__, strerror(errno));\n+\t\t\treturn -1;\n+\t\t}\n+\t\taddr = mmap(prealloc_addr, mem_sz, PROT_READ | PROT_WRITE,\n+\t\t\t\tflags | MAP_FIXED, fd, 0);\n+\t\tif (addr == MAP_FAILED || addr != prealloc_addr) {\n \t\t\tRTE_LOG(ERR, EAL, \"%s: mmap() failed: %s\\n\", __func__,\n \t\t\t\t\tstrerror(errno));\n+\t\t\tmunmap(prealloc_addr, mem_sz);\n \t\t\treturn -1;\n \t\t}\n \t\tmsl->base_va = addr;\n \t\tmsl->page_sz = page_sz;\n \t\tmsl->socket_id = 0;\n-\t\tmsl->len = internal_config.memory;\n+\t\tmsl->len = mem_sz;\n \t\tmsl->heap = 1;\n \n \t\t/* we're in single-file segments mode, so only the segment list\n",
    "prefixes": [
        "v3"
    ]
}