Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/48365/?format=api
https://patches.dpdk.org/api/patches/48365/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20181128094700.14598-1-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": "<20181128094700.14598-1-maxime.coquelin@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20181128094700.14598-1-maxime.coquelin@redhat.com", "date": "2018-11-28T09:47:00", "name": "vhost: batch used descriptors chains write-back with packed ring", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "bc4d4e132c26b015a12fd32b1c656c5a64eb7d06", "submitter": { "id": 512, "url": "https://patches.dpdk.org/api/people/512/?format=api", "name": "Maxime Coquelin", "email": "maxime.coquelin@redhat.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/20181128094700.14598-1-maxime.coquelin@redhat.com/mbox/", "series": [ { "id": 2590, "url": "https://patches.dpdk.org/api/series/2590/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=2590", "date": "2018-11-28T09:47:00", "name": "vhost: batch used descriptors chains write-back with packed ring", "version": 1, "mbox": "https://patches.dpdk.org/series/2590/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/48365/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/48365/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 000711B206;\n\tWed, 28 Nov 2018 10:47:12 +0100 (CET)", "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby dpdk.org (Postfix) with ESMTP id 1839C1B205\n\tfor <dev@dpdk.org>; Wed, 28 Nov 2018 10:47:12 +0100 (CET)", "from smtp.corp.redhat.com\n\t(int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 5DA8B76528;\n\tWed, 28 Nov 2018 09:47:11 +0000 (UTC)", "from localhost.localdomain (ovpn-112-54.ams2.redhat.com\n\t[10.36.112.54])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 17848101962B;\n\tWed, 28 Nov 2018 09:47:02 +0000 (UTC)" ], "From": "Maxime Coquelin <maxime.coquelin@redhat.com>", "To": "dev@dpdk.org, tiwei.bie@intel.com, zhihong.wang@intel.com,\n\tjfreimann@redhat.com", "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>", "Date": "Wed, 28 Nov 2018 10:47:00 +0100", "Message-Id": "<20181128094700.14598-1-maxime.coquelin@redhat.com>", "X-Scanned-By": "MIMEDefang 2.84 on 10.5.11.22", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]); Wed, 28 Nov 2018 09:47:11 +0000 (UTC)", "Subject": "[dpdk-dev] [PATCH] vhost: batch used descriptors chains write-back\n\twith packed ring", "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": "Instead of writing back descriptors chains in order, let's\nwrite the first chain flags last in order to improve batching.\n\nWith Kernel's pktgen benchmark, ~3% performance gain is measured.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/librte_vhost/virtio_net.c | 37 ++++++++++++++++++++++-------------\n 1 file changed, 23 insertions(+), 14 deletions(-)", "diff": "diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex 5e1a1a727..f54642c2d 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -135,19 +135,10 @@ flush_shadow_used_ring_packed(struct virtio_net *dev,\n \t\t\tstruct vhost_virtqueue *vq)\n {\n \tint i;\n-\tuint16_t used_idx = vq->last_used_idx;\n+\tuint16_t head_flags, head_idx = vq->last_used_idx;\n \n-\t/* Split loop in two to save memory barriers */\n-\tfor (i = 0; i < vq->shadow_used_idx; i++) {\n-\t\tvq->desc_packed[used_idx].id = vq->shadow_used_packed[i].id;\n-\t\tvq->desc_packed[used_idx].len = vq->shadow_used_packed[i].len;\n-\n-\t\tused_idx += vq->shadow_used_packed[i].count;\n-\t\tif (used_idx >= vq->size)\n-\t\t\tused_idx -= vq->size;\n-\t}\n-\n-\trte_smp_wmb();\n+\tif (unlikely(vq->shadow_used_idx == 0))\n+\t\treturn;\n \n \tfor (i = 0; i < vq->shadow_used_idx; i++) {\n \t\tuint16_t flags;\n@@ -165,12 +156,22 @@ flush_shadow_used_ring_packed(struct virtio_net *dev,\n \t\t\tflags &= ~VRING_DESC_F_AVAIL;\n \t\t}\n \n-\t\tvq->desc_packed[vq->last_used_idx].flags = flags;\n+\t\tvq->desc_packed[vq->last_used_idx].id =\n+\t\t\tvq->shadow_used_packed[i].id;\n+\t\tvq->desc_packed[vq->last_used_idx].len =\n+\t\t\tvq->shadow_used_packed[i].len;\n+\n+\t\tif (i > 0) {\n+\t\t\tvq->desc_packed[vq->last_used_idx].flags = flags;\n \n-\t\tvhost_log_cache_used_vring(dev, vq,\n+\t\t\tvhost_log_cache_used_vring(dev, vq,\n \t\t\t\t\tvq->last_used_idx *\n \t\t\t\t\tsizeof(struct vring_packed_desc),\n \t\t\t\t\tsizeof(struct vring_packed_desc));\n+\t\t} else {\n+\t\t\thead_idx = vq->last_used_idx;\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@@ -180,7 +181,15 @@ flush_shadow_used_ring_packed(struct virtio_net *dev,\n \t}\n \n \trte_smp_wmb();\n+\n+\tvq->desc_packed[head_idx].flags = head_flags;\n \tvq->shadow_used_idx = 0;\n+\n+\tvhost_log_cache_used_vring(dev, vq,\n+\t\t\t\thead_idx *\n+\t\t\t\tsizeof(struct vring_packed_desc),\n+\t\t\t\tsizeof(struct vring_packed_desc));\n+\n \tvhost_log_cache_sync(dev, vq);\n }\n \n", "prefixes": [] }{ "id": 48365, "url": "