Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/91742/?format=api
http://patches.dpdk.org/api/patches/91742/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210419085104.47078-4-Cheng1.jiang@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": "<20210419085104.47078-4-Cheng1.jiang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210419085104.47078-4-Cheng1.jiang@intel.com", "date": "2021-04-19T08:51:03", "name": "[v8,3/4] vhost: add batch datapath for async vhost packed ring", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "d288ddf55afd764733c912a0ce2282817b9a653a", "submitter": { "id": 1530, "url": "http://patches.dpdk.org/api/people/1530/?format=api", "name": "Jiang, Cheng1", "email": "Cheng1.jiang@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/20210419085104.47078-4-Cheng1.jiang@intel.com/mbox/", "series": [ { "id": 16485, "url": "http://patches.dpdk.org/api/series/16485/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16485", "date": "2021-04-19T08:51:00", "name": "add support for packed ring in async vhost", "version": 8, "mbox": "http://patches.dpdk.org/series/16485/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/91742/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/91742/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 1A7E5A0547;\n\tMon, 19 Apr 2021 11:05:25 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 073F341257;\n\tMon, 19 Apr 2021 11:05:20 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by mails.dpdk.org (Postfix) with ESMTP id CB2F24124B\n for <dev@dpdk.org>; Mon, 19 Apr 2021 11:05:15 +0200 (CEST)", "from orsmga002.jf.intel.com ([10.7.209.21])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 Apr 2021 02:05:14 -0700", "from dpdk_jiangcheng.sh.intel.com ([10.67.119.112])\n by orsmga002.jf.intel.com with ESMTP; 19 Apr 2021 02:05:12 -0700" ], "IronPort-SDR": [ "\n wzmuP76SZzrNGtM81Z5BLTFlbmMnnx6LEZzMcNCwheEscQz7NgSyLuQg0zegV5CXVxZx3qIM6j\n vpgn1ATi7ipQ==", "\n 7yPFc6ecoKxfx87oQmSj1d9ogIB3Y+mguviGLjfF/pic8EsORkBkk71VAiABDc8gICRfjS5lFW\n lzzPzuGz8ltw==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,9958\"; a=\"182424772\"", "E=Sophos;i=\"5.82,233,1613462400\"; d=\"scan'208\";a=\"182424772\"", "E=Sophos;i=\"5.82,233,1613462400\"; d=\"scan'208\";a=\"400566213\"" ], "X-ExtLoop1": "1", "From": "Cheng Jiang <Cheng1.jiang@intel.com>", "To": "maxime.coquelin@redhat.com,\n\tchenbo.xia@intel.com", "Cc": "dev@dpdk.org, jiayu.hu@intel.com, yvonnex.yang@intel.com,\n yinan.wang@intel.com, yong.liu@intel.com,\n Cheng Jiang <Cheng1.jiang@intel.com>", "Date": "Mon, 19 Apr 2021 08:51:03 +0000", "Message-Id": "<20210419085104.47078-4-Cheng1.jiang@intel.com>", "X-Mailer": "git-send-email 2.29.2", "In-Reply-To": "<20210419085104.47078-1-Cheng1.jiang@intel.com>", "References": "<20210317085426.10119-1-Cheng1.jiang@intel.com>\n <20210419085104.47078-1-Cheng1.jiang@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v8 3/4] vhost: add batch datapath for async vhost\n packed ring", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add batch datapath for async vhost packed ring to improve the\nperformance of small packet processing.\n\nSigned-off-by: Cheng Jiang <Cheng1.jiang@intel.com>\n---\n lib/librte_vhost/virtio_net.c | 41 +++++++++++++++++++++++++++++++----\n 1 file changed, 37 insertions(+), 4 deletions(-)", "diff": "diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex ce88ad3c0..0ad289e6e 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -1724,6 +1724,29 @@ vhost_update_used_packed(struct vhost_virtqueue *vq,\n \tvq->desc_packed[head_idx].flags = head_flags;\n }\n \n+static __rte_always_inline int\n+virtio_dev_rx_async_batch_packed(struct virtio_net *dev,\n+\t\t\t struct vhost_virtqueue *vq,\n+\t\t\t struct rte_mbuf **pkts,\n+\t\t\t struct rte_mbuf **comp_pkts, uint32_t *pkt_done)\n+{\n+\tuint16_t i;\n+\tuint32_t cpy_threshold = vq->async_threshold;\n+\n+\tvhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) {\n+\t\tif (unlikely(pkts[i]->pkt_len >= cpy_threshold))\n+\t\t\treturn -1;\n+\t}\n+\tif (!virtio_dev_rx_batch_packed(dev, vq, pkts)) {\n+\t\tvhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE)\n+\t\t\tcomp_pkts[(*pkt_done)++] = pkts[i];\n+\n+\t\treturn 0;\n+\t}\n+\n+\treturn -1;\n+}\n+\n static __rte_always_inline int\n vhost_enqueue_async_single_packed(struct virtio_net *dev,\n \t\t\t struct vhost_virtqueue *vq,\n@@ -1874,6 +1897,7 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev,\n \tstruct rte_mbuf **comp_pkts, uint32_t *comp_count)\n {\n \tuint32_t pkt_idx = 0, pkt_burst_idx = 0;\n+\tuint32_t remained = count;\n \tuint16_t async_descs_idx = 0;\n \tuint16_t num_buffers;\n \tuint16_t num_desc;\n@@ -1891,9 +1915,17 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev,\n \tuint32_t num_async_pkts = 0, num_done_pkts = 0;\n \tstruct vring_packed_desc async_descs[vq->size];\n \n-\trte_prefetch0(&vq->desc_packed[vq->last_avail_idx]);\n+\tdo {\n+\t\trte_prefetch0(&vq->desc_packed[vq->last_avail_idx]);\n+\t\tif (remained >= PACKED_BATCH_SIZE) {\n+\t\t\tif (!virtio_dev_rx_async_batch_packed(dev, vq,\n+\t\t\t\t&pkts[pkt_idx], comp_pkts, &num_done_pkts)) {\n+\t\t\t\tpkt_idx += PACKED_BATCH_SIZE;\n+\t\t\t\tremained -= PACKED_BATCH_SIZE;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t}\n \n-\tfor (pkt_idx = 0; pkt_idx < count; pkt_idx++) {\n \t\tif (unlikely(virtio_dev_rx_async_single_packed(dev, vq, pkts[pkt_idx],\n \t\t\t\t\t\t&num_desc, &num_buffers,\n \t\t\t\t\t\t&async_descs[async_descs_idx],\n@@ -1936,6 +1968,8 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev,\n \t\t\tcomp_pkts[num_done_pkts++] = pkts[pkt_idx];\n \t\t}\n \n+\t\tpkt_idx++;\n+\t\tremained--;\n \t\tvq_inc_last_avail_packed(vq, num_desc);\n \n \t\t/*\n@@ -1960,13 +1994,12 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev,\n \t\t\t\t */\n \t\t\t\tpkt_err = pkt_burst_idx - n_pkts;\n \t\t\t\tpkt_burst_idx = 0;\n-\t\t\t\tpkt_idx++;\n \t\t\t\tbreak;\n \t\t\t}\n \n \t\t\tpkt_burst_idx = 0;\n \t\t}\n-\t}\n+\t} while (pkt_idx < count);\n \n \tif (pkt_burst_idx) {\n \t\tn_pkts = vq->async_ops.transfer_data(dev->vid, queue_id, tdes, 0, pkt_burst_idx);\n", "prefixes": [ "v8", "3/4" ] }{ "id": 91742, "url": "