Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/98525/?format=api
https://patches.dpdk.org/api/patches/98525/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210910022815.248-1-gaoxiangliu0@163.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": "<20210910022815.248-1-gaoxiangliu0@163.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210910022815.248-1-gaoxiangliu0@163.com", "date": "2021-09-10T02:28:15", "name": "vhost: merge repeated loop in vhost Tx", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": true, "hash": "8efec3c68b2b8b08ea180add6dc12d33c0520e1a", "submitter": { "id": 2304, "url": "https://patches.dpdk.org/api/people/2304/?format=api", "name": "Gaoxiang Liu", "email": "gaoxiangliu0@163.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/20210910022815.248-1-gaoxiangliu0@163.com/mbox/", "series": [ { "id": 18813, "url": "https://patches.dpdk.org/api/series/18813/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=18813", "date": "2021-09-10T02:28:15", "name": "vhost: merge repeated loop in vhost Tx", "version": 1, "mbox": "https://patches.dpdk.org/series/18813/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/98525/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/98525/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 EA099A0548;\n\tFri, 10 Sep 2021 04:28:35 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3CB594068C;\n\tFri, 10 Sep 2021 04:28:35 +0200 (CEST)", "from m12-12.163.com (m12-12.163.com [220.181.12.12])\n by mails.dpdk.org (Postfix) with ESMTP id 4014B4003E;\n Fri, 10 Sep 2021 04:28:32 +0200 (CEST)", "from DESKTOP-ONA2IA7.localdomain (unknown [112.17.247.202])\n by smtp8 (Coremail) with SMTP id DMCowAB3gTzBwjphnVJ4YA--.5625S4;\n Fri, 10 Sep 2021 10:28:29 +0800 (CST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;\n s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=NwK8Z\n Sc7DDuKsztkjcAE7D/EzXXclw0rrTWGptFYHRQ=; b=X52pSRP+XLamDdt4fyOuo\n ktV51o87O0XB4j8yudYMTc1D160of6b0KXmxHmOncxI7si0rTsCOUGd/W+IWmZJD\n aLhH1IqQ6AkFyzjD0IBCpf8hwu903+Ja8aJmWD1OWLEu/J+E4GfFZIWCHNvbei3y\n JRtqdG7dtSQ3RIPy0b7wcQ=", "From": "Gaoxiang Liu <gaoxiangliu0@163.com>", "To": "maxime.coquelin@redhat.com,\n\tchenbo.xia@intel.com", "Cc": "dev@dpdk.org, liugaoxiang@huawei.com, Gaoxiang Liu <gaoxiangliu0@163.com>,\n stable@dpdk.org", "Date": "Fri, 10 Sep 2021 10:28:15 +0800", "Message-Id": "<20210910022815.248-1-gaoxiangliu0@163.com>", "X-Mailer": "git-send-email 2.32.0", "In-Reply-To": "<20210910021117.130-1-gaoxiangliu0@163.com>", "References": "<20210910021117.130-1-gaoxiangliu0@163.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-CM-TRANSID": "DMCowAB3gTzBwjphnVJ4YA--.5625S4", "X-Coremail-Antispam": "1Uf129KBjvJXoWxuryUtrWUCF4kWw1xCr1xXwb_yoW5ury3pF\n 43KF9xAr45tF47W3WxAF13uw15AFZ2kw17GrsrGw1fKrW2yr17Za92kF1Svr1xKr9xCrZ8\n ZF1Fv3WDGa4Y9aDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UNJ5wUUUUU=", "X-Originating-IP": "[112.17.247.202]", "X-CM-SenderInfo": "xjdr5xxdqjzxjxq6il2tof0z/1tbiPg0KOlxBoGxslwAAsp", "Subject": "[dpdk-dev] [PATCH] vhost: merge repeated loop in vhost Tx", "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": "To improve performance of vhost Tx, merge repeated loop in eth_vhost_tx.\nMove \"vlan insert\" from eth_vhost_tx to virtio_dev_rx_packed\nand virtio_dev_rx_split to reduce a loop iteration.\n\nFixes: f63d356ee993 (\"net/vhost: insert/strip VLAN header in software\")\nCc: stable@dpdk.org\n\nSigned-off-by: Gaoxiang Liu <gaoxiangliu0@163.com>\n---\n drivers/net/vhost/rte_eth_vhost.c | 25 ++++---------------------\n lib/vhost/virtio_net.c | 21 +++++++++++++++++++++\n 2 files changed, 25 insertions(+), 21 deletions(-)", "diff": "diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c\nindex a202931e9..ae2055097 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -428,7 +428,6 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)\n {\n \tstruct vhost_queue *r = q;\n \tuint16_t i, nb_tx = 0;\n-\tuint16_t nb_send = 0;\n \tuint64_t nb_bytes = 0;\n \tuint64_t nb_missed = 0;\n \n@@ -440,33 +439,17 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)\n \tif (unlikely(rte_atomic32_read(&r->allow_queuing) == 0))\n \t\tgoto out;\n \n-\tfor (i = 0; i < nb_bufs; i++) {\n-\t\tstruct rte_mbuf *m = bufs[i];\n-\n-\t\t/* Do VLAN tag insertion */\n-\t\tif (m->ol_flags & PKT_TX_VLAN_PKT) {\n-\t\t\tint error = rte_vlan_insert(&m);\n-\t\t\tif (unlikely(error)) {\n-\t\t\t\trte_pktmbuf_free(m);\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t}\n-\n-\t\tbufs[nb_send] = m;\n-\t\t++nb_send;\n-\t}\n-\n \t/* Enqueue packets to guest RX queue */\n-\twhile (nb_send) {\n+\twhile (nb_bufs) {\n \t\tuint16_t nb_pkts;\n-\t\tuint16_t num = (uint16_t)RTE_MIN(nb_send,\n+\t\tuint16_t num = (uint16_t)RTE_MIN(nb_bufs,\n \t\t\t\t\t\t VHOST_MAX_PKT_BURST);\n \n \t\tnb_pkts = rte_vhost_enqueue_burst(r->vid, r->virtqueue_id,\n \t\t\t\t\t\t &bufs[nb_tx], num);\n \n \t\tnb_tx += nb_pkts;\n-\t\tnb_send -= nb_pkts;\n+\t\tnb_bufs -= nb_pkts;\n \t\tif (nb_pkts < num)\n \t\t\tbreak;\n \t}\n@@ -474,7 +457,7 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)\n \tfor (i = 0; likely(i < nb_tx); i++)\n \t\tnb_bytes += bufs[i]->pkt_len;\n \n-\tnb_missed = nb_bufs - nb_tx;\n+\tnb_missed = nb_bufs;\n \n \tr->stats.pkts += nb_tx;\n \tr->stats.bytes += nb_bytes;\ndiff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c\nindex b93482587..d62f5ca03 100644\n--- a/lib/vhost/virtio_net.c\n+++ b/lib/vhost/virtio_net.c\n@@ -1223,6 +1223,16 @@ virtio_dev_rx_split(struct virtio_net *dev, struct vhost_virtqueue *vq,\n \t\tuint32_t pkt_len = pkts[pkt_idx]->pkt_len + dev->vhost_hlen;\n \t\tuint16_t nr_vec = 0;\n \n+\t\t/* Do VLAN tag insertion */\n+\t\tif (pkts[pkt_idx]->ol_flags & PKT_TX_VLAN_PKT) {\n+\t\t\tint error = rte_vlan_insert(&pkts[pkt_idx]);\n+\t\t\tif (unlikely(error)) {\n+\t\t\t\trte_pktmbuf_free(pkts[pkt_idx]);\n+\t\t\t\tpkts[pkt_idx] = NULL;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t}\n+\n \t\tif (unlikely(reserve_avail_buf_split(dev, vq,\n \t\t\t\t\t\tpkt_len, buf_vec, &num_buffers,\n \t\t\t\t\t\tavail_head, &nr_vec) < 0)) {\n@@ -1374,6 +1384,17 @@ virtio_dev_rx_packed(struct virtio_net *dev,\n \tdo {\n \t\trte_prefetch0(&vq->desc_packed[vq->last_avail_idx]);\n \n+\t\t/* Do VLAN tag insertion */\n+\t\tif (pkts[pkt_idx]->ol_flags & PKT_TX_VLAN_PKT) {\n+\t\t\tint error = rte_vlan_insert(&pkts[pkt_idx]);\n+\t\t\tif (unlikely(error)) {\n+\t\t\t\trte_pktmbuf_free(pkts[pkt_idx]);\n+\t\t\t\tpkts[pkt_idx] = NULL;\n+\t\t\t\tpkt_idx++;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t}\n+\n \t\tif (count - pkt_idx >= PACKED_BATCH_SIZE) {\n \t\t\tif (!virtio_dev_rx_batch_packed(dev, vq,\n \t\t\t\t\t\t\t&pkts[pkt_idx])) {\n", "prefixes": [] }{ "id": 98525, "url": "