Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/91117/?format=api
http://patches.dpdk.org/api/patches/91117/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210412113430.17587-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": "<20210412113430.17587-4-Cheng1.jiang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210412113430.17587-4-Cheng1.jiang@intel.com", "date": "2021-04-12T11:34:29", "name": "[v5,3/4] vhost: add batch datapath for async vhost packed ring", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "f13c0a550db38981328203a97c301bad43a2ff20", "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/20210412113430.17587-4-Cheng1.jiang@intel.com/mbox/", "series": [ { "id": 16294, "url": "http://patches.dpdk.org/api/series/16294/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16294", "date": "2021-04-12T11:34:27", "name": "add support for packed ring in async vhost", "version": 5, "mbox": "http://patches.dpdk.org/series/16294/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/91117/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/91117/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 2A0BDA0C44;\n\tMon, 12 Apr 2021 13:48:02 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 041A5141138;\n\tMon, 12 Apr 2021 13:47:56 +0200 (CEST)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by mails.dpdk.org (Postfix) with ESMTP id 5E6CA141137\n for <dev@dpdk.org>; Mon, 12 Apr 2021 13:47:54 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 12 Apr 2021 04:47:54 -0700", "from dpdk_jiangcheng.sh.intel.com ([10.67.119.112])\n by fmsmga002.fm.intel.com with ESMTP; 12 Apr 2021 04:47:52 -0700" ], "IronPort-SDR": [ "\n Fr/BxSL5a+I26zCipqpAn71hiBtGKFsXlHETn/uQafYhseHjZkgQBZD83JCYT5j9roir5h/Oud\n trtcsYjjBqYA==", "\n 5Fw988Dq1aYfHU7ioD+FW+yWU5/Cyt2ZtMFV4mxJy+9bcZxq9sgXNj5RgJh/9oOANtB9u0Ni+R\n ukwUgIZMC/sQ==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9951\"; a=\"173662392\"", "E=Sophos;i=\"5.82,216,1613462400\"; d=\"scan'208\";a=\"173662392\"", "E=Sophos;i=\"5.82,216,1613462400\"; d=\"scan'208\";a=\"451421551\"" ], "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, 12 Apr 2021 11:34:29 +0000", "Message-Id": "<20210412113430.17587-4-Cheng1.jiang@intel.com>", "X-Mailer": "git-send-email 2.29.2", "In-Reply-To": "<20210412113430.17587-1-Cheng1.jiang@intel.com>", "References": "<20210317085426.10119-1-Cheng1.jiang@intel.com>\n <20210412113430.17587-1-Cheng1.jiang@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v5 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.\n\nSigned-off-by: Cheng Jiang <Cheng1.jiang@intel.com>\n---\n lib/librte_vhost/virtio_net.c | 43 +++++++++++++++++++++++++++++++----\n 1 file changed, 38 insertions(+), 5 deletions(-)", "diff": "diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex 410be9678..854f7afd6 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -1723,6 +1723,29 @@ virtio_dev_rx_async_submit_split(struct virtio_net *dev,\n \treturn pkt_idx;\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@@ -1846,6 +1869,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@@ -1865,9 +1889,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 & (vq->size - 1)]);\n-\n-\tfor (pkt_idx = 0; pkt_idx < count; pkt_idx++) {\n+\tdo {\n+\t\trte_prefetch0(&vq->desc_packed[vq->last_avail_idx &\n+\t\t\t\t\t\t\t(vq->size - 1)]);\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 \t\tif (unlikely(virtio_dev_rx_async_single_packed(dev, vq,\n \t\t\t\t\t\tpkts[pkt_idx],\n \t\t\t\t\t\t&num_desc, &num_buffers,\n@@ -1915,6 +1947,8 @@ virtio_dev_rx_async_submit_packed(struct virtio_net *dev,\n \t\t} else\n \t\t\tcomp_pkts[num_done_pkts++] = pkts[pkt_idx];\n \n+\t\tpkt_idx++;\n+\t\tremained--;\n \t\tvq_inc_last_avail_packed(vq, num_desc);\n \n \t\t/*\n@@ -1940,13 +1974,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,\n", "prefixes": [ "v5", "3/4" ] }{ "id": 91117, "url": "