Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/50364/?format=api
http://patches.dpdk.org/api/patches/50364/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190219105951.31046-5-tiwei.bie@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": "<20190219105951.31046-5-tiwei.bie@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190219105951.31046-5-tiwei.bie@intel.com", "date": "2019-02-19T10:59:50", "name": "[4/5] net/virtio: introduce a helper for clearing net header", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "8db0e0a7828ba75efa39652ef63558efa91195f2", "submitter": { "id": 617, "url": "http://patches.dpdk.org/api/people/617/?format=api", "name": "Tiwei Bie", "email": "tiwei.bie@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/20190219105951.31046-5-tiwei.bie@intel.com/mbox/", "series": [ { "id": 3481, "url": "http://patches.dpdk.org/api/series/3481/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3481", "date": "2019-02-19T10:59:46", "name": "Fixes and enhancements for Tx path in Virtio PMD", "version": 1, "mbox": "http://patches.dpdk.org/series/3481/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/50364/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/50364/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 E228D1B163;\n\tTue, 19 Feb 2019 12:02:45 +0100 (CET)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 4F8D57CB0\n\tfor <dev@dpdk.org>; Tue, 19 Feb 2019 12:02:41 +0100 (CET)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Feb 2019 03:02:40 -0800", "from dpdk-tbie.sh.intel.com ([10.67.104.173])\n\tby orsmga002.jf.intel.com with ESMTP; 19 Feb 2019 03:02:40 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.58,388,1544515200\"; d=\"scan'208\";a=\"135430801\"", "From": "Tiwei Bie <tiwei.bie@intel.com>", "To": "maxime.coquelin@redhat.com,\n\tzhihong.wang@intel.com,\n\tdev@dpdk.org", "Date": "Tue, 19 Feb 2019 18:59:50 +0800", "Message-Id": "<20190219105951.31046-5-tiwei.bie@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190219105951.31046-1-tiwei.bie@intel.com>", "References": "<20190219105951.31046-1-tiwei.bie@intel.com>", "Subject": "[dpdk-dev] [PATCH 4/5] net/virtio: introduce a helper for clearing\n\tnet header", "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": "This patch introduces a helper for clearing the virtio net header\nto avoid the code duplication. Macro is used as it shows slightly\nbetter performance.\n\nSigned-off-by: Tiwei Bie <tiwei.bie@intel.com>\n---\n drivers/net/virtio/virtio_rxtx.c | 46 +++++++++++++-------------------\n 1 file changed, 18 insertions(+), 28 deletions(-)", "diff": "diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c\nindex c888aa9ff..60fa3aa50 100644\n--- a/drivers/net/virtio/virtio_rxtx.c\n+++ b/drivers/net/virtio/virtio_rxtx.c\n@@ -519,6 +519,15 @@ virtio_tso_fix_cksum(struct rte_mbuf *m)\n \t\t(var) = (val);\t\t\t\\\n } while (0)\n \n+#define virtqueue_clear_net_hdr(_hdr) do {\t\t\\\n+\tASSIGN_UNLESS_EQUAL((_hdr)->csum_start, 0);\t\\\n+\tASSIGN_UNLESS_EQUAL((_hdr)->csum_offset, 0);\t\\\n+\tASSIGN_UNLESS_EQUAL((_hdr)->flags, 0);\t\t\\\n+\tASSIGN_UNLESS_EQUAL((_hdr)->gso_type, 0);\t\\\n+\tASSIGN_UNLESS_EQUAL((_hdr)->gso_size, 0);\t\\\n+\tASSIGN_UNLESS_EQUAL((_hdr)->hdr_len, 0);\t\\\n+} while (0)\n+\n static inline void\n virtqueue_xmit_offload(struct virtio_net_hdr *hdr,\n \t\t\tstruct rte_mbuf *cookie,\n@@ -594,18 +603,11 @@ virtqueue_enqueue_xmit_inorder(struct virtnet_tx *txvq,\n \t\t\trte_pktmbuf_prepend(cookies[i], head_size);\n \t\tcookies[i]->pkt_len -= head_size;\n \n-\t\t/* if offload disabled, it is not zeroed below, do it now */\n-\t\tif (!vq->hw->has_tx_offload) {\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->csum_start, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->csum_offset, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->flags, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->gso_type, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->gso_size, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->hdr_len, 0);\n-\t\t}\n-\n-\t\tvirtqueue_xmit_offload(hdr, cookies[i],\n-\t\t\t\tvq->hw->has_tx_offload);\n+\t\t/* if offload disabled, hdr is not zeroed yet, do it now */\n+\t\tif (!vq->hw->has_tx_offload)\n+\t\t\tvirtqueue_clear_net_hdr(hdr);\n+\t\telse\n+\t\t\tvirtqueue_xmit_offload(hdr, cookies[i], true);\n \n \t\tstart_dp[idx].addr = VIRTIO_MBUF_DATA_DMA_ADDR(cookies[i], vq);\n \t\tstart_dp[idx].len = cookies[i]->data_len;\n@@ -659,14 +661,8 @@ virtqueue_enqueue_xmit_packed(struct virtnet_tx *txvq, struct rte_mbuf *cookie,\n \t\tcookie->pkt_len -= head_size;\n \n \t\t/* if offload disabled, it is not zeroed below, do it now */\n-\t\tif (!vq->hw->has_tx_offload) {\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->csum_start, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->csum_offset, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->flags, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->gso_type, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->gso_size, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->hdr_len, 0);\n-\t\t}\n+\t\tif (!vq->hw->has_tx_offload)\n+\t\t\tvirtqueue_clear_net_hdr(hdr);\n \t} else {\n \t\t/* setup first tx ring slot to point to header\n \t\t * stored in reserved region.\n@@ -758,14 +754,8 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie,\n \t\tcookie->pkt_len -= head_size;\n \n \t\t/* if offload disabled, it is not zeroed below, do it now */\n-\t\tif (!vq->hw->has_tx_offload) {\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->csum_start, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->csum_offset, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->flags, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->gso_type, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->gso_size, 0);\n-\t\t\tASSIGN_UNLESS_EQUAL(hdr->hdr_len, 0);\n-\t\t}\n+\t\tif (!vq->hw->has_tx_offload)\n+\t\t\tvirtqueue_clear_net_hdr(hdr);\n \t} else if (use_indirect) {\n \t\t/* setup tx ring slot to point to indirect\n \t\t * descriptor list stored in reserved region.\n", "prefixes": [ "4/5" ] }{ "id": 50364, "url": "