get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 12731,
    "url": "http://patches.dpdk.org/api/patches/12731/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1463120192-24200-5-git-send-email-yuanhan.liu@linux.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": "<1463120192-24200-5-git-send-email-yuanhan.liu@linux.intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1463120192-24200-5-git-send-email-yuanhan.liu@linux.intel.com",
    "date": "2016-05-13T06:16:30",
    "name": "[dpdk-dev,v2,4/6] vhost: workaround stale vring base",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f925b03e01c7c85ca576049630317f6dd330bb4b",
    "submitter": {
        "id": 307,
        "url": "http://patches.dpdk.org/api/people/307/?format=api",
        "name": "Yuanhan Liu",
        "email": "yuanhan.liu@linux.intel.com"
    },
    "delegate": {
        "id": 355,
        "url": "http://patches.dpdk.org/api/users/355/?format=api",
        "username": "yliu",
        "first_name": "Yuanhan",
        "last_name": "Liu",
        "email": "yuanhan.liu@linux.intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1463120192-24200-5-git-send-email-yuanhan.liu@linux.intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/12731/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/12731/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 B2AFA95EF;\n\tFri, 13 May 2016 08:11:32 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id B916495CE\n\tfor <dev@dpdk.org>; Fri, 13 May 2016 08:11:29 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga103.fm.intel.com with ESMTP; 12 May 2016 23:11:29 -0700",
            "from yliu-dev.sh.intel.com ([10.239.67.162])\n\tby orsmga002.jf.intel.com with ESMTP; 12 May 2016 23:11:28 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.24,612,1455004800\"; d=\"scan'208\";a=\"975524159\"",
        "From": "Yuanhan Liu <yuanhan.liu@linux.intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "huawei.xie@intel.com, Traynor Kevin <kevin.traynor@intel.com>,\n\tmarcandre.lureau@redhat.com, Yuanhan Liu <yuanhan.liu@linux.intel.com>,\n\t\"Michael S. Tsirkin\" <mst@redhat.com>",
        "Date": "Thu, 12 May 2016 23:16:30 -0700",
        "Message-Id": "<1463120192-24200-5-git-send-email-yuanhan.liu@linux.intel.com>",
        "X-Mailer": "git-send-email 1.9.0",
        "In-Reply-To": "<1463120192-24200-1-git-send-email-yuanhan.liu@linux.intel.com>",
        "References": "<1462603224-29510-1-git-send-email-yuanhan.liu@linux.intel.com>\n\t<1463120192-24200-1-git-send-email-yuanhan.liu@linux.intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 4/6] vhost: workaround stale vring base",
        "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": "When DPDK app crashes (or quits, or gets killed), a restart of DPDK\napp would get stale vring base from QEMU. That would break the kernel\nvirtio net completely, making it non-work any more, unless a driver\nreset is done.\n\nSo, instead of getting the stale vring base from QEMU, Huawei suggested\nwe could get a much saner (and may not the most accurate) vring base\nfrom used->idx. That would work because:\n\n- there is a memory barrier between updating used ring entries and\n  used->idx. So, even though we crashed at updating the used ring\n  entries, it will not cause any issue, as the guest driver will not\n  process those stale used entries, for used-idx is not updated yet.\n\n- DPDK process vring in order, that means a crash may just lead some\n  packet retransmission for Tx and drop for Rx.\n\nCc: \"Michael S. Tsirkin\" <mst@redhat.com>\nSuggested-by: Huawei Xie <huawei.xie@intel.com>\nSigned-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>\nAcked-by: \"Michael S. Tsirkin\" <mst@redhat.com>\nAcked-by: Huawei Xie <huawei.xie@intel.com>\n---\n\nv2: log on packets resent for Tx and drop for Rx\n---\n lib/librte_vhost/virtio-net.c | 9 +++++++++\n 1 file changed, 9 insertions(+)",
    "diff": "diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c\nindex 835ab3a..bd7e55e 100644\n--- a/lib/librte_vhost/virtio-net.c\n+++ b/lib/librte_vhost/virtio-net.c\n@@ -561,6 +561,15 @@ vhost_set_vring_addr(int vid, struct vhost_vring_addr *addr)\n \t\treturn -1;\n \t}\n \n+\tif (vq->last_used_idx != vq->used->idx) {\n+\t\tRTE_LOG(WARNING, VHOST_CONFIG,\n+\t\t\t\"last_used_idx (%u) and vq->used->idx (%u) mismatches; \"\n+\t\t\t\"some packets maybe resent for Tx and dropped for Rx\\n\",\n+\t\t\tvq->last_used_idx, vq->used->idx);\n+\t\tvq->last_used_idx     = vq->used->idx;\n+\t\tvq->last_used_idx_res = vq->used->idx;\n+\t}\n+\n \tvq->log_guest_addr = addr->log_guest_addr;\n \n \tLOG_DEBUG(VHOST_CONFIG, \"(%d) mapped address desc: %p\\n\",\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "4/6"
    ]
}