get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 817375,
    "url": "http://patchwork.ozlabs.org/api/patches/817375/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1506067355-5771-4-git-send-email-jasowang@redhat.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1506067355-5771-4-git-send-email-jasowang@redhat.com>",
    "list_archive_url": null,
    "date": "2017-09-22T08:02:33",
    "name": "[net-next,RFC,3/5] vhost: introduce vhost_add_used_idx()",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "63f5a299fdf2515d0ff4fe01e21a8745c0f21ae6",
    "submitter": {
        "id": 5225,
        "url": "http://patchwork.ozlabs.org/api/people/5225/?format=api",
        "name": "Jason Wang",
        "email": "jasowang@redhat.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1506067355-5771-4-git-send-email-jasowang@redhat.com/mbox/",
    "series": [
        {
            "id": 4565,
            "url": "http://patchwork.ozlabs.org/api/series/4565/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4565",
            "date": "2017-09-22T08:02:35",
            "name": "batched tx processing in vhost_net",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/4565/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/817375/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/817375/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jasowang@redhat.com"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xz5bf2zcWz9sP1\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 22 Sep 2017 18:04:13 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751875AbdIVID7 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 22 Sep 2017 04:03:59 -0400",
            "from mx1.redhat.com ([209.132.183.28]:57206 \"EHLO mx1.redhat.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1751704AbdIVICy (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tFri, 22 Sep 2017 04:02:54 -0400",
            "from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 405DD1F57C;\n\tFri, 22 Sep 2017 08:02:54 +0000 (UTC)",
            "from jason-ThinkPad-T450s.redhat.com (ovpn-12-19.pek2.redhat.com\n\t[10.72.12.19])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id BDA926266E;\n\tFri, 22 Sep 2017 08:02:51 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 405DD1F57C",
        "From": "Jason Wang <jasowang@redhat.com>",
        "To": "mst@redhat.com, jasowang@redhat.com,\n\tvirtualization@lists.linux-foundation.org, netdev@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org",
        "Cc": "kvm@vger.kernel.org",
        "Subject": "[PATCH net-next RFC 3/5] vhost: introduce vhost_add_used_idx()",
        "Date": "Fri, 22 Sep 2017 16:02:33 +0800",
        "Message-Id": "<1506067355-5771-4-git-send-email-jasowang@redhat.com>",
        "In-Reply-To": "<1506067355-5771-1-git-send-email-jasowang@redhat.com>",
        "References": "<1506067355-5771-1-git-send-email-jasowang@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.15",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tFri, 22 Sep 2017 08:02:54 +0000 (UTC)",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "This patch introduces a helper which just increase the used idx. This\nwill be used in pair with vhost_prefetch_desc_indices() by batching\ncode.\n\nSigned-off-by: Jason Wang <jasowang@redhat.com>\n---\n drivers/vhost/vhost.c | 33 +++++++++++++++++++++++++++++++++\n drivers/vhost/vhost.h |  1 +\n 2 files changed, 34 insertions(+)",
    "diff": "diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c\nindex 8424166d..6532cda 100644\n--- a/drivers/vhost/vhost.c\n+++ b/drivers/vhost/vhost.c\n@@ -2178,6 +2178,39 @@ int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len)\n }\n EXPORT_SYMBOL_GPL(vhost_add_used);\n \n+int vhost_add_used_idx(struct vhost_virtqueue *vq, int n)\n+{\n+\tu16 old, new;\n+\n+\told = vq->last_used_idx;\n+\tnew = (vq->last_used_idx += n);\n+\t/* If the driver never bothers to signal in a very long while,\n+\t * used index might wrap around. If that happens, invalidate\n+\t * signalled_used index we stored. TODO: make sure driver\n+\t * signals at least once in 2^16 and remove this.\n+\t */\n+\tif (unlikely((u16)(new - vq->signalled_used) < (u16)(new - old)))\n+\t\tvq->signalled_used_valid = false;\n+\n+\t/* Make sure buffer is written before we update index. */\n+\tsmp_wmb();\n+\tif (vhost_put_user(vq, cpu_to_vhost16(vq, vq->last_used_idx),\n+\t\t\t   &vq->used->idx)) {\n+\t\tvq_err(vq, \"Failed to increment used idx\");\n+\t\treturn -EFAULT;\n+\t}\n+\tif (unlikely(vq->log_used)) {\n+\t\t/* Log used index update. */\n+\t\tlog_write(vq->log_base,\n+\t\t\t  vq->log_addr + offsetof(struct vring_used, idx),\n+\t\t\t  sizeof(vq->used->idx));\n+\t\tif (vq->log_ctx)\n+\t\t\teventfd_signal(vq->log_ctx, 1);\n+\t}\n+\treturn 0;\n+}\n+EXPORT_SYMBOL_GPL(vhost_add_used_idx);\n+\n static int __vhost_add_used_n(struct vhost_virtqueue *vq,\n \t\t\t    struct vring_used_elem *heads,\n \t\t\t    unsigned count)\ndiff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h\nindex 16c2cb6..5dd6c05 100644\n--- a/drivers/vhost/vhost.h\n+++ b/drivers/vhost/vhost.h\n@@ -199,6 +199,7 @@ int __vhost_get_vq_desc(struct vhost_virtqueue *vq,\n void vhost_discard_vq_desc(struct vhost_virtqueue *, int n);\n \n int vhost_vq_init_access(struct vhost_virtqueue *);\n+int vhost_add_used_idx(struct vhost_virtqueue *vq, int n);\n int vhost_add_used(struct vhost_virtqueue *, unsigned int head, int len);\n int vhost_add_used_n(struct vhost_virtqueue *, struct vring_used_elem *heads,\n \t\t     unsigned count);\n",
    "prefixes": [
        "net-next",
        "RFC",
        "3/5"
    ]
}