DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yongseok Koh <yskoh@mellanox.com>
To: wenzhuo.lu@intel.com, jingjing.wu@intel.com, bernard.iremonger@intel.com
Cc: dev@dpdk.org, qi.z.zhang@intel.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 2/2] app/testpmd: fix missing prefetch in macswap mode
Date: Mon, 14 Jan 2019 02:00:22 -0800	[thread overview]
Message-ID: <20190114100022.14867-2-yskoh@mellanox.com> (raw)
In-Reply-To: <20190114100022.14867-1-yskoh@mellanox.com>

Prefetching packet was missing when do_macswap() was optimized.

Fixes: 62b52877adbe ("app/testpmd: batch MAC swap for performance on x86")
Cc: qi.z.zhang@intel.com
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
 app/test-pmd/macswap_sse.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/app/test-pmd/macswap_sse.h b/app/test-pmd/macswap_sse.h
index 662fe79cf9..2b6e7324da 100644
--- a/app/test-pmd/macswap_sse.h
+++ b/app/test-pmd/macswap_sse.h
@@ -35,6 +35,13 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb,
 	r = nb;
 
 	while (r >= 4) {
+		if (r >= 8) {
+			rte_prefetch0(rte_pktmbuf_mtod(pkts[i + 4], void *));
+			rte_prefetch0(rte_pktmbuf_mtod(pkts[i + 5], void *));
+			rte_prefetch0(rte_pktmbuf_mtod(pkts[i + 6], void *));
+			rte_prefetch0(rte_pktmbuf_mtod(pkts[i + 7], void *));
+		}
+
 		mb[0] = pkts[i++];
 		eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct ether_hdr *);
 		addr0 = _mm_loadu_si128((__m128i *)eth_hdr[0]);
-- 
2.11.0

  reply	other threads:[~2019-01-14 10:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 10:00 [dpdk-dev] [PATCH 1/2] app/testpmd: fix wrong pointer reference in macswap Yongseok Koh
2019-01-14 10:00 ` Yongseok Koh [this message]
2019-01-14 13:40   ` [dpdk-dev] [PATCH 2/2] app/testpmd: fix missing prefetch in macswap mode Iremonger, Bernard
2019-01-14 13:39 ` [dpdk-dev] [PATCH 1/2] app/testpmd: fix wrong pointer reference in macswap Iremonger, Bernard
2019-01-14 14:35   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190114100022.14867-2-yskoh@mellanox.com \
    --to=yskoh@mellanox.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).