get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1268,
    "url": "https://patches.dpdk.org/api/patches/1268/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/54656950.1050204@igel.co.jp/",
    "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": "<54656950.1050204@igel.co.jp>",
    "list_archive_url": "https://inbox.dpdk.org/dev/54656950.1050204@igel.co.jp",
    "date": "2014-11-14T02:30:40",
    "name": "[dpdk-dev] vhost-user technical isssues",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "e9a925db93240934f34de5058eb4b658713f41fe",
    "submitter": {
        "id": 64,
        "url": "https://patches.dpdk.org/api/people/64/?format=api",
        "name": "Tetsuya Mukawa",
        "email": "mukawa@igel.co.jp"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/54656950.1050204@igel.co.jp/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1268/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1268/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 202AB7F25;\n\tFri, 14 Nov 2014 03:20:45 +0100 (CET)",
            "from mail-pa0-f48.google.com (mail-pa0-f48.google.com\n\t[209.85.220.48]) by dpdk.org (Postfix) with ESMTP id F3F5B7E75\n\tfor <dev@dpdk.org>; Fri, 14 Nov 2014 03:20:42 +0100 (CET)",
            "by mail-pa0-f48.google.com with SMTP id rd3so2950685pab.21\n\tfor <dev@dpdk.org>; Thu, 13 Nov 2014 18:30:43 -0800 (PST)",
            "from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132])\n\tby mx.google.com with ESMTPSA id\n\tql6sm18703596pbb.39.2014.11.13.18.30.41 for <multiple recipients>\n\t(version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);\n\tThu, 13 Nov 2014 18:30:42 -0800 (PST)"
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:message-id:date:from:user-agent:mime-version:to\n\t:cc:subject:references:in-reply-to:content-type\n\t:content-transfer-encoding;\n\tbh=HM0E8TO7sIlq8VXRsSVLJHDK8+aVsDCLsgiTs2KC3go=;\n\tb=IJXzBDlOilB4WB+bklzET7ZlalVkOZhV8anZVefaSxNXdtP4vGFKlrbBbgG8ItgY7S\n\tj31ANdM6RM0RAVj9de50JOz+UQzdmhz+22KHjsDdnVD/oHHLmZ92CEKGEHOb0h/bV/iY\n\tngGeOBGQY3/nMBG3UTUxSinP+V+4j1IogsEpMlTGjzJzq+xFB3YLDZog85ubSPeMaZ+6\n\t1KF5wisepUZkNTwMkdX5lk3ntq7uXrxPfWEy7fd6hVXzjHzMZp1pMx6GBkpgUCFZ0uUn\n\tVvDl5GH1Q2EfQOqgBcrx5ep6a4Pv/Aq8LIWpfL0iENcDDcOw1dkV6iRiLl3zgmP9aesq\n\tN0bg==",
        "X-Gm-Message-State": "ALoCoQln+pyr/AuTha5Npr52zpN4VDjUanAWuu693ZclfVhPeyEfXCgfGFb8lUfE4y0bx1/GuKoA",
        "X-Received": "by 10.66.124.130 with SMTP id mi2mr7084815pab.104.1415932243179; \n\tThu, 13 Nov 2014 18:30:43 -0800 (PST)",
        "Message-ID": "<54656950.1050204@igel.co.jp>",
        "Date": "Fri, 14 Nov 2014 11:30:40 +0900",
        "From": "Tetsuya Mukawa <mukawa@igel.co.jp>",
        "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64;\n\trv:24.0) Gecko/20100101 Thunderbird/24.6.0",
        "MIME-Version": "1.0",
        "To": "Linhaifeng <haifeng.lin@huawei.com>, \"Xie, Huawei\" <huawei.xie@intel.com>",
        "References": "<C37D651A908B024F974696C65296B57B0F2F19EF@SHSMSX101.ccr.corp.intel.com>\n\t<5462DE39.1070006@igel.co.jp> <54645007.3010301@huawei.com>",
        "In-Reply-To": "<54645007.3010301@huawei.com>",
        "Content-Type": "text/plain; charset=ISO-2022-JP",
        "Content-Transfer-Encoding": "7bit",
        "Cc": "\"dev@dpdk.org\" <dev@dpdk.org>",
        "Subject": "Re: [dpdk-dev] vhost-user technical isssues",
        "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 Lin,\n\n(2014/11/13 15:30), Linhaifeng wrote:\n> On 2014/11/12 12:12, Tetsuya Mukawa wrote:\n>> Hi Xie,\n>>\n>> (2014/11/12 6:37), Xie, Huawei wrote:\n>>> Hi Tetsuya:\n>>> There are two major technical issues in my mind for vhost-user implementation.\n>>>\n>>> 1) memory region map\n>>> Vhost-user passes us file fd and offset for each memory region. Unfortunately the mmap offset is \"very\" wrong. I discovered this issue long time ago, and also found\n>>> that I couldn't mmap the huge page file even with correct offset(need double check).\n>>> Just now I find that people reported this issue on Nov 3.\n>>> [Qemu-devel] [PULL 27/29] vhost-user: fix mmap offset calculation\n>>> Anyway, I turned to the same idea used in our DPDK vhost-cuse: only use the fd for region(0) to map the  whole file.\n>>> I think we should use this way temporarily to support qemu-2.1 as it has that bug.\n>> I agree with you.\n>> Also we may have an issue about un-mapping file on hugetlbfs of linux.\n>> When I check munmap(), it seems 'size' need to be aligned by hugepage size.\n>> (I guess it may be a kernel bug. Might be fixed already.)\n>> Please add return value checking code for munmap().\n>> Still munmap() might be failed.\n>>\n> are you munmmap the region 0? region 0 is not need to mmap so not need to munmap too.\n>\n> I can munmap success with the other regions.\nCould you please let me know how many size do you specify when you\nmunmap region1?\n\nI still fail to munmap region1.\nHere is a patch to vhost-user test of QEMU. Could you please check it?\n\n----------------------------------\n#define QEMU_CMD_CHR \" -chardev socket,id=chr0,path=%s\"\n#define QEMU_CMD_NETDEV \" -netdev\nvhost-user,id=net0,chardev=chr0,vhostforce\"\n@@ -221,14 +221,16 @@ static void read_guest_mem(void)\n\n/* check for sanity */\ng_assert_cmpint(fds_num, >, 0);\n- g_assert_cmpint(fds_num, ==, memory.nregions);\n+ //g_assert_cmpint(fds_num, ==, memory.nregions);\n\n+ fprintf(stderr, \"%s(%d)\\n\", __func__, __LINE__);\n/* iterate all regions */\nfor (i = 0; i < fds_num; i++) {\n+ int ret = 0;\n\n/* We'll check only the region statring at 0x0*/\nif (memory.regions[i].guest_phys_addr != 0x0) {\n- continue;\n+ //continue;\n}\n\ng_assert_cmpint(memory.regions[i].memory_size, >, 1024);\n@@ -237,6 +239,13 @@ static void read_guest_mem(void)\n\nguest_mem = mmap(0, size, PROT_READ | PROT_WRITE,\nMAP_SHARED, fds[i], 0);\n+ fprintf(stderr, \"guest_phys_addr=%lu, memory_size=%lu, \"\n+ \"userspace_addr=%lu, mmap_offset=%lu\\n\",\n+ memory.regions[i].guest_phys_addr,\n+ memory.regions[i].memory_size,\n+ memory.regions[i].userspace_addr,\n+ memory.regions[i].mmap_offset);\n+ fprintf(stderr, \"mmap=%p, size=%lu\\n\", guest_mem, size);\n\ng_assert(guest_mem != MAP_FAILED);\nguest_mem += (memory.regions[i].mmap_offset / sizeof(*guest_mem));\n@@ -248,7 +257,20 @@ static void read_guest_mem(void)\ng_assert_cmpint(a, ==, b);\n}\n\n- munmap(guest_mem, memory.regions[i].memory_size);\n+ ret = munmap(guest_mem, memory.regions[i].memory_size);\n+ fprintf(stderr, \"munmap=%p, size=%lu, ret=%d\\n\",\n+ guest_mem, memory.regions[i].memory_size, ret);\n+ {\n+ size_t hugepagesize;\n+\n+ size = memory.regions[i].memory_size;\n+ /* assume hugepage size is 1GB, try again */\n+ hugepagesize = 1024 * 1024 * 1024;\n+ size = (size + hugepagesize - 1) / hugepagesize * hugepagesize;\n+ }\n+ ret = munmap(guest_mem, size);\n+ fprintf(stderr, \"munmap=%p, size=%lu, ret=%d\\n\",\n+ guest_mem, size, ret);\n}\n\ng_assert_cmpint(1, ==, 1);\n----------------------------------\n$ sudo QTEST_HUGETLBFS_PATH=/mnt/huge make check\nregion=0, mmap=0x2aaac0000000, size=6291456000\nregion=0, munmap=0x2aab80000000, size=3070230528, ret=-1 << failed\nregion=0, munmap=0x2aab80000000, size=3221225472, ret=0\nregion=1, mmap=0x2aab80000000, size=655360\nregion=1, munmap=0x2aab80000000, size=655360, ret=-1 << failed\nregion=1, munmap=0x2aab80000000, size=1073741824, ret=0\n\n\nThanks,\nTetsuya",
    "diff": "diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c\nindex 75fedf0..4e17910 100644\n--- a/tests/vhost-user-test.c\n+++ b/tests/vhost-user-test.c\n@@ -37,7 +37,7 @@\n#endif\n\n#define QEMU_CMD_ACCEL \" -machine accel=tcg\"\n-#define QEMU_CMD_MEM \" -m 512 -object\nmemory-backend-file,id=mem,size=512M,\"\\\n+#define QEMU_CMD_MEM \" -m 6000 -object\nmemory-backend-file,id=mem,size=6000M,\"\\\n\"mem-path=%s,share=on -numa node,memdev=mem\"\n",
    "prefixes": [
        "dpdk-dev"
    ]
}