get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1156,
    "url": "https://patches.dpdk.org/api/patches/1156/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415272471-3299-6-git-send-email-mukawa@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": "<1415272471-3299-6-git-send-email-mukawa@igel.co.jp>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1415272471-3299-6-git-send-email-mukawa@igel.co.jp",
    "date": "2014-11-06T11:14:29",
    "name": "[dpdk-dev,RFC,5/7] lib/librte_vhost: Add a vhost session abstraction",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "973e3f8149917aa7c802e022807080fff847b13b",
    "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/1415272471-3299-6-git-send-email-mukawa@igel.co.jp/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1156/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1156/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 29C337F74;\n\tThu,  6 Nov 2014 12:05:52 +0100 (CET)",
            "from mail-pd0-f178.google.com (mail-pd0-f178.google.com\n\t[209.85.192.178]) by dpdk.org (Postfix) with ESMTP id 46BFC7E80\n\tfor <dev@dpdk.org>; Thu,  6 Nov 2014 12:05:39 +0100 (CET)",
            "by mail-pd0-f178.google.com with SMTP id fp1so972691pdb.9\n\tfor <dev@dpdk.org>; Thu, 06 Nov 2014 03:15:06 -0800 (PST)",
            "from localhost.localdomain (napt.igel.co.jp. [219.106.231.132])\n\tby mx.google.com with ESMTPSA id\n\tjc3sm5652315pbb.49.2014.11.06.03.15.04 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tThu, 06 Nov 2014 03:15:05 -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:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=UB47Od72zXgoQUno0orsfcoz4N0XTAaMKAxLXVtHgp4=;\n\tb=Cq7ImXcMT6AG6aHnmt8ApDQqaFS4xjD7uinw8runM25SbE5pP0WeHAVBPMXn1NBaJs\n\tUe8QOQHzUEYZnKjAGoz9czGDbKVY9Tukjl1ebdvm70wkX7C3POrdMmKSE9JOgO2+Q322\n\tjR6hQuz8daRXo7FzCWv7YPzjrtaIAn2al4yycLyCCtZrWkczNfr+onEDFFjK9bk3pgSd\n\te9fcl2V4k86GVL1iHj7ucRdL7QGosP9gqHCQPGst53uY65p8m6l27a1qBE0xaPJS1Onc\n\tj3oxWh7GFWcjXx78s008J/a0v5Cga4jsXZwkg2EnqHtIBSSNjg0p0e979leUS1qsGamk\n\trjYw==",
        "X-Gm-Message-State": "ALoCoQn/kcvJomY5Jgu168AtF/ZsrkKDwbnBqWNMabkaHRMsgp1/ydpEDXdnPZiI5czXaJjag7Bi",
        "X-Received": "by 10.68.213.138 with SMTP id ns10mr3754095pbc.50.1415272505917; \n\tThu, 06 Nov 2014 03:15:05 -0800 (PST)",
        "From": "Tetsuya Mukawa <mukawa@igel.co.jp>",
        "To": "dev@dpdk.org",
        "Date": "Thu,  6 Nov 2014 20:14:29 +0900",
        "Message-Id": "<1415272471-3299-6-git-send-email-mukawa@igel.co.jp>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1415272471-3299-1-git-send-email-mukawa@igel.co.jp>",
        "References": "<1415272471-3299-1-git-send-email-mukawa@igel.co.jp>",
        "Cc": "nakajima.yoshihiro@lab.ntt.co.jp, masutani.hitoshi@lab.ntt.co.jp",
        "Subject": "[dpdk-dev] [RFC PATCH 5/7] lib/librte_vhost: Add a vhost session\n\tabstraction",
        "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": "Vhost session relates vhost communication layer to virtio-net\ndevice layer. Because vhost-cuse and vhost-user have different\nsession information, the patch is needed.\n\nSigned-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>\n---\n lib/librte_vhost/rte_virtio_net.h  | 2 +-\n lib/librte_vhost/vhost-net-cdev.c  | 8 ++++----\n lib/librte_vhost/vhost-net.h       | 7 ++++++-\n lib/librte_vhost/virtio-net-cdev.c | 7 ++++---\n 4 files changed, 15 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h\nindex a36c0e3..a9e20ea 100644\n--- a/lib/librte_vhost/rte_virtio_net.h\n+++ b/lib/librte_vhost/rte_virtio_net.h\n@@ -85,7 +85,7 @@ struct vhost_driver {\n \tvhost_driver_type_t\ttype;\t\t/**< driver type. */\n \tconst char\t\t*dev_name;\t/**< accessing device name. */\n \tunion {\n-\t\tstruct fuse_session *session;\t/**< fuse session. */\n+\t\tstruct fuse_session *cuse_session;\t/**< fuse session. */\n \t};\n };\n \ndiff --git a/lib/librte_vhost/vhost-net-cdev.c b/lib/librte_vhost/vhost-net-cdev.c\nindex 090c6fc..6754548 100644\n--- a/lib/librte_vhost/vhost-net-cdev.c\n+++ b/lib/librte_vhost/vhost-net-cdev.c\n@@ -67,7 +67,7 @@ fuse_req_to_vhost_ctx(fuse_req_t req, struct fuse_file_info *fi)\n \tstruct fuse_ctx const *const req_ctx = fuse_req_ctx(req);\n \n \tctx.type = VHOST_DRV_CUSE;\n-\tctx.pid = req_ctx->pid;\n+\tctx.cdev.pid = req_ctx->pid;\n \tctx.fh = fi->fh;\n \n \treturn ctx;\n@@ -345,9 +345,9 @@ vhost_cuse_driver_register(struct vhost_driver *drv)\n \n \tops = get_virtio_net_callbacks(drv->type);\n \n-\tdrv->session = cuse_lowlevel_setup(3, fuse_argv,\n+\tdrv->cuse_session = cuse_lowlevel_setup(3, fuse_argv,\n \t\t\t\t&cuse_info, &vhost_net_ops, 0, NULL);\n-\tif (drv->session == NULL)\n+\tif (drv->cuse_session == NULL)\n \t\treturn -1;\n \n \treturn 0;\n@@ -359,7 +359,7 @@ vhost_cuse_driver_register(struct vhost_driver *drv)\n static int\n vhost_cuse_driver_session_start(struct vhost_driver *drv)\n {\n-\tfuse_session_loop(drv->session);\n+\tfuse_session_loop(drv->cuse_session);\n \n \treturn 0;\n }\ndiff --git a/lib/librte_vhost/vhost-net.h b/lib/librte_vhost/vhost-net.h\nindex 64873d0..ef04832 100644\n--- a/lib/librte_vhost/vhost-net.h\n+++ b/lib/librte_vhost/vhost-net.h\n@@ -72,14 +72,19 @@\n #define PRINT_PACKET(device, addr, size, header) do {} while (0)\n #endif\n \n+struct vhost_device_cuse_ctx {\n+\tpid_t   pid;\t/* PID of process calling the IOCTL. */\n+};\n \n /*\n  * Structure used to identify device context.\n  */\n struct vhost_device_ctx {\n \tvhost_driver_type_t\ttype;\t/* driver type. */\n-\tpid_t\t\t\tpid;\t/* PID of process calling the IOCTL. */\n \tuint64_t\t\tfh;\t/* Populated with fi->fh to track the device index. */\n+\tunion {\n+\t\tstruct vhost_device_cuse_ctx cdev;\n+\t};\n };\n \n /*\ndiff --git a/lib/librte_vhost/virtio-net-cdev.c b/lib/librte_vhost/virtio-net-cdev.c\nindex 70bc578..ac97551 100644\n--- a/lib/librte_vhost/virtio-net-cdev.c\n+++ b/lib/librte_vhost/virtio-net-cdev.c\n@@ -412,7 +412,8 @@ cuse_set_mem_table(struct vhost_device_ctx ctx, const void *mem_regions_addr,\n \t\tif (mem->regions[regionidx].guest_phys_address == 0x0) {\n \t\t\tmem->base_address = mem->regions[regionidx].userspace_address;\n \t\t\t/* Map VM memory file */\n-\t\t\tif (cdev_host_memory_map(dev, mem, ctx.pid, mem->base_address) != 0) {\n+\t\t\tif (cdev_host_memory_map(dev, mem, ctx.cdev.pid,\n+\t\t\t\t\t\tmem->base_address) != 0) {\n \t\t\t\tfree(mem);\n \t\t\t\treturn -1;\n \t\t\t}\n@@ -543,7 +544,7 @@ cuse_set_vring_call(struct vhost_device_ctx ctx, struct vhost_vring_file *file)\n \tvq->kickfd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);\n \teventfd_kick.source_fd = vq->kickfd;\n \teventfd_kick.target_fd = file->fd;\n-\teventfd_kick.target_pid = ctx.pid;\n+\teventfd_kick.target_pid = ctx.cdev.pid;\n \n \tif (eventfd_copy(dev, &eventfd_kick))\n \t\treturn -1;\n@@ -577,7 +578,7 @@ cuse_set_vring_kick(struct vhost_device_ctx ctx, struct vhost_vring_file *file)\n \tvq->callfd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);\n \teventfd_call.source_fd = vq->callfd;\n \teventfd_call.target_fd = file->fd;\n-\teventfd_call.target_pid = ctx.pid;\n+\teventfd_call.target_pid = ctx.cdev.pid;\n \n \tif (eventfd_copy(dev, &eventfd_call))\n \t\treturn -1;\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "5/7"
    ]
}