get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 25527,
    "url": "http://patches.dpdk.org/api/patches/25527/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1498013885-102779-21-git-send-email-tiwei.bie@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": "<1498013885-102779-21-git-send-email-tiwei.bie@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1498013885-102779-21-git-send-email-tiwei.bie@intel.com",
    "date": "2017-06-21T02:57:56",
    "name": "[dpdk-dev,RFC,20/29] vhost: fix vring addr setup",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "8d8a53f12f6fcc6c836cc3d3044d1117ff0d23f6",
    "submitter": {
        "id": 617,
        "url": "http://patches.dpdk.org/api/people/617/?format=api",
        "name": "Tiwei Bie",
        "email": "tiwei.bie@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1498013885-102779-21-git-send-email-tiwei.bie@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/25527/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/25527/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 5FBC758F6;\n\tWed, 21 Jun 2017 05:00:24 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id 97AF25323\n\tfor <dev@dpdk.org>; Wed, 21 Jun 2017 04:59:41 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga105.jf.intel.com with ESMTP; 20 Jun 2017 19:59:41 -0700",
            "from dpdk25.sh.intel.com ([10.67.111.75])\n\tby orsmga002.jf.intel.com with ESMTP; 20 Jun 2017 19:59:40 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.39,367,1493708400\"; d=\"scan'208\";a=\"101830330\"",
        "From": "Tiwei Bie <tiwei.bie@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Wed, 21 Jun 2017 10:57:56 +0800",
        "Message-Id": "<1498013885-102779-21-git-send-email-tiwei.bie@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1498013885-102779-1-git-send-email-tiwei.bie@intel.com>",
        "References": "<1498013885-102779-1-git-send-email-tiwei.bie@intel.com>",
        "Subject": "[dpdk-dev] [RFC 20/29] vhost: fix vring addr setup",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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: Tiwei Bie <tiwei.bie@intel.com>\n---\n lib/librte_vhost/vhost.c      |  4 ++++\n lib/librte_vhost/vhost_user.c | 17 +++++++++++++++--\n 2 files changed, 19 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c\nindex 19c5a43..b7bc1ee 100644\n--- a/lib/librte_vhost/vhost.c\n+++ b/lib/librte_vhost/vhost.c\n@@ -441,6 +441,10 @@ rte_vhost_enable_guest_notification(int vid, uint16_t queue_id, int enable)\n \t\treturn -1;\n \t}\n \n+\tif (dev->features & (1ULL << VIRTIO_F_VERSION_1_1)) {\n+\t\treturn 0;\n+\t}\n+\n \tdev->virtqueue[queue_id]->used->flags = VRING_USED_F_NO_NOTIFY;\n \treturn 0;\n }\ndiff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c\nindex 3a2de79..9265dcb 100644\n--- a/lib/librte_vhost/vhost_user.c\n+++ b/lib/librte_vhost/vhost_user.c\n@@ -342,6 +342,19 @@ vhost_user_set_vring_addr(struct virtio_net *dev, VhostUserMsg *msg)\n \t/* addr->index refers to the queue index. The txq 1, rxq is 0. */\n \tvq = dev->virtqueue[msg->payload.addr.index];\n \n+\tif (dev->features & (1ULL << VIRTIO_F_VERSION_1_1)) {\n+\t\tvq->desc_1_1 = (struct vring_desc_1_1 *)(uintptr_t)qva_to_vva\n+\t\t\t\t\t(dev, msg->payload.addr.desc_user_addr);\n+\t\tvq->desc = NULL;\n+\t\tvq->avail = NULL;\n+\t\tvq->used = NULL;\n+\t\tvq->log_guest_addr = 0;\n+\n+\t\tassert(vq->last_used_idx == 0);\n+\n+\t\treturn 0;\n+\t}\n+\n \t/* The addresses are converted from QEMU virtual to Vhost virtual. */\n \tvq->desc = (struct vring_desc *)(uintptr_t)qva_to_vva(dev,\n \t\t\tmsg->payload.addr.desc_user_addr);\n@@ -351,7 +364,7 @@ vhost_user_set_vring_addr(struct virtio_net *dev, VhostUserMsg *msg)\n \t\t\tdev->vid);\n \t\treturn -1;\n \t}\n-\tvq->desc_1_1 = (struct vring_desc_1_1 *)vq->desc;\n+\tvq->desc_1_1 = NULL;\n \n \tdev = numa_realloc(dev, msg->payload.addr.index);\n \tvq = dev->virtqueue[msg->payload.addr.index];\n@@ -617,7 +630,7 @@ vhost_user_set_mem_table(struct virtio_net *dev, struct VhostUserMsg *pmsg)\n static int\n vq_is_ready(struct vhost_virtqueue *vq)\n {\n-\treturn vq && vq->desc   &&\n+\treturn vq && (vq->desc || vq->desc_1_1) &&\n \t       vq->kickfd != VIRTIO_UNINITIALIZED_EVENTFD &&\n \t       vq->callfd != VIRTIO_UNINITIALIZED_EVENTFD;\n }\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "20/29"
    ]
}