From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 46BD0A04E7; Tue, 3 Nov 2020 02:58:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 922045F2F; Tue, 3 Nov 2020 02:58:50 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 25A6D5AAE for ; Tue, 3 Nov 2020 02:58:46 +0100 (CET) IronPort-SDR: Ob2Nmy/iTW2zw73r+Mo6tZDiWth0VPN/27R9FIE9ooqTbQza+kbmWRxW/5StV7ixBObPhp72jG bUxQ/J293klg== X-IronPort-AV: E=McAfee;i="6000,8403,9793"; a="165480012" X-IronPort-AV: E=Sophos;i="5.77,446,1596524400"; d="scan'208";a="165480012" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2020 17:58:45 -0800 IronPort-SDR: Jwer8QdsNKgWd4lS+epajgVc6nJhp4vKmb8mTdZYfJD7zl0VJsV89AISEZX8BMZiiOFK4G+nXG UfPawNFyNYBA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,446,1596524400"; d="scan'208";a="528227007" Received: from npg-dpdk-virtual-marvin-dev.sh.intel.com ([10.67.119.56]) by fmsmga005.fm.intel.com with ESMTP; 02 Nov 2020 17:58:43 -0800 From: Marvin Liu To: thomas@monjalon.net, Honnappa.Nagarahalli@arm.com Cc: bruce.richardson@intel.com, stephen@networkplumber.org, david.marchand@redhat.com, ferruh.yigit@intel.com, maxime.coquelin@redhat.com, drc@linux.vnet.ibm.com, Ruifeng.Wang@arm.com, dev@dpdk.org, Marvin Liu Date: Tue, 3 Nov 2020 09:57:30 +0800 Message-Id: <20201103015730.6952-1-yong.liu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200923015131.101203-1-yong.liu@intel.com> References: <20200923015131.101203-1-yong.liu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3] drivers/net: enable packet data prefetch on x86 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Data prefetch instruction can preload data into cpu’s hierarchical cache before data access. Data paths like e1000 and virtio utilized this feature for packet data access acceleration. Enabled packet data prefetch on x86 architecture, as prefetch instruction has been supported from very early generation. Signed-off-by: Marvin Liu --- v3: replace build config with pre-defined architecture macro v2: move define from meson.build to rte_config.h --- diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index 19e3bffd46..5a9cd04c9c 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -185,7 +185,7 @@ struct em_tx_queue { #define rte_em_prefetch(p) do {} while(0) #endif -#ifdef RTE_PMD_PACKET_PREFETCH +#if defined(RTE_ARCH_X86) #define rte_packet_prefetch(p) rte_prefetch1(p) #else #define rte_packet_prefetch(p) do {} while(0) diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index dd520cd82c..45d4ee0b92 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -198,7 +198,7 @@ struct igb_tx_queue { #define rte_igb_prefetch(p) do {} while(0) #endif -#ifdef RTE_PMD_PACKET_PREFETCH +#if defined(RTE_ARCH_X86) #define rte_packet_prefetch(p) rte_prefetch1(p) #else #define rte_packet_prefetch(p) do {} while(0) diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c index 6a8718c086..671c32038b 100644 --- a/drivers/net/enic/enic_rxtx.c +++ b/drivers/net/enic/enic_rxtx.c @@ -25,7 +25,7 @@ #define rte_enic_prefetch(p) do {} while (0) #endif -#ifdef RTE_PMD_PACKET_PREFETCH +#if defined(RTE_ARCH_X86) #define rte_packet_prefetch(p) rte_prefetch1(p) #else #define rte_packet_prefetch(p) do {} while (0) diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c index 4accaa2cd6..4bc3afadd1 100644 --- a/drivers/net/fm10k/fm10k_rxtx.c +++ b/drivers/net/fm10k/fm10k_rxtx.c @@ -10,7 +10,7 @@ #include "fm10k.h" #include "base/fm10k_type.h" -#ifdef RTE_PMD_PACKET_PREFETCH +#if defined(RTE_ARCH_X86) #define rte_packet_prefetch(p) rte_prefetch1(p) #else #define rte_packet_prefetch(p) do {} while (0) diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c index 4654ec41f0..b8b504738e 100644 --- a/drivers/net/igc/igc_txrx.c +++ b/drivers/net/igc/igc_txrx.c @@ -16,7 +16,7 @@ #define rte_igc_prefetch(p) do {} while (0) #endif -#ifdef RTE_PMD_PACKET_PREFETCH +#if defined(RTE_ARCH_X86) #define rte_packet_prefetch(p) rte_prefetch1(p) #else #define rte_packet_prefetch(p) do {} while (0) diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h index 6d2f7c9da3..4d39de9531 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.h +++ b/drivers/net/ixgbe/ixgbe_rxtx.h @@ -41,7 +41,7 @@ #define RX_RING_SZ ((IXGBE_MAX_RING_DESC + RTE_PMD_IXGBE_RX_MAX_BURST) * \ sizeof(union ixgbe_adv_rx_desc)) -#ifdef RTE_PMD_PACKET_PREFETCH +#if defined(RTE_ARCH_X86) #define rte_packet_prefetch(p) rte_prefetch1(p) #else #define rte_packet_prefetch(p) do {} while(0) diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h index 42c4c9882f..0196290a5d 100644 --- a/drivers/net/virtio/virtqueue.h +++ b/drivers/net/virtio/virtqueue.h @@ -106,7 +106,7 @@ virtqueue_store_flags_packed(struct vring_packed_desc *dp, dp->flags = flags; } } -#ifdef RTE_PMD_PACKET_PREFETCH +#if defined(RTE_ARCH_X86) #define rte_packet_prefetch(p) rte_prefetch1(p) #else #define rte_packet_prefetch(p) do {} while(0) -- 2.17.1