Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/59387/?format=api
http://patchwork.dpdk.org/api/patches/59387/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20190919163643.24130-8-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": "<20190919163643.24130-8-yong.liu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190919163643.24130-8-yong.liu@intel.com", "date": "2019-09-19T16:36:34", "name": "[v2,07/16] vhost: flush vhost enqueue shadow ring by burst", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "0fa5c2dc50243728958fc92e6753a6f28c054b4c", "submitter": { "id": 17, "url": "http://patchwork.dpdk.org/api/people/17/?format=api", "name": "Marvin Liu", "email": "yong.liu@intel.com" }, "delegate": null, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20190919163643.24130-8-yong.liu@intel.com/mbox/", "series": [ { "id": 6444, "url": "http://patchwork.dpdk.org/api/series/6444/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=6444", "date": "2019-09-19T16:36:27", "name": "vhost packed ring performance optimization", "version": 2, "mbox": "http://patchwork.dpdk.org/series/6444/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/59387/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/59387/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 8F1841E936;\n\tThu, 19 Sep 2019 10:56:48 +0200 (CEST)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id B862A1C2B6\n\tfor <dev@dpdk.org>; Thu, 19 Sep 2019 10:56:35 +0200 (CEST)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Sep 2019 01:56:35 -0700", "from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.142])\n\tby orsmga001.jf.intel.com with ESMTP; 19 Sep 2019 01:56:33 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.64,523,1559545200\"; d=\"scan'208\";a=\"271146126\"", "From": "Marvin Liu <yong.liu@intel.com>", "To": "maxime.coquelin@redhat.com, tiwei.bie@intel.com, zhihong.wang@intel.com", "Cc": "dev@dpdk.org,\n\tMarvin Liu <yong.liu@intel.com>", "Date": "Fri, 20 Sep 2019 00:36:34 +0800", "Message-Id": "<20190919163643.24130-8-yong.liu@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190919163643.24130-1-yong.liu@intel.com>", "References": "<20190905161421.55981-2-yong.liu@intel.com>\n\t<20190919163643.24130-1-yong.liu@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 07/16] vhost: flush vhost enqueue shadow ring\n\tby burst", "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": "Buffer vhost enqueue shadow ring update, flush shadow ring until\nbuffered descriptors number exceed one burst. Thus virtio can receive\npackets at a faster frequency.\n\nSigned-off-by: Marvin Liu <yong.liu@intel.com>", "diff": "diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex 9fa3c8adf..000648dd4 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -163,6 +163,7 @@ struct vhost_virtqueue {\n \t\tstruct vring_used_elem_packed *shadow_used_packed;\n \t};\n \tuint16_t shadow_used_idx;\n+\tuint16_t enqueue_shadow_count;\n \tstruct vhost_vring_addr ring_addrs;\n \n \tstruct batch_copy_elem\t*batch_copy_elems;\ndiff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex ebd6c175d..e2787b72e 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -169,6 +169,24 @@ update_shadow_packed(struct vhost_virtqueue *vq,\n \tvq->shadow_used_packed[i].count = count;\n }\n \n+static __rte_always_inline void\n+update_enqueue_shadow_packed(struct vhost_virtqueue *vq, uint16_t desc_idx,\n+\tuint32_t len, uint16_t count)\n+{\n+\t/* enqueue shadow flush action aligned with burst num */\n+\tif (!vq->shadow_used_idx)\n+\t\tvq->enqueue_shadow_count = vq->last_used_idx &\n+\t\t\t\t\t\tPACKED_BURST_MASK;\n+\n+\tuint16_t i = vq->shadow_used_idx++;\n+\n+\tvq->shadow_used_packed[i].id = desc_idx;\n+\tvq->shadow_used_packed[i].len = len;\n+\tvq->shadow_used_packed[i].count = count;\n+\n+\tvq->enqueue_shadow_count += count;\n+}\n+\n static inline void\n do_data_copy_enqueue(struct virtio_net *dev, struct vhost_virtqueue *vq)\n {\n@@ -198,6 +216,21 @@ do_data_copy_dequeue(struct vhost_virtqueue *vq)\n \tvq->batch_copy_nb_elems = 0;\n }\n \n+static __rte_always_inline void\n+flush_enqueue_packed(struct virtio_net *dev,\n+\tstruct vhost_virtqueue *vq, uint32_t len[], uint16_t id[],\n+\tuint16_t count[], uint16_t num_buffers)\n+{\n+\tint i;\n+\tfor (i = 0; i < num_buffers; i++) {\n+\t\tupdate_enqueue_shadow_packed(vq, id[i], len[i], count[i]);\n+\n+\t\tif (vq->enqueue_shadow_count >= PACKED_DESCS_BURST) {\n+\t\t\tdo_data_copy_enqueue(dev, vq);\n+\t\t\tflush_shadow_packed(dev, vq);\n+\t\t}\n+\t}\n+}\n /* avoid write operation when necessary, to lessen cache issues */\n #define ASSIGN_UNLESS_EQUAL(var, val) do {\t\\\n \tif ((var) != (val))\t\t\t\\\n@@ -799,6 +832,9 @@ vhost_enqueue_single_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tmax_tries = 1;\n \n \tuint16_t num_buffers = 0;\n+\tuint32_t buffer_len[max_tries];\n+\tuint16_t buffer_buf_id[max_tries];\n+\tuint16_t buffer_desc_count[max_tries];\n \n \twhile (size > 0) {\n \t\t/*\n@@ -821,6 +857,10 @@ vhost_enqueue_single_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \n \t\tsize -= len;\n \n+\t\tbuffer_len[num_buffers] = len;\n+\t\tbuffer_buf_id[num_buffers] = buf_id;\n+\t\tbuffer_desc_count[num_buffers] = desc_count;\n+\n \t\tavail_idx += desc_count;\n \t\tif (avail_idx >= vq->size)\n \t\t\tavail_idx -= vq->size;\n@@ -835,6 +875,9 @@ vhost_enqueue_single_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\treturn 0;\n \t}\n \n+\tflush_enqueue_packed(dev, vq, buffer_len, buffer_buf_id,\n+\t\t\tbuffer_desc_count, num_buffers);\n+\n \treturn 0;\n }\n \n", "prefixes": [ "v2", "07/16" ] }{ "id": 59387, "url": "