get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 61552,
    "url": "https://patches.dpdk.org/api/patches/61552/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20191021154016.16274-9-yong.liu@intel.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": "<20191021154016.16274-9-yong.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191021154016.16274-9-yong.liu@intel.com",
    "date": "2019-10-21T15:40:11",
    "name": "[v7,08/13] vhost: flush batched enqueue descs directly",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8bc31f18785609837131d9e22b37742b3c16eaa2",
    "submitter": {
        "id": 17,
        "url": "https://patches.dpdk.org/api/people/17/?format=api",
        "name": "Marvin Liu",
        "email": "yong.liu@intel.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20191021154016.16274-9-yong.liu@intel.com/mbox/",
    "series": [
        {
            "id": 6958,
            "url": "https://patches.dpdk.org/api/series/6958/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6958",
            "date": "2019-10-21T15:40:03",
            "name": "vhost packed ring performance optimization",
            "version": 7,
            "mbox": "https://patches.dpdk.org/series/6958/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/61552/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/61552/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 53A361BE80;\n\tMon, 21 Oct 2019 10:00:35 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 90ABF44C3\n\tfor <dev@dpdk.org>; Mon, 21 Oct 2019 10:00:12 +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:12 -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:11 -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=\"227238029\"",
        "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:11 +0800",
        "Message-Id": "<20191021154016.16274-9-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 08/13] vhost: flush batched enqueue descs\n\tdirectly",
        "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": "Flush used elements when batched enqueue function is finished.\nDescriptor's flags are pre-calculated as they will be reset by vhost.\n\nSigned-off-by: Marvin Liu <yong.liu@intel.com>\nReviewed-by: Gavin Hu <gavin.hu@arm.com>\nReviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>",
    "diff": "diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex d59446442..f8dbe841c 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -39,6 +39,9 @@\n \n #define VHOST_LOG_CACHE_NR 32\n \n+#define PACKED_DESC_ENQUEUE_USED_FLAG(w)\t\\\n+\t((w) ? (VRING_DESC_F_AVAIL | VRING_DESC_F_USED | VRING_DESC_F_WRITE) : \\\n+\t\tVRING_DESC_F_WRITE)\n #define PACKED_DESC_SINGLE_DEQUEUE_FLAG (VRING_DESC_F_NEXT | \\\n \t\t\t\t\t VRING_DESC_F_INDIRECT)\n \ndiff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex 1cff9b86f..eefa1efa3 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -154,6 +154,36 @@ vhost_flush_enqueue_shadow_packed(struct virtio_net *dev,\n \tvhost_log_cache_sync(dev, vq);\n }\n \n+static __rte_always_inline void\n+vhost_flush_enqueue_batch_packed(struct virtio_net *dev,\n+\t\t\t\t struct vhost_virtqueue *vq,\n+\t\t\t\t uint64_t *lens,\n+\t\t\t\t uint16_t *ids)\n+{\n+\tuint16_t i;\n+\tuint16_t flags;\n+\n+\tflags = PACKED_DESC_ENQUEUE_USED_FLAG(vq->used_wrap_counter);\n+\n+\tvhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) {\n+\t\tvq->desc_packed[vq->last_used_idx + i].id = ids[i];\n+\t\tvq->desc_packed[vq->last_used_idx + i].len = lens[i];\n+\t}\n+\n+\trte_smp_wmb();\n+\n+\tvhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)\n+\t\tvq->desc_packed[vq->last_used_idx + i].flags = flags;\n+\n+\tvhost_log_cache_used_vring(dev, vq, vq->last_used_idx *\n+\t\t\t\t   sizeof(struct vring_packed_desc),\n+\t\t\t\t   sizeof(struct vring_packed_desc) *\n+\t\t\t\t   PACKED_BATCH_SIZE);\n+\tvhost_log_cache_sync(dev, vq);\n+\n+\tvq_inc_last_used_packed(vq, PACKED_BATCH_SIZE);\n+}\n+\n static __rte_always_inline void\n flush_shadow_used_ring_packed(struct virtio_net *dev,\n \t\t\tstruct vhost_virtqueue *vq)\n@@ -992,6 +1022,7 @@ virtio_dev_rx_batch_packed(struct virtio_net *dev,\n \tstruct virtio_net_hdr_mrg_rxbuf *hdrs[PACKED_BATCH_SIZE];\n \tuint32_t buf_offset = dev->vhost_hlen;\n \tuint64_t lens[PACKED_BATCH_SIZE];\n+\tuint16_t ids[PACKED_BATCH_SIZE];\n \tuint16_t i;\n \n \tif (unlikely(avail_idx & PACKED_BATCH_MASK))\n@@ -1047,6 +1078,11 @@ virtio_dev_rx_batch_packed(struct virtio_net *dev,\n \t\t\t   pkts[i]->pkt_len);\n \t}\n \n+\tvhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)\n+\t\tids[i] = descs[avail_idx + i].id;\n+\n+\tvhost_flush_enqueue_batch_packed(dev, vq, lens, ids);\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "v7",
        "08/13"
    ]
}