From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id EB7D41B1F6 for ; Mon, 14 Jan 2019 11:00:43 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 14 Jan 2019 12:00:42 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x0EA0brv016885; Mon, 14 Jan 2019 12:00:40 +0200 From: Yongseok Koh 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 Date: Mon, 14 Jan 2019 02:00:22 -0800 Message-Id: <20190114100022.14867-2-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190114100022.14867-1-yskoh@mellanox.com> References: <20190114100022.14867-1-yskoh@mellanox.com> Subject: [dpdk-dev] [PATCH 2/2] app/testpmd: fix missing prefetch in macswap mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2019 10:00:44 -0000 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 --- 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