Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/111085/?format=api
http://patches.dpdk.org/api/patches/111085/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220513020022.1054-4-xuan.ding@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": "<20220513020022.1054-4-xuan.ding@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220513020022.1054-4-xuan.ding@intel.com", "date": "2022-05-13T02:00:20", "name": "[v5,3/5] vhost: merge sync and async descriptor to mbuf filling", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "9d8d37ae2afa90a2834499cd4bf0cb23a87c9f66", "submitter": { "id": 1401, "url": "http://patches.dpdk.org/api/people/1401/?format=api", "name": "Ding, Xuan", "email": "xuan.ding@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/20220513020022.1054-4-xuan.ding@intel.com/mbox/", "series": [ { "id": 22918, "url": "http://patches.dpdk.org/api/series/22918/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22918", "date": "2022-05-13T02:00:17", "name": "vhost: support async dequeue data path", "version": 5, "mbox": "http://patches.dpdk.org/series/22918/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/111085/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/111085/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 18C93A00C3;\n\tFri, 13 May 2022 04:05:19 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2C5A142833;\n\tFri, 13 May 2022 04:05:16 +0200 (CEST)", "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n by mails.dpdk.org (Postfix) with ESMTP id 0E54142833\n for <dev@dpdk.org>; Fri, 13 May 2022 04:05:14 +0200 (CEST)", "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 12 May 2022 19:05:14 -0700", "from npg-dpdk-xuan-cbdma.sh.intel.com ([10.67.110.228])\n by orsmga008.jf.intel.com with ESMTP; 12 May 2022 19:05:12 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1652407515; x=1683943515;\n h=from:to:cc:subject:date:message-id:in-reply-to: references;\n bh=Jp+zHdqvG30t8RC7x0aNp83adfDl7waXYzgZP9aiULg=;\n b=SgPv1KdpwM0MwurJHUHt6b5FHom9yLvsKyKRxRgaIaUaVcWF8v78bZ1t\n vv74pMeNmWs7IjoAWF4/EISXvdVC+w3cnTZFlBeqINPCbKgStMw0k68nC\n HeDqM7jPKIjplC22ADJLG4ppzwzkUhlKhx9wJ9xsLo9Wqy+nRAlRZNAfw\n jX6BcmeQES/msTmnhqDVbh2K4/G/KLzXibETT8GNQYzHmaMqaiqrQyvXo\n 2zEd014Tt1fGZ/nMK//hWCi2BGcAFmVvqGx9ZcZFhaOryCke5CDJBujyF\n ujprgS3kbMIuCDHsfhKEroZtayOOYtVF7LRn2oKRePGFL6en50OWPDy5j g==;", "X-IronPort-AV": [ "E=McAfee;i=\"6400,9594,10345\"; a=\"250090791\"", "E=Sophos;i=\"5.91,221,1647327600\"; d=\"scan'208\";a=\"250090791\"", "E=Sophos;i=\"5.91,221,1647327600\"; d=\"scan'208\";a=\"594983209\"" ], "X-ExtLoop1": "1", "From": "xuan.ding@intel.com", "To": "maxime.coquelin@redhat.com,\n\tchenbo.xia@intel.com", "Cc": "dev@dpdk.org, jiayu.hu@intel.com, cheng1.jiang@intel.com,\n sunil.pai.g@intel.com, liangma@liangbit.com,\n Xuan Ding <xuan.ding@intel.com>", "Subject": "[PATCH v5 3/5] vhost: merge sync and async descriptor to mbuf filling", "Date": "Fri, 13 May 2022 02:00:20 +0000", "Message-Id": "<20220513020022.1054-4-xuan.ding@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20220513020022.1054-1-xuan.ding@intel.com>", "References": "<20220407152546.38167-1-xuan.ding@intel.com>\n <20220513020022.1054-1-xuan.ding@intel.com>", "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" }, "content": "From: Xuan Ding <xuan.ding@intel.com>\n\nThis patch refactors copy_desc_to_mbuf() used by the sync\npath to support both sync and async descriptor to mbuf filling.\n\nSigned-off-by: Xuan Ding <xuan.ding@intel.com>\nTested-by: Yvonne Yang <yvonnex.yang@intel.com>\nReviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/vhost/vhost.h | 1 +\n lib/vhost/virtio_net.c | 48 ++++++++++++++++++++++++++++++++----------\n 2 files changed, 38 insertions(+), 11 deletions(-)", "diff": "diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h\nindex a9edc271aa..00744b234f 100644\n--- a/lib/vhost/vhost.h\n+++ b/lib/vhost/vhost.h\n@@ -180,6 +180,7 @@ struct async_inflight_info {\n \tstruct rte_mbuf *mbuf;\n \tuint16_t descs; /* num of descs inflight */\n \tuint16_t nr_buffers; /* num of buffers inflight for packed ring */\n+\tstruct virtio_net_hdr nethdr;\n };\n \n struct vhost_async {\ndiff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c\nindex a9e2dcd9ce..5904839d5c 100644\n--- a/lib/vhost/virtio_net.c\n+++ b/lib/vhost/virtio_net.c\n@@ -2487,10 +2487,10 @@ copy_vnet_hdr_from_desc(struct virtio_net_hdr *hdr,\n }\n \n static __rte_always_inline int\n-copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,\n+desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t struct buf_vector *buf_vec, uint16_t nr_vec,\n \t\t struct rte_mbuf *m, struct rte_mempool *mbuf_pool,\n-\t\t bool legacy_ol_flags)\n+\t\t bool legacy_ol_flags, uint16_t slot_idx, bool is_async)\n {\n \tuint32_t buf_avail, buf_offset, buf_len;\n \tuint64_t buf_addr, buf_iova;\n@@ -2501,6 +2501,8 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tstruct virtio_net_hdr *hdr = NULL;\n \t/* A counter to avoid desc dead loop chain */\n \tuint16_t vec_idx = 0;\n+\tstruct vhost_async *async = vq->async;\n+\tstruct async_inflight_info *pkts_info;\n \n \tbuf_addr = buf_vec[vec_idx].buf_addr;\n \tbuf_iova = buf_vec[vec_idx].buf_iova;\n@@ -2538,6 +2540,7 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tif (unlikely(++vec_idx >= nr_vec))\n \t\t\tgoto error;\n \t\tbuf_addr = buf_vec[vec_idx].buf_addr;\n+\t\tbuf_iova = buf_vec[vec_idx].buf_iova;\n \t\tbuf_len = buf_vec[vec_idx].buf_len;\n \n \t\tbuf_offset = 0;\n@@ -2553,12 +2556,25 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \n \tmbuf_offset = 0;\n \tmbuf_avail = m->buf_len - RTE_PKTMBUF_HEADROOM;\n+\n+\tif (is_async) {\n+\t\tpkts_info = async->pkts_info;\n+\t\tif (async_iter_initialize(dev, async))\n+\t\t\treturn -1;\n+\t}\n+\n \twhile (1) {\n \t\tcpy_len = RTE_MIN(buf_avail, mbuf_avail);\n \n-\t\tsync_fill_seg(dev, vq, cur, mbuf_offset,\n-\t\t\t buf_addr + buf_offset,\n-\t\t\t buf_iova + buf_offset, cpy_len, false);\n+\t\tif (is_async) {\n+\t\t\tif (async_fill_seg(dev, vq, cur, mbuf_offset,\n+\t\t\t\t\t buf_iova + buf_offset, cpy_len, false) < 0)\n+\t\t\t\tgoto error;\n+\t\t} else {\n+\t\t\tsync_fill_seg(dev, vq, cur, mbuf_offset,\n+\t\t\t\t buf_addr + buf_offset,\n+\t\t\t\t buf_iova + buf_offset, cpy_len, false);\n+\t\t}\n \n \t\tmbuf_avail -= cpy_len;\n \t\tmbuf_offset += cpy_len;\n@@ -2607,11 +2623,20 @@ copy_desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tprev->data_len = mbuf_offset;\n \tm->pkt_len += mbuf_offset;\n \n-\tif (hdr)\n-\t\tvhost_dequeue_offload(dev, hdr, m, legacy_ol_flags);\n+\tif (is_async) {\n+\t\tasync_iter_finalize(async);\n+\t\tif (hdr)\n+\t\t\tpkts_info[slot_idx].nethdr = *hdr;\n+\t} else {\n+\t\tif (hdr)\n+\t\t\tvhost_dequeue_offload(dev, hdr, m, legacy_ol_flags);\n+\t}\n \n \treturn 0;\n error:\n+\tif (is_async)\n+\t\tasync_iter_cancel(async);\n+\n \treturn -1;\n }\n \n@@ -2743,8 +2768,8 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\tbreak;\n \t\t}\n \n-\t\terr = copy_desc_to_mbuf(dev, vq, buf_vec, nr_vec, pkts[i],\n-\t\t\t\tmbuf_pool, legacy_ol_flags);\n+\t\terr = desc_to_mbuf(dev, vq, buf_vec, nr_vec, pkts[i],\n+\t\t\t\t mbuf_pool, legacy_ol_flags, 0, false);\n \t\tif (unlikely(err)) {\n \t\t\tif (!allocerr_warned) {\n \t\t\t\tVHOST_LOG_DATA(ERR, \"(%s) failed to copy desc to mbuf.\\n\",\n@@ -2755,6 +2780,7 @@ virtio_dev_tx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\t\ti++;\n \t\t\tbreak;\n \t\t}\n+\n \t}\n \n \tif (dropped)\n@@ -2936,8 +2962,8 @@ vhost_dequeue_single_packed(struct virtio_net *dev,\n \t\treturn -1;\n \t}\n \n-\terr = copy_desc_to_mbuf(dev, vq, buf_vec, nr_vec, pkts,\n-\t\t\t\tmbuf_pool, legacy_ol_flags);\n+\terr = desc_to_mbuf(dev, vq, buf_vec, nr_vec, pkts,\n+\t\t\t mbuf_pool, legacy_ol_flags, 0, false);\n \tif (unlikely(err)) {\n \t\tif (!allocerr_warned) {\n \t\t\tVHOST_LOG_DATA(ERR, \"(%s) failed to copy desc to mbuf.\\n\",\n", "prefixes": [ "v5", "3/5" ] }{ "id": 111085, "url": "