get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1218,
    "url": "http://patches.dpdk.org/api/patches/1218/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1415417532-4363-1-git-send-email-liang.xu@cinfotech.cn/",
    "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": "<1415417532-4363-1-git-send-email-liang.xu@cinfotech.cn>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1415417532-4363-1-git-send-email-liang.xu@cinfotech.cn",
    "date": "2014-11-08T03:32:12",
    "name": "[dpdk-dev] eal: map PCI memory resources after hugepages",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f19afa1ddf0a6a62456c54722ea6e9188e9830be",
    "submitter": {
        "id": 106,
        "url": "http://patches.dpdk.org/api/people/106/?format=api",
        "name": "lxu",
        "email": "liang.xu@cinfotech.cn"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1415417532-4363-1-git-send-email-liang.xu@cinfotech.cn/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/1218/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/1218/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 88DC8591A;\n\tSat,  8 Nov 2014 04:22:57 +0100 (CET)",
            "from out1134-233.mail.aliyun.com (out1134-233.mail.aliyun.com\n\t[42.120.134.233]) by dpdk.org (Postfix) with ESMTP id A51B3590B\n\tfor <dev@dpdk.org>; Sat,  8 Nov 2014 04:22:54 +0100 (CET)",
            "from localhost.localdomain(mailfrom:liang.xu@cinfotech.cn\n\tip:222.65.239.251) by smtp.aliyun-inc.com(10.147.11.247);\n\tSat, 08 Nov 2014 11:32:24 +0800"
        ],
        "X-Alimail-AntiSpam": "AC=CONTINUE; BC=0.07771052|-1; FP=0|0|0|0|0|-1|-1|-1;\n\tHT=r46d02008; MF=liang.xu@cinfotech.cn; PH=DS; RN=3; RT=3; SR=0; ",
        "From": "Liang Xu <liang.xu@cinfotech.cn>",
        "To": "dev@dpdk.org",
        "Date": "Sat,  8 Nov 2014 11:32:12 +0800",
        "Message-Id": "<1415417532-4363-1-git-send-email-liang.xu@cinfotech.cn>",
        "X-Mailer": "git-send-email 1.9.1",
        "Subject": "[dpdk-dev] [PATCH] eal: map PCI memory resources after hugepages",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://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": "<http://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": "A multiple process DPDK application must mmap hugepages and pci resources into \nsame virtual addresses. By default the virtual addresses chosen by the primary \nprocess automatically when calling the mmap. But sometime the chosen virtual \naddresses isn't usable at secondary process. Such as the secondary process \nlinked with more libraries than primary process. The library has been mapped \ninto this virtual address. The command line parameter 'base-virtaddr' has been \nadded for this situation. If it's configured, the hugepages will be mapped into \nthis base address. But the virtual address of pci resources mapped still does \nnot refer to the parameter. In that case \"EAL: pci_map_resource(): cannot mmap\" \nwill be got.\n\nThis patch try to map pci resources after hugepages. So the error can be \nresolved by set base-virtaddr into free virtual address space.\n\nSigned-off-by: Liang Xu <liang.xu@cinfotech.cn>\n---\n lib/librte_eal/linuxapp/eal/eal_pci.c | 32 +++++++++++++++++++++++++++++++-\n 1 file changed, 31 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c\nindex ddb0535..502eef2 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_pci.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_pci.c\n@@ -97,14 +97,42 @@ error:\n \treturn -1;\n }\n \n+static void *\n+pci_find_max_end_va(void)\n+{\n+\tconst struct rte_memseg *seg = rte_eal_get_physmem_layout();\n+\tconst struct rte_memseg *last = seg;\n+\tunsigned i = 0;\n+\n+\tfor (i = 0; i < RTE_MAX_MEMSEG; i++, seg++) {\n+\t\tif (seg->addr == NULL)\n+\t\t\tbreak;\n+\n+\t\tif (seg->addr > last->addr)\n+\t\t\tlast = seg;\n+\n+\t}\n+\treturn RTE_PTR_ADD(last->addr, last->len);\n+}\n+\n /* map a particular resource from a file */\n void *\n pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size)\n {\n \tvoid *mapaddr;\n \n+\t/* By default the PCI memory resource will be mapped after hugepages */\n+\tstatic void *default_map_addr;\n+\tif (NULL == requested_addr) {\n+\t\tif (NULL == default_map_addr)\n+\t\t\tdefault_map_addr = pci_find_max_end_va();\n+\t\tmapaddr = default_map_addr;\n+\t} else {\n+\t    mapaddr = requested_addr;\n+\t}\n+\n \t/* Map the PCI memory resource of device */\n-\tmapaddr = mmap(requested_addr, size, PROT_READ | PROT_WRITE,\n+\tmapaddr = mmap(mapaddr, size, PROT_READ | PROT_WRITE,\n \t\t\tMAP_SHARED, fd, offset);\n \tif (mapaddr == MAP_FAILED ||\n \t\t\t(requested_addr != NULL && mapaddr != requested_addr)) {\n@@ -114,6 +142,8 @@ pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size)\n \t\t\tstrerror(errno), mapaddr);\n \t\tgoto fail;\n \t}\n+\tif (NULL == requested_addr)\n+\t\tdefault_map_addr = RTE_PTR_ADD(mapaddr, size);\n \n \tRTE_LOG(DEBUG, EAL, \"  PCI memory mapped at %p\\n\", mapaddr);\n \n",
    "prefixes": [
        "dpdk-dev"
    ]
}