get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 61557,
    "url": "http://patchwork.dpdk.org/api/patches/61557/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20191021154016.16274-14-yong.liu@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20191021154016.16274-14-yong.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191021154016.16274-14-yong.liu@intel.com",
    "date": "2019-10-21T15:40:16",
    "name": "[v7,13/13] vhost: optimize packed ring dequeue when in-order",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "083b10c9721bbe2db1e38d300b89e53a6c987f43",
    "submitter": {
        "id": 17,
        "url": "http://patchwork.dpdk.org/api/people/17/?format=api",
        "name": "Marvin Liu",
        "email": "yong.liu@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patchwork.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20191021154016.16274-14-yong.liu@intel.com/mbox/",
    "series": [
        {
            "id": 6958,
            "url": "http://patchwork.dpdk.org/api/series/6958/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=6958",
            "date": "2019-10-21T15:40:03",
            "name": "vhost packed ring performance optimization",
            "version": 7,
            "mbox": "http://patchwork.dpdk.org/series/6958/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/61557/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/61557/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 619514C74;\n\tMon, 21 Oct 2019 10:00:50 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 8322E4CE4\n\tfor <dev@dpdk.org>; Mon, 21 Oct 2019 10:00:22 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Oct 2019 01:00:22 -0700",
            "from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.142])\n\tby fmsmga002.fm.intel.com with ESMTP; 21 Oct 2019 01:00:20 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.67,322,1566889200\"; d=\"scan'208\";a=\"227238120\"",
        "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": "Mon, 21 Oct 2019 23:40:16 +0800",
        "Message-Id": "<20191021154016.16274-14-yong.liu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191021154016.16274-1-yong.liu@intel.com>",
        "References": "<20191015160739.51940-1-yong.liu@intel.com>\n\t<20191021154016.16274-1-yong.liu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v7 13/13] vhost: optimize packed ring dequeue\n\twhen in-order",
        "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 VIRTIO_F_IN_ORDER feature is negotiated, vhost can optimize dequeue\nfunction by only update first used descriptor.\n\nSigned-off-by: Marvin Liu <yong.liu@intel.com>\nReviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>",
    "diff": "diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex ca3a6551b..670790850 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -31,6 +31,12 @@ rxvq_is_mergeable(struct virtio_net *dev)\n \treturn dev->features & (1ULL << VIRTIO_NET_F_MRG_RXBUF);\n }\n \n+static  __rte_always_inline bool\n+virtio_net_is_inorder(struct virtio_net *dev)\n+{\n+\treturn dev->features & (1ULL << VIRTIO_F_IN_ORDER);\n+}\n+\n static bool\n is_valid_virt_queue_idx(uint32_t idx, int is_tx, uint32_t nr_vring)\n {\n@@ -201,6 +207,24 @@ vhost_flush_enqueue_batch_packed(struct virtio_net *dev,\n \tvq_inc_last_used_packed(vq, PACKED_BATCH_SIZE);\n }\n \n+static __rte_always_inline void\n+vhost_shadow_dequeue_batch_packed_inorder(struct vhost_virtqueue *vq,\n+\t\t\t\t\t  uint16_t id)\n+{\n+\tvq->shadow_used_packed[0].id = id;\n+\n+\tif (!vq->shadow_used_idx) {\n+\t\tvq->shadow_last_used_idx = vq->last_used_idx;\n+\t\tvq->shadow_used_packed[0].flags =\n+\t\t\tPACKED_DESC_DEQUEUE_USED_FLAG(vq->used_wrap_counter);\n+\t\tvq->shadow_used_packed[0].len = 0;\n+\t\tvq->shadow_used_packed[0].count = 1;\n+\t\tvq->shadow_used_idx++;\n+\t}\n+\n+\tvq_inc_last_used_packed(vq, PACKED_BATCH_SIZE);\n+}\n+\n static __rte_always_inline void\n vhost_shadow_dequeue_batch_packed(struct virtio_net *dev,\n \t\t\t\t  struct vhost_virtqueue *vq,\n@@ -273,6 +297,34 @@ vhost_shadow_dequeue_single_packed(struct vhost_virtqueue *vq,\n \tvq_inc_last_used_packed(vq, count);\n }\n \n+static __rte_always_inline void\n+vhost_shadow_dequeue_single_packed_inorder(struct vhost_virtqueue *vq,\n+\t\t\t\t\t   uint16_t buf_id,\n+\t\t\t\t\t   uint16_t count)\n+{\n+\tuint16_t flags;\n+\n+\tvq->shadow_used_packed[0].id = buf_id;\n+\n+\tflags = vq->desc_packed[vq->last_used_idx].flags;\n+\tif (vq->used_wrap_counter) {\n+\t\tflags |= VRING_DESC_F_USED;\n+\t\tflags |= VRING_DESC_F_AVAIL;\n+\t} else {\n+\t\tflags &= ~VRING_DESC_F_USED;\n+\t\tflags &= ~VRING_DESC_F_AVAIL;\n+\t}\n+\n+\tif (!vq->shadow_used_idx) {\n+\t\tvq->shadow_last_used_idx = vq->last_used_idx;\n+\t\tvq->shadow_used_packed[0].len = 0;\n+\t\tvq->shadow_used_packed[0].flags = flags;\n+\t\tvq->shadow_used_idx++;\n+\t}\n+\n+\tvq_inc_last_used_packed(vq, count);\n+}\n+\n static inline void\n do_data_copy_enqueue(struct virtio_net *dev, struct vhost_virtqueue *vq)\n {\n@@ -1841,7 +1893,11 @@ virtio_dev_tx_batch_packed(struct virtio_net *dev,\n \t\t\t   (void *)(uintptr_t)(desc_addrs[i] + buf_offset),\n \t\t\t   pkts[i]->pkt_len);\n \n-\tvhost_shadow_dequeue_batch_packed(dev, vq, ids);\n+\tif (virtio_net_is_inorder(dev))\n+\t\tvhost_shadow_dequeue_batch_packed_inorder(vq,\n+\t\t\tids[PACKED_BATCH_SIZE - 1]);\n+\telse\n+\t\tvhost_shadow_dequeue_batch_packed(dev, vq, ids);\n \n \tvq_inc_last_avail_packed(vq, PACKED_BATCH_SIZE);\n \n@@ -1898,7 +1954,11 @@ virtio_dev_tx_single_packed(struct virtio_net *dev,\n \t\t\t\t\t&desc_count))\n \t\treturn -1;\n \n-\tvhost_shadow_dequeue_single_packed(vq, buf_id, desc_count);\n+\tif (virtio_net_is_inorder(dev))\n+\t\tvhost_shadow_dequeue_single_packed_inorder(vq, buf_id,\n+\t\t\t\t\t\t\t   desc_count);\n+\telse\n+\t\tvhost_shadow_dequeue_single_packed(vq, buf_id, desc_count);\n \n \tvq_inc_last_avail_packed(vq, desc_count);\n \n",
    "prefixes": [
        "v7",
        "13/13"
    ]
}