get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2507,
    "url": "https://patches.dpdk.org/api/patches/2507/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1422242440-28948-8-git-send-email-huawei.xie@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": "<1422242440-28948-8-git-send-email-huawei.xie@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1422242440-28948-8-git-send-email-huawei.xie@intel.com",
    "date": "2015-01-26T03:20:33",
    "name": "[dpdk-dev,RFC,v2,07/14] host_memory_map",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ce57270982c43f96e6005db693a5189864b67a1f",
    "submitter": {
        "id": 16,
        "url": "https://patches.dpdk.org/api/people/16/?format=api",
        "name": "Huawei Xie",
        "email": "huawei.xie@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1422242440-28948-8-git-send-email-huawei.xie@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/2507/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/2507/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 127A45AA7;\n\tMon, 26 Jan 2015 04:21:35 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id F0363CF9\n\tfor <dev@dpdk.org>; Mon, 26 Jan 2015 04:21:16 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga103.fm.intel.com with ESMTP; 25 Jan 2015 19:15:16 -0800",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby FMSMGA003.fm.intel.com with ESMTP; 25 Jan 2015 19:07:39 -0800",
            "from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com\n\t[10.239.29.90])\n\tby shvmail01.sh.intel.com with ESMTP id t0Q3LDsF014293;\n\tMon, 26 Jan 2015 11:21:13 +0800",
            "from shecgisg003.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t0Q3LACB029032; Mon, 26 Jan 2015 11:21:13 +0800",
            "(from hxie5@localhost)\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t0Q3LAls029028; \n\tMon, 26 Jan 2015 11:21:10 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"4.97,862,1389772800\"; d=\"scan'208\";a=\"445033013\"",
        "From": "Huawei Xie <huawei.xie@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon, 26 Jan 2015 11:20:33 +0800",
        "Message-Id": "<1422242440-28948-8-git-send-email-huawei.xie@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1422242440-28948-1-git-send-email-huawei.xie@intel.com>",
        "References": "<1422242440-28948-1-git-send-email-huawei.xie@intel.com>",
        "Subject": "[dpdk-dev] [RFC PATCH v2 07/14] host_memory_map",
        "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": "Signed-off-by: Huawei Xie <huawei.xie@intel.com>\n---\n lib/librte_vhost/vhost_cuse/virtio-net-cdev.c | 43 +++++++++++++--------------\n 1 file changed, 20 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/vhost_cuse/virtio-net-cdev.c b/lib/librte_vhost/vhost_cuse/virtio-net-cdev.c\nindex fbfc403..58ac3dd 100644\n--- a/lib/librte_vhost/vhost_cuse/virtio-net-cdev.c\n+++ b/lib/librte_vhost/vhost_cuse/virtio-net-cdev.c\n@@ -75,8 +75,8 @@ struct procmap {\n  * map it to our address space.\n  */\n static int\n-host_memory_map(struct virtio_net *dev, struct virtio_memory *mem,\n-\tpid_t pid, uint64_t addr)\n+host_memory_map(pid_t pid, uint64_t addr,\n+\tuint64_t *mapped_address, uint64_t *mapped_size)\n {\n \tstruct dirent *dptr = NULL;\n \tstruct procmap procmap;\n@@ -104,8 +104,8 @@ host_memory_map(struct virtio_net *dev, struct virtio_memory *mem,\n \tfmap = fopen(mapfile, \"r\");\n \tif (fmap == NULL) {\n \t\tRTE_LOG(ERR, VHOST_CONFIG,\n-\t\t\t\"(%\"PRIu64\") Failed to open maps file for pid %d\\n\",\n-\t\t\tdev->device_fh, pid);\n+\t\t\t\"Failed to open maps file for pid %d\\n\",\n+\t\t\tpid);\n \t\treturn -1;\n \t}\n \n@@ -179,8 +179,8 @@ host_memory_map(struct virtio_net *dev, struct virtio_memory *mem,\n \n \tif (!found) {\n \t\tRTE_LOG(ERR, VHOST_CONFIG,\n-\t\t\t\"(%\"PRIu64\") Failed to find memory file in pid %d maps file\\n\",\n-\t\t\tdev->device_fh, pid);\n+\t\t\t\"Failed to find memory file in pid %d maps file\\n\",\n+\t\t\tpid);\n \t\treturn -1;\n \t}\n \n@@ -188,8 +188,8 @@ host_memory_map(struct virtio_net *dev, struct virtio_memory *mem,\n \tdp = opendir(procdir);\n \tif (dp == NULL) {\n \t\tRTE_LOG(ERR, VHOST_CONFIG,\n-\t\t\t\"(%\"PRIu64\") Cannot open pid %d process directory\\n\",\n-\t\t\tdev->device_fh, pid);\n+\t\t\t\"Cannot open pid %d process directory\\n\",\n+\t\t\tpid);\n \t\treturn -1;\n \t}\n \n@@ -202,8 +202,7 @@ host_memory_map(struct virtio_net *dev, struct virtio_memory *mem,\n \t\tpath = realpath(memfile, resolved_path);\n \t\tif ((path == NULL) && (strlen(resolved_path) == 0)) {\n \t\t\tRTE_LOG(ERR, VHOST_CONFIG,\n-\t\t\t\t\"(%\"PRIu64\") Failed to resolve fd directory\\n\",\n-\t\t\t\tdev->device_fh);\n+\t\t\t\t\"Failed to resolve fd directory\\n\");\n \t\t\tclosedir(dp);\n \t\t\treturn -1;\n \t\t}\n@@ -218,8 +217,8 @@ host_memory_map(struct virtio_net *dev, struct virtio_memory *mem,\n \n \tif (found == 0) {\n \t\tRTE_LOG(ERR, VHOST_CONFIG,\n-\t\t\t\"(%\"PRIu64\") Failed to find memory file for pid %d\\n\",\n-\t\t\tdev->device_fh, pid);\n+\t\t\t\"Failed to find memory file for pid %d\\n\",\n+\t\t\tpid);\n \t\treturn -1;\n \t}\n \t/* Open the shared memory file and map the memory into this process. */\n@@ -227,32 +226,30 @@ host_memory_map(struct virtio_net *dev, struct virtio_memory *mem,\n \n \tif (fd == -1) {\n \t\tRTE_LOG(ERR, VHOST_CONFIG,\n-\t\t\t\"(%\"PRIu64\") Failed to open %s for pid %d\\n\",\n-\t\t\tdev->device_fh, memfile, pid);\n+\t\t\t\"Failed to open %s for pid %d\\n\",\n+\t\t\tmemfile, pid);\n \t\treturn -1;\n \t}\n \n \tmap = mmap(0, (size_t)procmap.len, PROT_READ|PROT_WRITE,\n-\t\tMAP_POPULATE|MAP_SHARED, fd, 0);\n+\t\t\tMAP_POPULATE|MAP_SHARED, fd, 0);\n \tclose(fd);\n \n \tif (map == MAP_FAILED) {\n \t\tRTE_LOG(ERR, VHOST_CONFIG,\n-\t\t\t\"(%\"PRIu64\") Error mapping the file %s for pid %d\\n\",\n-\t\t\tdev->device_fh, memfile, pid);\n+\t\t\t\"Error mapping the file %s for pid %d\\n\",\n+\t\t\tmemfile, pid);\n \t\treturn -1;\n \t}\n \n \t/* Store the memory address and size in the device data structure */\n-\tmem->mapped_address = (uint64_t)(uintptr_t)map;\n-\tmem->mapped_size = procmap.len;\n+\t*mapped_address = (uint64_t)(uintptr_t)map;\n+\t*mapped_size = procmap.len;\n \n \tLOG_DEBUG(VHOST_CONFIG,\n-\t\t\"(%\"PRIu64\") Mem File: %s->%s - Size: %llu - VA: %p\\n\",\n-\t\tdev->device_fh,\n+\t\t\"Mem File: %s->%s - Size: %llu - VA: %p\\n\",\n \t\tmemfile, resolved_path,\n-\t\t(unsigned long long)mem->mapped_size, map);\n+\t\t(unsigned long long)*mapped_size, map);\n \n \treturn 0;\n }\n-\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "v2",
        "07/14"
    ]
}