get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1232,
    "url": "https://patches.dpdk.org/api/patches/1232/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/0940c02e-7bf7-4019-b400-1bd377bc667d@cinfotech.cn/",
    "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": "<0940c02e-7bf7-4019-b400-1bd377bc667d@cinfotech.cn>",
    "list_archive_url": "https://inbox.dpdk.org/dev/0940c02e-7bf7-4019-b400-1bd377bc667d@cinfotech.cn",
    "date": "2014-11-10T10:04:31",
    "name": "[dpdk-dev] eal: map PCI memory resources after hugepages",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "2bbecaf7665423ba7cdaaed5c7c566e45d0db807",
    "submitter": {
        "id": 106,
        "url": "https://patches.dpdk.org/api/people/106/?format=api",
        "name": "lxu",
        "email": "liang.xu@cinfotech.cn"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/0940c02e-7bf7-4019-b400-1bd377bc667d@cinfotech.cn/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1232/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1232/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 A61156828;\n\tMon, 10 Nov 2014 10:54:55 +0100 (CET)",
            "from out1134-185.mail.aliyun.com (out1134-185.mail.aliyun.com\n\t[42.120.134.185]) by dpdk.org (Postfix) with ESMTP id C72A62E89\n\tfor <dev@dpdk.org>; Mon, 10 Nov 2014 10:54:51 +0100 (CET)",
            "from WS-web (liang.xu@cinfotech.cn[203.110.175.218]) by\n\tr41g06012.xy2.aliyun.com at Mon, 10 Nov 2014 18:04:31 +0800"
        ],
        "X-Alimail-AntiSpam": "AC=CONTINUE; BC=0.0435036|-1; FP=0|0|0|0|0|-1|-1|-1;\n\tHT=r46d02009; MF=liang.xu@cinfotech.cn; PH=DW; RN=3; RT=3; SR=0; ",
        "Date": "Mon, 10 Nov 2014 18:04:31 +0800",
        "From": "\"XU Liang\" <liang.xu@cinfotech.cn>",
        "To": "\"=?UTF-8?B?QnVyYWtvdiwgQW5hdG9seQ==?=\" <anatoly.burakov@intel.com>,\n\t\"dev@dpdk.org\" <dev@dpdk.org>",
        "Message-ID": "<0940c02e-7bf7-4019-b400-1bd377bc667d@cinfotech.cn>",
        "X-Mailer": "Alimail-Mailagent revision 2667797",
        "MIME-Version": "1.0",
        "References": "<1415417532-4363-1-git-send-email-liang.xu@cinfotech.cn>,\n\tC6ECDF3AB251BE4894318F4E4512369780C07DC0@IRSMSX109.ger.corp.intel.com,\n\tdd048730-152d-4922-9edc-985aa3a6a885@cinfotech.cn",
        "In-Reply-To": "dd048730-152d-4922-9edc-985aa3a6a885@cinfotech.cn",
        "x-aliyun-mail-creator": "Webmail4_2670074_M3LTW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTBfMTBfMSkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzM4LjAuMjEyNS4xMTEgU2FmYXJpLzUzNy4zNg==vN",
        "Content-Type": "text/plain; charset=\"UTF-8\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "X-Content-Filtered-By": "Mailman/MimeDel 2.1.15",
        "Subject": "Re: [dpdk-dev]\n\t=?utf-8?q?=5BPATCH=5D_eal=3A_map_PCI_memory_resources_?=\n\t=?utf-8?q?after_hugepages?=",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "Reply-To": "XU Liang <liang.xu@cinfotech.cn>",
        "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": "Of course you can take this job. Thanks you for your help.------------------------------------------------------------------From:徐亮 <liang.xu@cinfotech.cn>Time:2014 Nov 10 (Mon) 18 : 01To:Burakov, Anatoly <anatoly.burakov@intel.com>, dev@dpdk.org <dev@dpdk.org>Cc:thomas.monjalon@6wind.com <thomas.monjalon@6wind.com>Subject:Re: [PATCH] eal: map PCI memory resources after hugepages\nIt is a default value when the requested_addr isn't exist, not an overide. When the pci_map_resource is called at the primary process, the requested_addr is NULL. The default value will be provided by default_map_addr.\nWhen the pci_map_resource is called at the secondery process, the requested_addr is exist. Then everything isn't be changed.------------------------------------------------------------------From:Burakov, Anatoly <anatoly.burakov@intel.com>Time:2014 Nov 10 (Mon) 17 : 54To:徐亮 <liang.xu@cinfotech.cn>, dev@dpdk.org <dev@dpdk.org>Cc:thomas.monjalon@6wind.com <thomas.monjalon@6wind.com>Subject:RE: [PATCH] eal: map PCI memory resources after hugepages\nHi Liang\n\nI don't think that overriding the value passed to pci_map_resource as argument is the way to go. While it results in less code, it looks weird, in my opinion at least, as I believe tracking the correctness of address being requested should be the responsibility of the caller, i.e. either UIO or VFIO code. Which is why I keep insisting that you make requested_pci_addr global to linuxapp EAL PCI section and put it into include/eal_pci_init.h. Would you mind if I made a patch for this issue based on your code?\n\nThanks,\nAnatoly\n\n-----Original Message-----\nFrom: Liang Xu [mailto:liang.xu@cinfotech.cn] \nSent: Saturday, November 8, 2014 3:32 AM\nTo: dev@dpdk.org\nCc: Burakov, Anatoly; thomas.monjalon@6wind.com\nSubject: [PATCH] eal: map PCI memory resources after hugepages\n\nA multiple process DPDK application must mmap hugepages and pci resources into same virtual addresses. By default the virtual addresses chosen by the primary process automatically when calling the mmap. But sometime the chosen virtual addresses isn't usable at secondary process. Such as the secondary process linked with more libraries than primary process. The library has been mapped into this virtual address. The command line parameter 'base-virtaddr' has been added for this situation. If it's configured, the hugepages will be mapped into this base address. But the virtual address of pci resources mapped still does not 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 resolved 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(-)\n\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--\n1.9.1",
    "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 /* map a particular resource from a file */  void *  pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size)  {\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)) { @@ -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",
    "prefixes": [
        "dpdk-dev"
    ]
}