get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 16675,
    "url": "https://patches.dpdk.org/api/patches/16675/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1476804939-8675-2-git-send-email-maxime.coquelin@redhat.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": "<1476804939-8675-2-git-send-email-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1476804939-8675-2-git-send-email-maxime.coquelin@redhat.com",
    "date": "2016-10-18T15:35:38",
    "name": "[dpdk-dev,1/2] vhost: Add indirect desc support to Rx mergeable path",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "84c6c59483579bb69213037cb0689941f0e127d2",
    "submitter": {
        "id": 512,
        "url": "https://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "delegate": {
        "id": 355,
        "url": "https://patches.dpdk.org/api/users/355/?format=api",
        "username": "yliu",
        "first_name": "Yuanhan",
        "last_name": "Liu",
        "email": "yuanhan.liu@linux.intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1476804939-8675-2-git-send-email-maxime.coquelin@redhat.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/16675/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/16675/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 1DEAC68CF;\n\tTue, 18 Oct 2016 17:35:55 +0200 (CEST)",
            "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id CD6645A33\n\tfor <dev@dpdk.org>; Tue, 18 Oct 2016 17:35:50 +0200 (CEST)",
            "from int-mx14.intmail.prod.int.phx2.redhat.com\n\t(int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 1B9FC4A54B;\n\tTue, 18 Oct 2016 15:35:50 +0000 (UTC)",
            "from max-t460s.redhat.com (vpn1-7-65.ams2.redhat.com [10.36.7.65])\n\tby int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with\n\tESMTP id u9IFZjgw019282; Tue, 18 Oct 2016 11:35:48 -0400"
        ],
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "yuanhan.liu@linux.intel.com, dev@dpdk.org, mst@redhat.com",
        "Cc": "zhihong.wang@intel.com, ciara.loftus@intel.com,\n\tMaxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Tue, 18 Oct 2016 17:35:38 +0200",
        "Message-Id": "<1476804939-8675-2-git-send-email-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<1476804939-8675-1-git-send-email-maxime.coquelin@redhat.com>",
        "References": "<1476804939-8675-1-git-send-email-maxime.coquelin@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.68 on 10.5.11.27",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]); Tue, 18 Oct 2016 15:35:50 +0000 (UTC)",
        "Subject": "[dpdk-dev] [PATCH 1/2] vhost: Add indirect desc support to Rx\n\tmergeable path",
        "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": "Windows virtio-net driver uses indirect descriptors with\nmergeable buffers.\n\nThis patch adds its support, fixing the use of indirect\ndescriptors with these guests.\n\nCc: Yuanhan Liu <yuanhan.liu@linux.intel.com>\nCc: Zhihong Wang <zhihong.wang@intel.com>\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/librte_vhost/virtio_net.c | 43 ++++++++++++++++++++++++++++---------------\n 1 file changed, 28 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex b784dba..0941186 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -351,29 +351,41 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,\n }\n \n static inline int __attribute__((always_inline))\n-fill_vec_buf(struct vhost_virtqueue *vq, uint32_t avail_idx,\n-\t     uint32_t *vec_idx, struct buf_vector *buf_vec,\n-\t     uint16_t *desc_chain_head, uint16_t *desc_chain_len)\n+fill_vec_buf(struct virtio_net *dev, struct vhost_virtqueue *vq,\n+\t\t\t uint32_t avail_idx, uint32_t *vec_idx,\n+\t\t\t struct buf_vector *buf_vec, uint16_t *desc_chain_head,\n+\t\t\t uint16_t *desc_chain_len)\n {\n \tuint16_t idx = vq->avail->ring[avail_idx & (vq->size - 1)];\n \tuint32_t vec_id = *vec_idx;\n \tuint32_t len    = 0;\n+\tstruct vring_desc *descs = vq->desc;\n \n \t*desc_chain_head = idx;\n+\n+\tif (vq->desc[idx].flags & VRING_DESC_F_INDIRECT) {\n+\t\tdescs = (struct vring_desc *)(uintptr_t)\n+\t\t\t\t\tgpa_to_vva(dev, vq->desc[idx].addr);\n+\t\tif (unlikely(!descs))\n+\t\t\treturn -1;\n+\n+\t\tidx = 0;\n+\t}\n+\n \twhile (1) {\n \t\tif (unlikely(vec_id >= BUF_VECTOR_MAX || idx >= vq->size))\n \t\t\treturn -1;\n \n-\t\tlen += vq->desc[idx].len;\n-\t\tbuf_vec[vec_id].buf_addr = vq->desc[idx].addr;\n-\t\tbuf_vec[vec_id].buf_len  = vq->desc[idx].len;\n+\t\tlen += descs[idx].len;\n+\t\tbuf_vec[vec_id].buf_addr = descs[idx].addr;\n+\t\tbuf_vec[vec_id].buf_len  = descs[idx].len;\n \t\tbuf_vec[vec_id].desc_idx = idx;\n \t\tvec_id++;\n \n-\t\tif ((vq->desc[idx].flags & VRING_DESC_F_NEXT) == 0)\n+\t\tif ((descs[idx].flags & VRING_DESC_F_NEXT) == 0)\n \t\t\tbreak;\n \n-\t\tidx = vq->desc[idx].next;\n+\t\tidx = descs[idx].next;\n \t}\n \n \t*desc_chain_len = len;\n@@ -386,9 +398,9 @@ fill_vec_buf(struct vhost_virtqueue *vq, uint32_t avail_idx,\n  * Returns -1 on fail, 0 on success\n  */\n static inline int\n-reserve_avail_buf_mergeable(struct vhost_virtqueue *vq, uint32_t size,\n-\t\t\t    struct buf_vector *buf_vec, uint16_t *num_buffers,\n-\t\t\t    uint16_t avail_head)\n+reserve_avail_buf_mergeable(struct virtio_net *dev, struct vhost_virtqueue *vq,\n+\t\t\t\tuint32_t size, struct buf_vector *buf_vec,\n+\t\t\t\tuint16_t *num_buffers, uint16_t avail_head)\n {\n \tuint16_t cur_idx;\n \tuint32_t vec_idx = 0;\n@@ -404,8 +416,8 @@ reserve_avail_buf_mergeable(struct vhost_virtqueue *vq, uint32_t size,\n \t\tif (unlikely(cur_idx == avail_head))\n \t\t\treturn -1;\n \n-\t\tif (unlikely(fill_vec_buf(vq, cur_idx, &vec_idx, buf_vec,\n-\t\t\t\t\t  &head_idx, &len) < 0))\n+\t\tif (unlikely(fill_vec_buf(dev, vq, cur_idx, &vec_idx, buf_vec,\n+\t\t\t\t\t\t&head_idx, &len) < 0))\n \t\t\treturn -1;\n \t\tlen = RTE_MIN(len, size);\n \t\tupdate_shadow_used_ring(vq, head_idx, len);\n@@ -546,8 +558,9 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id,\n \tfor (pkt_idx = 0; pkt_idx < count; pkt_idx++) {\n \t\tuint32_t pkt_len = pkts[pkt_idx]->pkt_len + dev->vhost_hlen;\n \n-\t\tif (unlikely(reserve_avail_buf_mergeable(vq, pkt_len, buf_vec,\n-\t\t\t\t\t&num_buffers, avail_head) < 0)) {\n+\t\tif (unlikely(reserve_avail_buf_mergeable(dev, vq,\n+\t\t\t\t\t\tpkt_len, buf_vec, &num_buffers,\n+\t\t\t\t\t\tavail_head) < 0)) {\n \t\t\tLOG_DEBUG(VHOST_DATA,\n \t\t\t\t\"(%d) failed to get enough desc from vring\\n\",\n \t\t\t\tdev->vid);\n",
    "prefixes": [
        "dpdk-dev",
        "1/2"
    ]
}