get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1230,
    "url": "https://patches.dpdk.org/api/patches/1230/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/C6ECDF3AB251BE4894318F4E4512369780C07DC0@IRSMSX109.ger.corp.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": "<C6ECDF3AB251BE4894318F4E4512369780C07DC0@IRSMSX109.ger.corp.intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/C6ECDF3AB251BE4894318F4E4512369780C07DC0@IRSMSX109.ger.corp.intel.com",
    "date": "2014-11-10T09:53:22",
    "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": 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/C6ECDF3AB251BE4894318F4E4512369780C07DC0@IRSMSX109.ger.corp.intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1230/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1230/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 D5C5D7F2C;\n\tMon, 10 Nov 2014 10:44:26 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 0F1117E8E\n\tfor <dev@dpdk.org>; Mon, 10 Nov 2014 10:44:23 +0100 (CET)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga101.jf.intel.com with ESMTP; 10 Nov 2014 01:54:06 -0800",
            "from irsmsx102.ger.corp.intel.com ([163.33.3.155])\n\tby orsmga001.jf.intel.com with ESMTP; 10 Nov 2014 01:53:58 -0800",
            "from irsmsx153.ger.corp.intel.com (163.33.192.75) by\n\tIRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP\n\tServer (TLS) id 14.3.195.1; Mon, 10 Nov 2014 09:53:23 +0000",
            "from irsmsx109.ger.corp.intel.com ([169.254.13.101]) by\n\tIRSMSX153.ger.corp.intel.com ([169.254.9.23]) with mapi id\n\t14.03.0195.001; Mon, 10 Nov 2014 09:53:23 +0000"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.07,351,1413270000\"; d=\"scan'208\";a=\"605210142\"",
        "From": "\"Burakov, Anatoly\" <anatoly.burakov@intel.com>",
        "To": "Liang Xu <liang.xu@cinfotech.cn>, \"dev@dpdk.org\" <dev@dpdk.org>",
        "Thread-Topic": "[PATCH] eal: map PCI memory resources after hugepages",
        "Thread-Index": "AQHP+wSiEAb9hfd8fkOi8Y61mgTq6JxZoD9Q",
        "Date": "Mon, 10 Nov 2014 09:53:22 +0000",
        "Message-ID": "<C6ECDF3AB251BE4894318F4E4512369780C07DC0@IRSMSX109.ger.corp.intel.com>",
        "References": "<1415417532-4363-1-git-send-email-liang.xu@cinfotech.cn>",
        "In-Reply-To": "<1415417532-4363-1-git-send-email-liang.xu@cinfotech.cn>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "x-originating-ip": "[163.33.239.181]",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "Subject": "Re: [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": "Hi 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"
    ]
}