get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8321,
    "url": "http://patches.dpdk.org/api/patches/8321/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1446162713-130100-1-git-send-email-jianfeng.tan@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": "<1446162713-130100-1-git-send-email-jianfeng.tan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446162713-130100-1-git-send-email-jianfeng.tan@intel.com",
    "date": "2015-10-29T23:51:53",
    "name": "[dpdk-dev] vhost: fix mmap failure as len not aligned with hugepage size",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "a0153ee14a660925f6175d25dcfd898f1dbe18db",
    "submitter": {
        "id": 313,
        "url": "http://patches.dpdk.org/api/people/313/?format=api",
        "name": "Jianfeng Tan",
        "email": "jianfeng.tan@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1446162713-130100-1-git-send-email-jianfeng.tan@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/8321/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/8321/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 502BD5957;\n\tFri, 30 Oct 2015 07:52:11 +0100 (CET)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 26DE53F9\n\tfor <dev@dpdk.org>; Fri, 30 Oct 2015 07:52:08 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 29 Oct 2015 23:52:06 -0700",
            "from tan-s2600cw.sh.intel.com ([10.239.128.225])\n\tby orsmga002.jf.intel.com with ESMTP; 29 Oct 2015 23:52:04 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,217,1444719600\"; d=\"scan'208\";a=\"838629202\"",
        "From": "Jianfeng Tan <jianfeng.tan@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 30 Oct 2015 07:51:53 +0800",
        "Message-Id": "<1446162713-130100-1-git-send-email-jianfeng.tan@intel.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "Subject": "[dpdk-dev] [PATCH] vhost: fix mmap failure as len not aligned with\n\thugepage size",
        "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": "This patch fixes a bug under lower version linux kernel, mmap() fails when\nlength is not aligned with hugepage size.\n\nSigned-off-by: Jianfeng Tan <jianfeng.tan@intel.com>\n---\n lib/librte_vhost/vhost_user/virtio-net-user.c | 12 +++++++++---\n 1 file changed, 9 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/vhost_user/virtio-net-user.c b/lib/librte_vhost/vhost_user/virtio-net-user.c\nindex a998ad8..641561c 100644\n--- a/lib/librte_vhost/vhost_user/virtio-net-user.c\n+++ b/lib/librte_vhost/vhost_user/virtio-net-user.c\n@@ -147,6 +147,10 @@ user_set_mem_table(struct vhost_device_ctx ctx, struct VhostUserMsg *pmsg)\n \t\t/* This is ugly */\n \t\tmapped_size = memory.regions[idx].memory_size +\n \t\t\tmemory.regions[idx].mmap_offset;\n+\n+\t\talignment = get_blk_size(pmsg->fds[idx]);\n+\t\tmapped_size = RTE_ALIGN_CEIL(mapped_size, alignment);\n+\n \t\tmapped_address = (uint64_t)(uintptr_t)mmap(NULL,\n \t\t\tmapped_size,\n \t\t\tPROT_READ | PROT_WRITE, MAP_SHARED,\n@@ -154,9 +158,11 @@ user_set_mem_table(struct vhost_device_ctx ctx, struct VhostUserMsg *pmsg)\n \t\t\t0);\n \n \t\tRTE_LOG(INFO, VHOST_CONFIG,\n-\t\t\t\"mapped region %d fd:%d to %p sz:0x%\"PRIx64\" off:0x%\"PRIx64\"\\n\",\n+\t\t\t\"mapped region %d fd:%d to:%p sz:0x%\"PRIx64\" \"\n+\t\t\t\"off:0x%\"PRIx64\" align:0x%\"PRIx64\"\\n\",\n \t\t\tidx, pmsg->fds[idx], (void *)(uintptr_t)mapped_address,\n-\t\t\tmapped_size, memory.regions[idx].mmap_offset);\n+\t\t\tmapped_size, memory.regions[idx].mmap_offset,\n+\t\t\talignment);\n \n \t\tif (mapped_address == (uint64_t)(uintptr_t)MAP_FAILED) {\n \t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n@@ -166,7 +172,7 @@ user_set_mem_table(struct vhost_device_ctx ctx, struct VhostUserMsg *pmsg)\n \n \t\tpregion_orig[idx].mapped_address = mapped_address;\n \t\tpregion_orig[idx].mapped_size = mapped_size;\n-\t\tpregion_orig[idx].blksz = get_blk_size(pmsg->fds[idx]);\n+\t\tpregion_orig[idx].blksz = alignment;\n \t\tpregion_orig[idx].fd = pmsg->fds[idx];\n \n \t\tmapped_address +=  memory.regions[idx].mmap_offset;\n",
    "prefixes": [
        "dpdk-dev"
    ]
}