get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 61840,
    "url": "http://patches.dpdk.org/api/patches/61840/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191024160832.14543-2-yong.liu@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": "<20191024160832.14543-2-yong.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191024160832.14543-2-yong.liu@intel.com",
    "date": "2019-10-24T16:08:20",
    "name": "[v9,01/13] vhost: add packed ring indexes increasing function",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "7cfd47eb9d72c8df7e04d221d509b49d88a6e623",
    "submitter": {
        "id": 17,
        "url": "http://patches.dpdk.org/api/people/17/?format=api",
        "name": "Marvin Liu",
        "email": "yong.liu@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191024160832.14543-2-yong.liu@intel.com/mbox/",
    "series": [
        {
            "id": 7033,
            "url": "http://patches.dpdk.org/api/series/7033/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7033",
            "date": "2019-10-24T16:08:19",
            "name": "vhost packed ring performance optimization",
            "version": 9,
            "mbox": "http://patches.dpdk.org/series/7033/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/61840/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/61840/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 520D61E54B;\n\tThu, 24 Oct 2019 10:28:44 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id 39A5F1E535\n\tfor <dev@dpdk.org>; Thu, 24 Oct 2019 10:28:40 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t24 Oct 2019 01:28:38 -0700",
            "from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.142])\n\tby fmsmga002.fm.intel.com with ESMTP; 24 Oct 2019 01:28:36 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.68,224,1569308400\"; d=\"scan'208\";a=\"228431057\"",
        "From": "Marvin Liu <yong.liu@intel.com>",
        "To": "maxime.coquelin@redhat.com, tiwei.bie@intel.com, zhihong.wang@intel.com, \n\tstephen@networkplumber.org, gavin.hu@arm.com",
        "Cc": "dev@dpdk.org,\n\tMarvin Liu <yong.liu@intel.com>",
        "Date": "Fri, 25 Oct 2019 00:08:20 +0800",
        "Message-Id": "<20191024160832.14543-2-yong.liu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191024160832.14543-1-yong.liu@intel.com>",
        "References": "<20191021220813.55236-1-yong.liu@intel.com>\n\t<20191024160832.14543-1-yong.liu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v9 01/13] vhost: add packed ring indexes\n\tincreasing function",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/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 enqueuing or dequeuing, the virtqueue's local available and used\nindexes are increased.\n\nSigned-off-by: Marvin Liu <yong.liu@intel.com>\nReviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/librte_vhost/vhost.h      | 20 ++++++++++++++++++++\n lib/librte_vhost/virtio_net.c | 18 +++---------------\n 2 files changed, 23 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex c76d40115..02b3c91ff 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -367,6 +367,26 @@ desc_is_avail(struct vring_packed_desc *desc, bool wrap_counter)\n \t\twrap_counter != !!(flags & VRING_DESC_F_USED);\n }\n \n+static inline void\n+vq_inc_last_used_packed(struct vhost_virtqueue *vq, uint16_t num)\n+{\n+\tvq->last_used_idx += num;\n+\tif (vq->last_used_idx >= vq->size) {\n+\t\tvq->used_wrap_counter ^= 1;\n+\t\tvq->last_used_idx -= vq->size;\n+\t}\n+}\n+\n+static inline void\n+vq_inc_last_avail_packed(struct vhost_virtqueue *vq, uint16_t num)\n+{\n+\tvq->last_avail_idx += num;\n+\tif (vq->last_avail_idx >= vq->size) {\n+\t\tvq->avail_wrap_counter ^= 1;\n+\t\tvq->last_avail_idx -= vq->size;\n+\t}\n+}\n+\n void __vhost_log_cache_write(struct virtio_net *dev,\n \t\tstruct vhost_virtqueue *vq,\n \t\tuint64_t addr, uint64_t len);\ndiff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex 66f0c7206..070d62bc0 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -138,11 +138,7 @@ flush_shadow_used_ring_packed(struct virtio_net *dev,\n \t\t\thead_flags = flags;\n \t\t}\n \n-\t\tvq->last_used_idx += vq->shadow_used_packed[i].count;\n-\t\tif (vq->last_used_idx >= vq->size) {\n-\t\t\tvq->used_wrap_counter ^= 1;\n-\t\t\tvq->last_used_idx -= vq->size;\n-\t\t}\n+\t\tvq_inc_last_used_packed(vq, vq->shadow_used_packed[i].count);\n \t}\n \n \t__atomic_store_n(&vq->desc_packed[head_idx].flags, head_flags,\n@@ -865,11 +861,7 @@ virtio_dev_rx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\tbreak;\n \t\t}\n \n-\t\tvq->last_avail_idx += nr_descs;\n-\t\tif (vq->last_avail_idx >= vq->size) {\n-\t\t\tvq->last_avail_idx -= vq->size;\n-\t\t\tvq->avail_wrap_counter ^= 1;\n-\t\t}\n+\t\tvq_inc_last_avail_packed(vq, nr_descs);\n \t}\n \n \tdo_data_copy_enqueue(dev, vq);\n@@ -1585,11 +1577,7 @@ virtio_dev_tx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\tTAILQ_INSERT_TAIL(&vq->zmbuf_list, zmbuf, next);\n \t\t}\n \n-\t\tvq->last_avail_idx += desc_count;\n-\t\tif (vq->last_avail_idx >= vq->size) {\n-\t\t\tvq->last_avail_idx -= vq->size;\n-\t\t\tvq->avail_wrap_counter ^= 1;\n-\t\t}\n+\t\tvq_inc_last_avail_packed(vq, desc_count);\n \t}\n \n \tif (likely(dev->dequeue_zero_copy == 0)) {\n",
    "prefixes": [
        "v9",
        "01/13"
    ]
}