Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/61594/?format=api
http://patchwork.dpdk.org/api/patches/61594/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20191021220813.55236-3-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": "<20191021220813.55236-3-yong.liu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20191021220813.55236-3-yong.liu@intel.com", "date": "2019-10-21T22:08:02", "name": "[v8,02/13] vhost: add packed ring single enqueue", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "975d8f731be5e2c16643f76bb3f59ba7f453011c", "submitter": { "id": 17, "url": "http://patchwork.dpdk.org/api/people/17/?format=api", "name": "Marvin Liu", "email": "yong.liu@intel.com" }, "delegate": { "id": 2642, "url": "http://patchwork.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20191021220813.55236-3-yong.liu@intel.com/mbox/", "series": [ { "id": 6969, "url": "http://patchwork.dpdk.org/api/series/6969/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=6969", "date": "2019-10-21T22:08:00", "name": "vhost packed ring performance optimization", "version": 8, "mbox": "http://patchwork.dpdk.org/series/6969/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/61594/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/61594/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 4D8A11BF5C;\n\tMon, 21 Oct 2019 16:28:13 +0200 (CEST)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 539671BF0A\n\tfor <dev@dpdk.org>; Mon, 21 Oct 2019 16:28:03 +0200 (CEST)", "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Oct 2019 07:28:02 -0700", "from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.142])\n\tby orsmga008.jf.intel.com with ESMTP; 21 Oct 2019 07:28:00 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.67,323,1566889200\"; d=\"scan'208\";a=\"191127119\"", "From": "Marvin Liu <yong.liu@intel.com>", "To": "maxime.coquelin@redhat.com, tiwei.bie@intel.com, zhihong.wang@intel.com, \n\tstephen@networkplumber.org, gavin.hu@arm.com", "Cc": "dev@dpdk.org,\n\tMarvin Liu <yong.liu@intel.com>", "Date": "Tue, 22 Oct 2019 06:08:02 +0800", "Message-Id": "<20191021220813.55236-3-yong.liu@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20191021220813.55236-1-yong.liu@intel.com>", "References": "<20191021154016.16274-1-yong.liu@intel.com>\n\t<20191021220813.55236-1-yong.liu@intel.com>", "Subject": "[dpdk-dev] [PATCH v8 02/13] vhost: add packed ring single enqueue", "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": "Add vhost enqueue function for single packet and meanwhile left space\nfor flush used ring function.\n\nSigned-off-by: Marvin Liu <yong.liu@intel.com>\nReviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>", "diff": "diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c\nindex 070d62bc0..4fb6552cc 100644\n--- a/lib/librte_vhost/virtio_net.c\n+++ b/lib/librte_vhost/virtio_net.c\n@@ -770,6 +770,60 @@ copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \treturn error;\n }\n \n+static __rte_always_inline int\n+vhost_enqueue_single_packed(struct virtio_net *dev,\n+\t\t\t struct vhost_virtqueue *vq,\n+\t\t\t struct rte_mbuf *pkt,\n+\t\t\t struct buf_vector *buf_vec,\n+\t\t\t uint16_t *nr_descs)\n+{\n+\tuint16_t nr_vec = 0;\n+\tuint16_t avail_idx = vq->last_avail_idx;\n+\tuint16_t max_tries, tries = 0;\n+\tuint16_t buf_id = 0;\n+\tuint32_t len = 0;\n+\tuint16_t desc_count;\n+\tuint32_t size = pkt->pkt_len + dev->vhost_hlen;\n+\tuint16_t num_buffers = 0;\n+\n+\tif (rxvq_is_mergeable(dev))\n+\t\tmax_tries = vq->size - 1;\n+\telse\n+\t\tmax_tries = 1;\n+\n+\twhile (size > 0) {\n+\t\t/*\n+\t\t * if we tried all available ring items, and still\n+\t\t * can't get enough buf, it means something abnormal\n+\t\t * happened.\n+\t\t */\n+\t\tif (unlikely(++tries > max_tries))\n+\t\t\treturn -1;\n+\n+\t\tif (unlikely(fill_vec_buf_packed(dev, vq,\n+\t\t\t\t\t\tavail_idx, &desc_count,\n+\t\t\t\t\t\tbuf_vec, &nr_vec,\n+\t\t\t\t\t\t&buf_id, &len,\n+\t\t\t\t\t\tVHOST_ACCESS_RW) < 0))\n+\t\t\treturn -1;\n+\n+\t\tlen = RTE_MIN(len, size);\n+\t\tsize -= len;\n+\n+\t\tnum_buffers += 1;\n+\n+\t\t*nr_descs += desc_count;\n+\t\tavail_idx += desc_count;\n+\t\tif (avail_idx >= vq->size)\n+\t\t\tavail_idx -= vq->size;\n+\t}\n+\n+\tif (copy_mbuf_to_desc(dev, vq, pkt, buf_vec, nr_vec, num_buffers) < 0)\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n static __rte_noinline uint32_t\n virtio_dev_rx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tstruct rte_mbuf **pkts, uint32_t count)\n@@ -827,6 +881,32 @@ virtio_dev_rx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \treturn pkt_idx;\n }\n \n+static __rte_unused int16_t\n+virtio_dev_rx_single_packed(struct virtio_net *dev,\n+\t\t\t struct vhost_virtqueue *vq,\n+\t\t\t struct rte_mbuf *pkt)\n+{\n+\tstruct buf_vector buf_vec[BUF_VECTOR_MAX];\n+\tuint16_t nr_descs = 0;\n+\n+\trte_smp_rmb();\n+\tif (unlikely(vhost_enqueue_single_packed(dev, vq, pkt, buf_vec,\n+\t\t\t\t\t\t &nr_descs) < 0)) {\n+\t\tVHOST_LOG_DEBUG(VHOST_DATA,\n+\t\t\t\t\"(%d) failed to get enough desc from vring\\n\",\n+\t\t\t\tdev->vid);\n+\t\treturn -1;\n+\t}\n+\n+\tVHOST_LOG_DEBUG(VHOST_DATA, \"(%d) current index %d | end index %d\\n\",\n+\t\t\tdev->vid, vq->last_avail_idx,\n+\t\t\tvq->last_avail_idx + nr_descs);\n+\n+\tvq_inc_last_avail_packed(vq, nr_descs);\n+\n+\treturn 0;\n+}\n+\n static __rte_noinline uint32_t\n virtio_dev_rx_packed(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \tstruct rte_mbuf **pkts, uint32_t count)\n", "prefixes": [ "v8", "02/13" ] }{ "id": 61594, "url": "